From a827471582f509e3d85cee5edc37b5c862ac5828 Mon Sep 17 00:00:00 2001 From: artemis prime Date: Sun, 21 Jan 2024 10:20:22 -0800 Subject: [PATCH 01/34] removed previous /ui --- .../ui/blocks/components/accordian-block.tsx | 50 -- .../ui/blocks/components/banner-block.tsx | 103 --- .../ui/blocks/components/block-factory.tsx | 52 -- packages/ui/blocks/components/card-block.tsx | 214 ------ packages/ui/blocks/components/cta-block.tsx | 58 -- packages/ui/blocks/components/group-block.tsx | 85 --- .../ui/blocks/components/heading-block.tsx | 45 -- packages/ui/blocks/components/image-block.tsx | 35 - packages/ui/blocks/components/index.ts | 23 - packages/ui/blocks/components/space-block.tsx | 47 -- packages/ui/blocks/components/video-block.tsx | 101 --- packages/ui/blocks/def/accordian-block.ts | 14 - packages/ui/blocks/def/banner-block.ts | 18 - packages/ui/blocks/def/block.ts | 7 - packages/ui/blocks/def/card-block.ts | 24 - packages/ui/blocks/def/cta-block.ts | 12 - packages/ui/blocks/def/element-block.ts | 11 - packages/ui/blocks/def/group-block.ts | 11 - packages/ui/blocks/def/heading-block.ts | 12 - packages/ui/blocks/def/image-block.ts | 12 - packages/ui/blocks/def/index.ts | 27 - packages/ui/blocks/def/space-block.ts | 10 - packages/ui/blocks/def/special-block.ts | 11 - packages/ui/blocks/def/video-block.ts | 27 - packages/ui/blocks/index.ts | 2 - packages/ui/common/action-button.tsx | 46 -- .../ui/common/contact-dialog/contact-form.tsx | 110 ---- .../ui/common/contact-dialog/disclaimer.tsx | 13 - packages/ui/common/contact-dialog/index.tsx | 48 -- packages/ui/common/copyright.tsx | 13 - packages/ui/common/drawer-menu.tsx | 43 -- packages/ui/common/footer.tsx | 53 -- packages/ui/common/header/index.tsx | 59 -- packages/ui/common/header/mobile-nav.tsx | 38 -- packages/ui/common/header/theme-toggle.tsx | 26 - packages/ui/common/icons/github.tsx | 14 - packages/ui/common/icons/index.tsx | 34 - packages/ui/common/icons/lux-logo.tsx | 10 - packages/ui/common/icons/secure-delivery.tsx | 13 - packages/ui/common/icons/social-icon.tsx | 35 - packages/ui/common/icons/youtube-logo.tsx | 59 -- packages/ui/common/index.ts | 16 - packages/ui/common/link-element.tsx | 70 -- packages/ui/common/logo.tsx | 52 -- packages/ui/common/main.tsx | 21 - packages/ui/common/mini-chart/index.tsx | 8 - .../ui/common/mini-chart/mini-chart-props.ts | 44 -- packages/ui/common/mini-chart/mini-chart.tsx | 76 --- packages/ui/common/mini-chart/wrapper.tsx | 23 - packages/ui/common/nav-items.tsx | 65 -- packages/ui/common/typography-test.mdx | 36 - packages/ui/common/youtube-embed.tsx | 83 --- packages/ui/conf/footer.tsx | 164 ----- packages/ui/conf/main-nav.ts | 58 -- .../ui/context-providers/theme-provider.tsx | 11 - packages/ui/index.ts | 21 - .../ui/next/determine-device-middleware.ts | 13 - packages/ui/next/index.ts | 11 - packages/ui/next/not-found-content.mdx | 4 - packages/ui/next/not-found.tsx | 23 - packages/ui/next/root-layout.tsx | 100 --- packages/ui/package.json | 50 -- packages/ui/primitives/accordion.tsx | 61 -- packages/ui/primitives/apply-typography.tsx | 51 -- packages/ui/primitives/button.tsx | 72 -- packages/ui/primitives/card.tsx | 83 --- .../ui/primitives/dialog-video-controller.tsx | 38 -- packages/ui/primitives/dialog.tsx | 145 ----- packages/ui/primitives/form.tsx | 179 ----- packages/ui/primitives/index.ts | 76 --- packages/ui/primitives/input.tsx | 30 - packages/ui/primitives/label.tsx | 28 - packages/ui/primitives/mdx-link.tsx | 22 - packages/ui/primitives/sheet.tsx | 147 ----- packages/ui/primitives/tailwind-indicator.tsx | 19 - packages/ui/primitives/toast.tsx | 129 ---- packages/ui/primitives/toaster.tsx | 37 -- packages/ui/primitives/use-toast.ts | 192 ------ packages/ui/primitives/video-player.tsx | 30 - packages/ui/style/colors.tailwind.js | 46 -- packages/ui/style/fonts.tailwind.js | 48 -- .../style/fonts/DrukTextWide-Bold-Trial.otf | Bin 73904 -> 0 bytes .../style/fonts/DrukTextWide-Heavy-Trial.otf | Bin 73948 -> 0 bytes .../style/fonts/DrukTextWide-Medium-Trial.otf | Bin 74120 -> 0 bytes packages/ui/style/get-plugin-styles.js | 616 ------------------ packages/ui/style/globals.css | 113 ---- packages/ui/style/nextFonts.ts | 34 - packages/ui/style/safelist.tailwind.js | 27 - packages/ui/style/screens.tailwind.js | 8 - packages/ui/style/social-svg.css | 3 - .../style/typo-plugin/demo/MarkdownSample.mdx | 223 ------- .../typo-plugin/demo/MarkdownSampleShort.mdx | 60 -- packages/ui/style/typo-plugin/demo/dark.js | 24 - .../ui/style/typo-plugin/demo/list-items.js | 176 ----- packages/ui/style/typo-plugin/demo/themes.js | 282 -------- .../ui/style/typo-plugin/demo/variants.js | 64 -- packages/ui/style/typo-plugin/index.d.ts | 9 - packages/ui/style/typo-plugin/index.js | 141 ---- packages/ui/style/typo-plugin/utils.js | 62 -- packages/ui/tsconfig.json | 13 - packages/ui/types/breakpoints.ts | 11 - packages/ui/types/button-def.ts | 39 -- packages/ui/types/contact-info.ts | 11 - packages/ui/types/dimensions.ts | 18 - packages/ui/types/icon.ts | 10 - packages/ui/types/index.ts | 38 -- packages/ui/types/link-def.ts | 21 - packages/ui/types/site-conf.ts | 18 - packages/ui/types/t-shirt-size.ts | 5 - packages/ui/util/classNames.ts | 3 - packages/ui/util/index.ts | 66 -- packages/ui/util/specifier.ts | 43 -- 112 files changed, 6145 deletions(-) delete mode 100644 packages/ui/blocks/components/accordian-block.tsx delete mode 100644 packages/ui/blocks/components/banner-block.tsx delete mode 100644 packages/ui/blocks/components/block-factory.tsx delete mode 100644 packages/ui/blocks/components/card-block.tsx delete mode 100644 packages/ui/blocks/components/cta-block.tsx delete mode 100644 packages/ui/blocks/components/group-block.tsx delete mode 100644 packages/ui/blocks/components/heading-block.tsx delete mode 100644 packages/ui/blocks/components/image-block.tsx delete mode 100644 packages/ui/blocks/components/index.ts delete mode 100644 packages/ui/blocks/components/space-block.tsx delete mode 100644 packages/ui/blocks/components/video-block.tsx delete mode 100644 packages/ui/blocks/def/accordian-block.ts delete mode 100644 packages/ui/blocks/def/banner-block.ts delete mode 100644 packages/ui/blocks/def/block.ts delete mode 100644 packages/ui/blocks/def/card-block.ts delete mode 100644 packages/ui/blocks/def/cta-block.ts delete mode 100644 packages/ui/blocks/def/element-block.ts delete mode 100644 packages/ui/blocks/def/group-block.ts delete mode 100644 packages/ui/blocks/def/heading-block.ts delete mode 100644 packages/ui/blocks/def/image-block.ts delete mode 100644 packages/ui/blocks/def/index.ts delete mode 100644 packages/ui/blocks/def/space-block.ts delete mode 100644 packages/ui/blocks/def/special-block.ts delete mode 100644 packages/ui/blocks/def/video-block.ts delete mode 100644 packages/ui/blocks/index.ts delete mode 100644 packages/ui/common/action-button.tsx delete mode 100644 packages/ui/common/contact-dialog/contact-form.tsx delete mode 100644 packages/ui/common/contact-dialog/disclaimer.tsx delete mode 100644 packages/ui/common/contact-dialog/index.tsx delete mode 100644 packages/ui/common/copyright.tsx delete mode 100644 packages/ui/common/drawer-menu.tsx delete mode 100644 packages/ui/common/footer.tsx delete mode 100644 packages/ui/common/header/index.tsx delete mode 100644 packages/ui/common/header/mobile-nav.tsx delete mode 100644 packages/ui/common/header/theme-toggle.tsx delete mode 100644 packages/ui/common/icons/github.tsx delete mode 100644 packages/ui/common/icons/index.tsx delete mode 100644 packages/ui/common/icons/lux-logo.tsx delete mode 100644 packages/ui/common/icons/secure-delivery.tsx delete mode 100644 packages/ui/common/icons/social-icon.tsx delete mode 100644 packages/ui/common/icons/youtube-logo.tsx delete mode 100644 packages/ui/common/index.ts delete mode 100644 packages/ui/common/link-element.tsx delete mode 100644 packages/ui/common/logo.tsx delete mode 100644 packages/ui/common/main.tsx delete mode 100644 packages/ui/common/mini-chart/index.tsx delete mode 100644 packages/ui/common/mini-chart/mini-chart-props.ts delete mode 100644 packages/ui/common/mini-chart/mini-chart.tsx delete mode 100644 packages/ui/common/mini-chart/wrapper.tsx delete mode 100644 packages/ui/common/nav-items.tsx delete mode 100644 packages/ui/common/typography-test.mdx delete mode 100644 packages/ui/common/youtube-embed.tsx delete mode 100644 packages/ui/conf/footer.tsx delete mode 100644 packages/ui/conf/main-nav.ts delete mode 100644 packages/ui/context-providers/theme-provider.tsx delete mode 100644 packages/ui/index.ts delete mode 100644 packages/ui/next/determine-device-middleware.ts delete mode 100644 packages/ui/next/index.ts delete mode 100644 packages/ui/next/not-found-content.mdx delete mode 100644 packages/ui/next/not-found.tsx delete mode 100644 packages/ui/next/root-layout.tsx delete mode 100644 packages/ui/package.json delete mode 100644 packages/ui/primitives/accordion.tsx delete mode 100644 packages/ui/primitives/apply-typography.tsx delete mode 100644 packages/ui/primitives/button.tsx delete mode 100644 packages/ui/primitives/card.tsx delete mode 100644 packages/ui/primitives/dialog-video-controller.tsx delete mode 100644 packages/ui/primitives/dialog.tsx delete mode 100644 packages/ui/primitives/form.tsx delete mode 100644 packages/ui/primitives/index.ts delete mode 100644 packages/ui/primitives/input.tsx delete mode 100644 packages/ui/primitives/label.tsx delete mode 100644 packages/ui/primitives/mdx-link.tsx delete mode 100644 packages/ui/primitives/sheet.tsx delete mode 100644 packages/ui/primitives/tailwind-indicator.tsx delete mode 100644 packages/ui/primitives/toast.tsx delete mode 100644 packages/ui/primitives/toaster.tsx delete mode 100644 packages/ui/primitives/use-toast.ts delete mode 100644 packages/ui/primitives/video-player.tsx delete mode 100644 packages/ui/style/colors.tailwind.js delete mode 100644 packages/ui/style/fonts.tailwind.js delete mode 100644 packages/ui/style/fonts/DrukTextWide-Bold-Trial.otf delete mode 100644 packages/ui/style/fonts/DrukTextWide-Heavy-Trial.otf delete mode 100644 packages/ui/style/fonts/DrukTextWide-Medium-Trial.otf delete mode 100644 packages/ui/style/get-plugin-styles.js delete mode 100644 packages/ui/style/globals.css delete mode 100644 packages/ui/style/nextFonts.ts delete mode 100644 packages/ui/style/safelist.tailwind.js delete mode 100644 packages/ui/style/screens.tailwind.js delete mode 100644 packages/ui/style/social-svg.css delete mode 100644 packages/ui/style/typo-plugin/demo/MarkdownSample.mdx delete mode 100644 packages/ui/style/typo-plugin/demo/MarkdownSampleShort.mdx delete mode 100644 packages/ui/style/typo-plugin/demo/dark.js delete mode 100644 packages/ui/style/typo-plugin/demo/list-items.js delete mode 100644 packages/ui/style/typo-plugin/demo/themes.js delete mode 100644 packages/ui/style/typo-plugin/demo/variants.js delete mode 100644 packages/ui/style/typo-plugin/index.d.ts delete mode 100644 packages/ui/style/typo-plugin/index.js delete mode 100644 packages/ui/style/typo-plugin/utils.js delete mode 100644 packages/ui/tsconfig.json delete mode 100644 packages/ui/types/breakpoints.ts delete mode 100644 packages/ui/types/button-def.ts delete mode 100644 packages/ui/types/contact-info.ts delete mode 100644 packages/ui/types/dimensions.ts delete mode 100644 packages/ui/types/icon.ts delete mode 100644 packages/ui/types/index.ts delete mode 100644 packages/ui/types/link-def.ts delete mode 100644 packages/ui/types/site-conf.ts delete mode 100644 packages/ui/types/t-shirt-size.ts delete mode 100644 packages/ui/util/classNames.ts delete mode 100644 packages/ui/util/index.ts delete mode 100644 packages/ui/util/specifier.ts diff --git a/packages/ui/blocks/components/accordian-block.tsx b/packages/ui/blocks/components/accordian-block.tsx deleted file mode 100644 index 6597c248..00000000 --- a/packages/ui/blocks/components/accordian-block.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react' - -import { - Accordion, - AccordionContent, - AccordionItem, - AccordionTrigger, - ApplyTypography -} from '../../primitives' - -import { cn } from '../../util' - -import type { Block, AccordianBlock } from '../def' - -const AccordianBlockComponent: React.FC<{ - block: Block - className?: string -}> = ({ - block, - className='' -}) => { - - if (block.blockType !== 'accordian') { - return <>accordian block required - } - - const accordian = block as AccordianBlock - - return ( - - {accordian.items.map((item, index) => ( - - - - {/* styles specific to accordion. From old site */} -
{item.trigger}
-
-
- - - {(typeof item.content === 'string') ? (

{item.content}

) : item.content} -
-
-
- ))} -
- ) -} - -export default AccordianBlockComponent diff --git a/packages/ui/blocks/components/banner-block.tsx b/packages/ui/blocks/components/banner-block.tsx deleted file mode 100644 index e550fc24..00000000 --- a/packages/ui/blocks/components/banner-block.tsx +++ /dev/null @@ -1,103 +0,0 @@ - -import React from 'react' - -import { Dimensions, type TShirtSize } from '../../types' -import type { Block, BannerBlock } from '../def' - -import VideoBlockComponent from './video-block' -import CTABlockComponent from './cta-block' - -type BannerGrouping = 'all-separate' | 'title-media-cta' | 'titleAndMedia-cta' - -const BannerBlockComponent: React.FC<{ - block: Block, - videoSize?: TShirtSize - videoConstraint?: Dimensions - grouping?: BannerGrouping - groupingClasses?: string[] // count should match number of siblings in the chosen grouping - ctaItemClassName?: string -}> = ({ - block, - grouping = 'titleAndMedia-cta', - groupingClasses=[], - ctaItemClassName='', - videoSize='md', - videoConstraint -}) => { - - if (block.blockType !== 'banner') { - return <>banner block required - } - const banner = block as BannerBlock - - if (grouping === 'title-media-cta') { - const titleClasses = (groupingClasses && groupingClasses[0]) ? groupingClasses[0] : '' - const mediaClasses = (groupingClasses && groupingClasses[1]) ? groupingClasses[1] : '' - const ctaClasses = (groupingClasses && groupingClasses[2]) ? groupingClasses[2] : '' - return (<> -
-

{banner.title}

- {banner.byline && (
{banner.byline}
)} -
-
- {banner.contentBefore && banner.contentBefore} - {banner.video && ( - - )} - {banner.contentAfter && banner.contentAfter } -
- {banner.cta && ( -
- -
- )} - ) - } - else if (grouping === 'titleAndMedia-cta') { - const titleAndMediaClasses = (groupingClasses && groupingClasses[0]) ? groupingClasses[0] : '' - const ctaClasses = (groupingClasses && groupingClasses[1]) ? groupingClasses[1] : '' - return (<> -
-

{banner.title}

- {banner.byline && (
{banner.byline}
)} - {banner.contentBefore && banner.contentBefore} - {banner.video && ( - - )} - {banner.contentAfter && banner.contentAfter } -
- {banner.cta && ( -
- -
- )} - ) - } - - const titleClasses = (groupingClasses && groupingClasses[0]) ? groupingClasses[0] : '' - const bylineClasses = (groupingClasses && groupingClasses[1]) ? groupingClasses[1] : '' - const contentBeforeClasses = (groupingClasses && groupingClasses[2]) ? groupingClasses[2] : '' - const mediaClasses = (groupingClasses && groupingClasses[3]) ? groupingClasses[3] : '' - const contentAfterClasses = (groupingClasses && groupingClasses[4]) ? groupingClasses[4] : '' - const ctaClasses = (groupingClasses && groupingClasses[5]) ? groupingClasses[5] : '' - - return (<> -

{banner.title}

- {banner.byline && (
{banner.byline}
)} - {banner.contentBefore && (
banner.contentBefore
)} - {banner.video && ( - - )} - {banner.contentAfter && (
banner.contentAfter
)} - {banner.cta && ( -
- -
- )} - ) -} - -export { - BannerBlockComponent as default, - type BannerGrouping as AssetBannderGroupingType -} diff --git a/packages/ui/blocks/components/block-factory.tsx b/packages/ui/blocks/components/block-factory.tsx deleted file mode 100644 index 676b05df..00000000 --- a/packages/ui/blocks/components/block-factory.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react' - -import type * as B from '../def' - -import CardBlockComponent from './card-block' -import HeadingBlockComponent from './heading-block' -import CTABlockComponent from './cta-block' -import SpaceBlockComponent from './space-block' -import ImageBlockComponent from './image-block' -import VideoBlockComponent from './video-block' -import AccordianBlockComponent from './accordian-block' -import GroupBlockComponent from './group-block' - -const BlockFactory: React.FC<{ - block: B.Block - className?: string -}> = ({ - block, - className='' -}) => { - - switch (block.blockType) { - case 'group': { - return - } - case 'card': { - return - } - case 'cta': { - return - } - case 'heading': { - return - } - case 'space': { - return - } - case 'video': { - return - } - case 'image': { - return - } - case 'accordian': { - return - } - } - - return <>unknown block type -} - -export default BlockFactory diff --git a/packages/ui/blocks/components/card-block.tsx b/packages/ui/blocks/components/card-block.tsx deleted file mode 100644 index 595b7261..00000000 --- a/packages/ui/blocks/components/card-block.tsx +++ /dev/null @@ -1,214 +0,0 @@ -import React from 'react' - -import type { Dimensions, LinkDef, TShirtDimensions } from '../../types' - -import { - ApplyTypography, - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, - type TypographySize -} from '../../primitives' - -import { - Icons, - LinkElement -} from '../../common' - -import { - getSpecifierData, - getPrimaryStartingWith, - getDim, -} from '../../util/specifier' - -import type { Block, CardBlock } from '../def' - - -import ImageBlockComponent from './image-block' -import VideoBlockComponent from './video-block' -import CTABlockComponent from './cta-block' - -const ArrowLinkElement: React.FC<{ - def: LinkDef, -}> = ({ - def -}) => ( - } - iconAfter - /> -) - -const getTypographySize = (s: string): TypographySize => ( - getSpecifierData( - s, - (s: string) => (getPrimaryStartingWith(s, 'typography')), - (s: string): TypographySize | undefined => { - const subTokenArray = s.split('-') - return subTokenArray[subTokenArray.length - 1] as TypographySize - }, - 'responsive' - ) as TypographySize -) - -const getSmallIconDim = (s: string): Dimensions | undefined => ( - getSpecifierData( - s, - (s: string) => (getPrimaryStartingWith(s, 'small-icon')), - getDim, - ) -) - -const CardBlockComponent: React.FC<{ - block: Block - className?: string - contentClassName?: string -}> = ({ - block, - className='', - contentClassName='' -}) => { - - if (block.blockType !== 'card') { - return <>card block required - } - - const card = block as CardBlock - const has = (s: string) => (card.specifiers?.includes(s)) - - const ghost = has('ghost') // no outer padding, no borders, larger title, all left-aligned bg is same (default) - - const contentclx = (has('content-left') ? 'items-start ' : 'items-center ') + contentClassName - const disabledBorder = (has('appear-disabled' ) ? ' border-muted-4' : ' border-muted-3') - const outerBorder = ((has('no-outer-border') || ghost) ? ' border-0' : '') - const innerBorder = (ghost ? ' border-0' : '') - const paddingclx = ghost ? ' px-0 py-0' : ' px-6 py-3' - const mainGap = ghost ? ' gap-2' : '' - const disabledText = (has('appear-disabled') ? ' text-muted-2' : '') - const disabledTypoText = (has('appear-disabled') ? ' typography-p:text-muted-2' : '') - const bgclx = (has('bg-card') ? ' bg-level-1' : '') - const titleclx = (has('heading-style-title') ? ' font-heading text-base leading-tight' : '') + - (ghost ? ' text-left md:text-xl' : '') - - const typoSize: TypographySize = (card.specifiers) ? getTypographySize(card.specifiers) : 'responsive' - const typoclx = (typoSize === 'sm') ? 'typography-sm typography-p:text-sm ' : (typoSize === 'lg') ? 'typography-lg ' : '' - - const contentBefore = has('content-before') - const iconInline = has('icon-inline') - const contentOnHover = has('reveal-content-on-hover') - //const smallIconDim = (contentOnHover && card.specifiers) ? getSmallIconDim(card.specifiers) : undefined - - const Header: React.FC<{ - inContent?: boolean - className?: string - }> = ({ - inContent=false, - className='' - }) => ( - (card.title || card.byline || card.icon) ? ( - -
- {(card.icon && !card.iconAfter ) && (
{card.icon}
)} - {card.title && ( - - {card.title} - - )} - {(card.icon && card.iconAfter) && (
{card.icon}
)} -
- {card.byline && ({card.byline})} -
- ) : null - ) - - const MediaAndContent: React.FC<{ - className?: string - }> = ({ - className='' - }) => (has('media-left') ? ( - // media left layout - - {card.media && ( -
- -
- )} - {card.content && ( - - {(typeof card.content === 'string') ? (

{card.content}

) : card.content} -
- )} -
- ) : ( // default layout - - {contentOnHover && (
)} - {card.content && contentBefore && ( - (typeof card.content === 'string') ? (

{card.content}

) : card.content - )} - {card.media && (card.media.blockType === 'image' ? ( - - ) : ( - - ))} - {card.content && !contentBefore && ( - (typeof card.content === 'string') ? (

{card.content}

) : card.content - )} - - )) - - const Footer: React.FC = () => ( !card.cta ? null : (has('links-w-arrow') ? ( - // links w arrow - - ()} - /> - - ) : ( // default - - - - ))) - - return ( - -