@craftzbay/ui 0.11.4 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist-lib/components/ui/Carousel.js.map +1 -1
- package/dist-lib/components/ui/Chart.js +72 -72
- package/dist-lib/components/ui/Chart.js.map +1 -1
- package/dist-lib/components/ui/Icon.js.map +1 -1
- package/dist-lib/hooks/use-debounce.js +2 -5
- package/dist-lib/hooks/use-debounce.js.map +1 -1
- package/dist-lib/hooks/use-delayed-loading.js +6 -5
- package/dist-lib/hooks/use-delayed-loading.js.map +1 -1
- package/dist-lib/hooks/use-modifier-key.d.ts +0 -4
- package/dist-lib/hooks/use-modifier-key.js +5 -7
- package/dist-lib/hooks/use-modifier-key.js.map +1 -1
- package/dist-lib/icons/index.d.ts +1 -1
- package/dist-lib/icons/index.js +81 -81
- package/dist-lib/icons/index.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -109,7 +109,7 @@ Inside `packages/ui` itself, `pnpm build` produces the distributable bundle and
|
|
|
109
109
|
## Tech stack
|
|
110
110
|
|
|
111
111
|
- **Tailwind CSS v4** — tokens defined in `@theme` in `src/styles/theme.css` (`globals.css` = tailwind + tw-animate-css + theme)
|
|
112
|
-
- **React 18 / 19** + **TypeScript 5.7
|
|
112
|
+
- **React 18 / 19** + **TypeScript 5.7+**
|
|
113
113
|
- **Radix UI** primitives for accessibility-correct overlays
|
|
114
114
|
- **class-variance-authority** + `cn()` (`clsx` + `tailwind-merge`)
|
|
115
115
|
- **Lucide** icons (16 / 20px, 1.5 stroke)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/ui/Carousel.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useState,\n type HTMLAttributes,\n type ComponentPropsWithoutRef,\n type KeyboardEvent,\n} from 'react';\nimport { version as reactVersion } from 'react';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeft, ChevronRight } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { formatString } from '@/lib/strings';\nimport { IconButton } from './IconButton';\n\n// `inert` is a boolean attribute. React 19 renders `inert={true}` as `inert=\"\"`;\n// React 18 has no knowledge of it and only forwards a string, so pass `''`\n// there (it would drop `true` with a warning). Typed loosely for both.\nconst INERT_PROPS = {\n inert: Number(reactVersion.split('.')[0]) >= 19 ? true : '',\n} as Record<string, unknown>;\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype CarouselOptions = Parameters<typeof useEmblaCarousel>[0];\n\ninterface CarouselContextValue {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: CarouselApi;\n canPrev: boolean;\n canNext: boolean;\n scrollPrev: () => void;\n scrollNext: () => void;\n orientation: 'horizontal' | 'vertical';\n slideCount: number;\n /** Indices of slides currently in view (others are inert). */\n inView: number[];\n}\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const ctx = useContext(CarouselContext);\n if (!ctx) throw new Error('Carousel components must be used inside <Carousel>');\n return ctx;\n}\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n opts?: CarouselOptions;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n}\n\n/**\n * Embla-backed carousel. Compose with `<CarouselContent>`, `<CarouselItem>`,\n * `<CarouselPrevious>`, and `<CarouselNext>`.\n */\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(function Carousel(\n {\n opts,\n orientation = 'horizontal',\n setApi,\n className,\n children,\n onKeyDown,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n },\n ref,\n) {\n const strings = useStrings();\n const [carouselRef, api] = useEmblaCarousel({\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n });\n const [canPrev, setCanPrev] = useState(false);\n const [canNext, setCanNext] = useState(false);\n const [slideCount, setSlideCount] = useState(0);\n const [inView, setInView] = useState<number[]>([]);\n\n const onSelect = useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanPrev(api.canScrollPrev());\n setCanNext(api.canScrollNext());\n setInView(api.slidesInView());\n }, []);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n const prevKey = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n if (event.key === prevKey) {\n event.preventDefault();\n api?.scrollPrev();\n } else if (event.key === nextKey) {\n event.preventDefault();\n api?.scrollNext();\n }\n };\n\n useEffect(() => {\n if (!api) return;\n setApi?.(api);\n onSelect(api);\n api.on('reInit', onSelect).on('select', onSelect).on('slidesInView', onSelect);\n return () => {\n api.off('reInit', onSelect).off('select', onSelect).off('slidesInView', onSelect);\n };\n }, [api, onSelect, setApi]);\n\n useEffect(() => {\n if (!api) return;\n const count = () => setSlideCount(api.slideNodes().length);\n count();\n api.on('reInit', count);\n return () => {\n api.off('reInit', count);\n };\n }, [api]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n canPrev,\n canNext,\n scrollPrev: () => api?.scrollPrev(),\n scrollNext: () => api?.scrollNext(),\n orientation,\n slideCount,\n inView,\n }}\n >\n {/* Arrow keys act only while focus is inside the region (it is not itself\n focusable); the buttons remain the primary control. */}\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <div\n ref={ref}\n className={cn('relative isolate', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label={ariaLabel ?? (ariaLabelledby ? undefined : strings.carousel.label)}\n aria-labelledby={ariaLabelledby}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n});\nCarousel.displayName = 'Carousel';\n\nexport const CarouselContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CarouselContent({ className, ...props }, ref) {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\nCarouselContent.displayName = 'CarouselContent';\n\nexport interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {\n /** 0-based position, used for the default \"{i+1} of {n}\" label. */\n index?: number;\n}\n\nexport const CarouselItem = forwardRef<HTMLDivElement, CarouselItemProps>(function CarouselItem(\n { className, index, 'aria-label': ariaLabel, ...props },\n ref,\n) {\n const strings = useStrings();\n const { orientation, slideCount, inView } = useCarousel();\n const defaultLabel =\n index !== undefined && slideCount > 0\n ? formatString(strings.carousel.slide, { index: index + 1, count: slideCount })\n : undefined;\n // Off-screen slides are inert: not in the tab order, not read by AT. Only\n // possible when `index` is provided (unknown index → always live).\n const offscreen = index !== undefined && inView.length > 0 && !inView.includes(index);\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={ariaLabel ?? defaultLabel}\n aria-hidden={offscreen || undefined}\n {...(offscreen ? INERT_PROPS : undefined)}\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = 'CarouselItem';\n\ntype CarouselButtonProps = Omit<\n ComponentPropsWithoutRef<typeof IconButton>,\n 'icon' | 'aria-label'\n> & { 'aria-label'?: string };\n\nexport const CarouselPrevious = forwardRef<HTMLButtonElement, CarouselButtonProps>(\n function CarouselPrevious({ className, 'aria-label': ariaLabel, ...props }, ref) {\n const { canPrev, scrollPrev, orientation } = useCarousel();\n const strings = useStrings();\n return (\n <IconButton\n ref={ref}\n aria-label={ariaLabel ?? strings.carousel.previous}\n variant=\"outline\"\n disabled={!canPrev}\n onClick={scrollPrev}\n icon={<ChevronLeft />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n {...props}\n />\n );\n },\n);\nCarouselPrevious.displayName = 'CarouselPrevious';\n\nexport const CarouselNext = forwardRef<HTMLButtonElement, CarouselButtonProps>(\n function CarouselNext({ className, 'aria-label': ariaLabel, ...props }, ref) {\n const { canNext, scrollNext, orientation } = useCarousel();\n const strings = useStrings();\n return (\n <IconButton\n ref={ref}\n aria-label={ariaLabel ?? strings.carousel.next}\n variant=\"outline\"\n disabled={!canNext}\n onClick={scrollNext}\n icon={<ChevronRight />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n {...props}\n />\n );\n },\n);\nCarouselNext.displayName = 'CarouselNext';\n"],"mappings":";;;;;;;;;;AAwBA,IAAM,IAAc,EAClB,OAAO,OAAO,EAAa,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,MAAY,GAC3D,GAkBM,IAAkB,EAA2C,IAAI;AAEvE,SAAS,IAAc;CACrB,IAAM,IAAM,EAAW,CAAe;CACtC,IAAI,CAAC,GAAK,MAAU,MAAM,oDAAoD;CAC9E,OAAO;AACT;AAYA,IAAa,IAAW,EAA0C,SAChE,EACE,SACA,iBAAc,cACd,WACA,cACA,aACA,cACA,cAAc,GACd,mBAAmB,GACnB,GAAG,KAEL,GACA;CACA,IAAM,IAAU,EAAW,GACrB,CAAC,GAAa,KAAO,EAAiB;EAC1C,GAAG;EACH,MAAM,MAAgB,eAAe,MAAM;CAC7C,CAAC,GACK,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,CAAC,GAAY,KAAiB,EAAS,CA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c,CAAA;EACpB,WAAW,EACT,iBACA,MAAgB,eACZ,sCACA,+CACJ,CACF;EACA,GAAI;CACL,CAAA;AAEL,CACF;AACA,EAAiB,cAAc;AAE/B,IAAa,IAAe,EAC1B,SAAsB,EAAE,cAAW,cAAc,GAAW,GAAG,KAAS,GAAK;CAC3E,IAAM,EAAE,YAAS,eAAY,mBAAgB,EAAY,GACnD,IAAU,EAAW;CAC3B,OACE,kBAAC,GAAD;EACO;EACL,cAAY,KAAa,EAAQ,SAAS;EAC1C,SAAQ;EACR,UAAU,CAAC;EACX,SAAS;EACT,MAAM,kBAAC,GAAD,CAAe,CAAA;EACrB,WAAW,EACT,iBACA,MAAgB,eACZ,uCACA,kDACJ,CACF;EACA,GAAI;CACL,CAAA;AAEL,CACF;AACA,EAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/ui/Carousel.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useState,\n type HTMLAttributes,\n type ComponentPropsWithoutRef,\n type KeyboardEvent,\n} from 'react';\nimport { version as reactVersion } from 'react';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeft, ChevronRight } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { formatString } from '@/lib/strings';\nimport { IconButton } from './IconButton';\n\n// `inert` is a boolean attribute. React 19 renders `inert={true}` as `inert=\"\"`;\n// React 18 has no knowledge of it and only forwards a string, so pass `''`\n// there (it would drop `true` with a warning). Typed loosely for both.\nconst INERT_PROPS = {\n inert: Number(reactVersion.split('.')[0]) >= 19 ? true : '',\n} as Record<string, unknown>;\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype CarouselOptions = Parameters<typeof useEmblaCarousel>[0];\n\ninterface CarouselContextValue {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: CarouselApi;\n canPrev: boolean;\n canNext: boolean;\n scrollPrev: () => void;\n scrollNext: () => void;\n orientation: 'horizontal' | 'vertical';\n slideCount: number;\n /** Indices of slides currently in view (others are inert). */\n inView: number[];\n}\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const ctx = useContext(CarouselContext);\n if (!ctx) throw new Error('Carousel components must be used inside <Carousel>');\n return ctx;\n}\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n opts?: CarouselOptions;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n}\n\n/**\n * Embla-backed carousel. Compose with `<CarouselContent>`, `<CarouselItem>`,\n * `<CarouselPrevious>`, and `<CarouselNext>`.\n */\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(function Carousel(\n {\n opts,\n orientation = 'horizontal',\n setApi,\n className,\n children,\n onKeyDown,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n },\n ref,\n) {\n const strings = useStrings();\n const [carouselRef, api] = useEmblaCarousel({\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n });\n const [canPrev, setCanPrev] = useState(false);\n const [canNext, setCanNext] = useState(false);\n const [slideCount, setSlideCount] = useState(0);\n const [inView, setInView] = useState<number[]>([]);\n\n const onSelect = useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanPrev(api.canScrollPrev());\n setCanNext(api.canScrollNext());\n setInView(api.slidesInView());\n }, []);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n const prevKey = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n const nextKey = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n if (event.key === prevKey) {\n event.preventDefault();\n api?.scrollPrev();\n } else if (event.key === nextKey) {\n event.preventDefault();\n api?.scrollNext();\n }\n };\n\n useEffect(() => {\n if (!api) return;\n setApi?.(api);\n // Initial sync from Embla (an external store); every later change arrives\n // through the events subscribed below.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n onSelect(api);\n api.on('reInit', onSelect).on('select', onSelect).on('slidesInView', onSelect);\n return () => {\n api.off('reInit', onSelect).off('select', onSelect).off('slidesInView', onSelect);\n };\n }, [api, onSelect, setApi]);\n\n useEffect(() => {\n if (!api) return;\n const count = () => setSlideCount(api.slideNodes().length);\n count();\n api.on('reInit', count);\n return () => {\n api.off('reInit', count);\n };\n }, [api]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n canPrev,\n canNext,\n scrollPrev: () => api?.scrollPrev(),\n scrollNext: () => api?.scrollNext(),\n orientation,\n slideCount,\n inView,\n }}\n >\n {/* Arrow keys act only while focus is inside the region (it is not itself\n focusable); the buttons remain the primary control. */}\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <div\n ref={ref}\n className={cn('relative isolate', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label={ariaLabel ?? (ariaLabelledby ? undefined : strings.carousel.label)}\n aria-labelledby={ariaLabelledby}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n});\nCarousel.displayName = 'Carousel';\n\nexport const CarouselContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n function CarouselContent({ className, ...props }, ref) {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\nCarouselContent.displayName = 'CarouselContent';\n\nexport interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {\n /** 0-based position, used for the default \"{i+1} of {n}\" label. */\n index?: number;\n}\n\nexport const CarouselItem = forwardRef<HTMLDivElement, CarouselItemProps>(function CarouselItem(\n { className, index, 'aria-label': ariaLabel, ...props },\n ref,\n) {\n const strings = useStrings();\n const { orientation, slideCount, inView } = useCarousel();\n const defaultLabel =\n index !== undefined && slideCount > 0\n ? formatString(strings.carousel.slide, { index: index + 1, count: slideCount })\n : undefined;\n // Off-screen slides are inert: not in the tab order, not read by AT. Only\n // possible when `index` is provided (unknown index → always live).\n const offscreen = index !== undefined && inView.length > 0 && !inView.includes(index);\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n aria-label={ariaLabel ?? defaultLabel}\n aria-hidden={offscreen || undefined}\n {...(offscreen ? INERT_PROPS : undefined)}\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = 'CarouselItem';\n\ntype CarouselButtonProps = Omit<\n ComponentPropsWithoutRef<typeof IconButton>,\n 'icon' | 'aria-label'\n> & { 'aria-label'?: string };\n\nexport const CarouselPrevious = forwardRef<HTMLButtonElement, CarouselButtonProps>(\n function CarouselPrevious({ className, 'aria-label': ariaLabel, ...props }, ref) {\n const { canPrev, scrollPrev, orientation } = useCarousel();\n const strings = useStrings();\n return (\n <IconButton\n ref={ref}\n aria-label={ariaLabel ?? strings.carousel.previous}\n variant=\"outline\"\n disabled={!canPrev}\n onClick={scrollPrev}\n icon={<ChevronLeft />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? 'top-1/2 -left-12 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n {...props}\n />\n );\n },\n);\nCarouselPrevious.displayName = 'CarouselPrevious';\n\nexport const CarouselNext = forwardRef<HTMLButtonElement, CarouselButtonProps>(\n function CarouselNext({ className, 'aria-label': ariaLabel, ...props }, ref) {\n const { canNext, scrollNext, orientation } = useCarousel();\n const strings = useStrings();\n return (\n <IconButton\n ref={ref}\n aria-label={ariaLabel ?? strings.carousel.next}\n variant=\"outline\"\n disabled={!canNext}\n onClick={scrollNext}\n icon={<ChevronRight />}\n className={cn(\n 'absolute z-10',\n orientation === 'horizontal'\n ? 'top-1/2 -right-12 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n {...props}\n />\n );\n },\n);\nCarouselNext.displayName = 'CarouselNext';\n"],"mappings":";;;;;;;;;;AAwBA,IAAM,IAAc,EAClB,OAAO,OAAO,EAAa,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,MAAY,GAC3D,GAkBM,IAAkB,EAA2C,IAAI;AAEvE,SAAS,IAAc;CACrB,IAAM,IAAM,EAAW,CAAe;CACtC,IAAI,CAAC,GAAK,MAAU,MAAM,oDAAoD;CAC9E,OAAO;AACT;AAYA,IAAa,IAAW,EAA0C,SAChE,EACE,SACA,iBAAc,cACd,WACA,cACA,aACA,cACA,cAAc,GACd,mBAAmB,GACnB,GAAG,KAEL,GACA;CACA,IAAM,IAAU,EAAW,GACrB,CAAC,GAAa,KAAO,EAAiB;EAC1C,GAAG;EACH,MAAM,MAAgB,eAAe,MAAM;CAC7C,CAAC,GACK,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,CAAC,GAAY,KAAiB,EAAS,CAAC,GACxC,CAAC,GAAQ,KAAa,EAAmB,CAAC,CAAC,GAE3C,IAAW,GAAa,MAAqB;EAC5C,MACL,EAAW,EAAI,cAAc,CAAC,GAC9B,EAAW,EAAI,cAAc,CAAC,GAC9B,EAAU,EAAI,aAAa,CAAC;CAC9B,GAAG,CAAC,CAAC;CAuCL,OAvBA,QAAgB;EACT,OAOL,OANA,IAAS,CAAG,GAIZ,EAAS,CAAG,GACZ,EAAI,GAAG,UAAU,CAAQ,CAAC,CAAC,GAAG,UAAU,CAAQ,CAAC,CAAC,GAAG,gBAAgB,CAAQ,SAChE;GACX,EAAI,IAAI,UAAU,CAAQ,CAAC,CAAC,IAAI,UAAU,CAAQ,CAAC,CAAC,IAAI,gBAAgB,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CACL,CAAA;AAEL,CACF;AACA,EAAa,cAAc"}
|
|
@@ -38,10 +38,10 @@ var h = [
|
|
|
38
38
|
"var(--chart-4)",
|
|
39
39
|
"var(--chart-5)",
|
|
40
40
|
"var(--chart-6)"
|
|
41
|
-
], g = 600, _ = 6;
|
|
42
|
-
function
|
|
41
|
+
], g = 600, _ = 6, v = typeof window > "u" ? a : s;
|
|
42
|
+
function y() {
|
|
43
43
|
let e = c(null), [t, n] = l(0);
|
|
44
|
-
return (
|
|
44
|
+
return v(() => {
|
|
45
45
|
let t = e.current;
|
|
46
46
|
if (!t) return;
|
|
47
47
|
let r = () => n(t.clientWidth);
|
|
@@ -53,19 +53,19 @@ function v() {
|
|
|
53
53
|
width: t || g
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
function
|
|
56
|
+
var b = 5;
|
|
57
|
+
function x(e) {
|
|
58
58
|
let t = Math.abs(e), n = (e, t) => `${(Math.round(e * 10) / 10).toString()}${t}`;
|
|
59
59
|
return t >= 1e9 ? n(e / 1e9, "B") : t >= 1e6 ? n(e / 1e6, "M") : t >= 1e3 ? n(e / 1e3, "K") : Number.isInteger(e) ? String(e) : (Math.round(e * 100) / 100).toString();
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function S(e) {
|
|
62
62
|
if (e <= 0) return 1;
|
|
63
63
|
let t = 10 ** Math.floor(Math.log10(e)), n = e / t;
|
|
64
64
|
return (n <= 1 ? 1 : n <= 2 ? 2 : n <= 2.5 ? 2.5 : n <= 5 ? 5 : 10) * t;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function C(e, t, n = b) {
|
|
67
67
|
t === e && (t = e + 1);
|
|
68
|
-
let r =
|
|
68
|
+
let r = S((t - e) / Math.max(1, n - 1)), i = Math.floor(e / r) * r, a = Math.ceil(t / r) * r, o = [];
|
|
69
69
|
for (let e = a; e >= i - r / 2; e -= r) o.push(Number(e.toFixed(10)));
|
|
70
70
|
return {
|
|
71
71
|
min: i,
|
|
@@ -73,12 +73,12 @@ function S(e, t, n = y) {
|
|
|
73
73
|
ticks: o
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function w(e, t) {
|
|
77
77
|
return t && t.length ? t : [{ data: e ?? [] }];
|
|
78
78
|
}
|
|
79
|
-
var
|
|
80
|
-
function
|
|
81
|
-
let n = e.flatMap((e) => e.data.map((e) => e.y).filter(
|
|
79
|
+
var T = (e) => typeof e == "number";
|
|
80
|
+
function E(e, t = !0) {
|
|
81
|
+
let n = e.flatMap((e) => e.data.map((e) => e.y).filter(T)), r = t ? Math.min(0, ...n) : Math.min(...n), i = Math.max(...n, t ? 1 : -Infinity), { min: a, max: o, ticks: s } = C(Number.isFinite(r) ? r : 0, i === -Infinity ? 1 : i);
|
|
82
82
|
return {
|
|
83
83
|
min: a,
|
|
84
84
|
max: o,
|
|
@@ -86,14 +86,14 @@ function T(e, t = !0) {
|
|
|
86
86
|
ticks: s
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function D(e, t, n, r, i) {
|
|
90
90
|
let a = t - 12, o = n - 12;
|
|
91
91
|
return {
|
|
92
92
|
sx: (t) => e <= 1 ? _ + a / 2 : _ + t / (e - 1) * a,
|
|
93
93
|
sy: (e) => _ + o - (e - r) / i * o
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function O(e) {
|
|
97
97
|
if (e.length === 0) return "";
|
|
98
98
|
if (e.length < 3) return e.map((e, t) => `${t ? "L" : "M"}${e[0]},${e[1]}`).join(" ");
|
|
99
99
|
let t = `M${e[0][0]},${e[0][1]}`;
|
|
@@ -103,18 +103,18 @@ function D(e) {
|
|
|
103
103
|
}
|
|
104
104
|
return t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function k(e, t, n) {
|
|
107
107
|
let r = [], i = [];
|
|
108
108
|
return e.forEach((e, a) => {
|
|
109
|
-
|
|
109
|
+
T(e.y) ? i.push([t(a), n(e.y)]) : i.length && (r.push(i), i = []);
|
|
110
110
|
}), i.length && r.push(i), r;
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
112
|
+
var A = (e, n, r) => e.name ?? t(r.series, { n: n + 1 });
|
|
113
|
+
function j(e, t, n) {
|
|
114
114
|
return e.map((e, r) => {
|
|
115
|
-
let i = e.data.map((e) => e.y).filter(
|
|
115
|
+
let i = e.data.map((e) => e.y).filter(T), a = A(e, r, t);
|
|
116
116
|
if (!i.length) return `${a}: ${t.noData}`;
|
|
117
|
-
let o = [...e.data].reverse().find((e) =>
|
|
117
|
+
let o = [...e.data].reverse().find((e) => T(e.y));
|
|
118
118
|
return n.summary({
|
|
119
119
|
name: a,
|
|
120
120
|
count: i.length,
|
|
@@ -125,7 +125,7 @@ function A(e, t, n) {
|
|
|
125
125
|
});
|
|
126
126
|
}).join(". ");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function M({ width: e, height: t, lines: n }) {
|
|
129
129
|
let r = t - 12, i = Math.max(1, n);
|
|
130
130
|
return /* @__PURE__ */ d("g", {
|
|
131
131
|
"aria-hidden": !0,
|
|
@@ -143,24 +143,24 @@ function j({ width: e, height: t, lines: n }) {
|
|
|
143
143
|
})
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function N({ ticks: e }) {
|
|
147
147
|
return /* @__PURE__ */ d("div", {
|
|
148
148
|
"aria-hidden": !0,
|
|
149
149
|
className: "tabular text-foreground-subtle pointer-events-none flex shrink-0 flex-col justify-between py-1.5 pr-1.5 text-right text-xs",
|
|
150
150
|
children: e.map((e, t) => /* @__PURE__ */ d("span", {
|
|
151
151
|
className: "leading-none",
|
|
152
|
-
children:
|
|
152
|
+
children: x(e)
|
|
153
153
|
}, t))
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function P({ first: e, last: t }) {
|
|
157
157
|
return e ? /* @__PURE__ */ f("div", {
|
|
158
158
|
"aria-hidden": !0,
|
|
159
159
|
className: "text-foreground-subtle flex justify-between text-xs",
|
|
160
160
|
children: [/* @__PURE__ */ d("span", { children: String(e.x) }), t && t !== e && /* @__PURE__ */ d("span", { children: String(t.x) })]
|
|
161
161
|
}) : null;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function F({ id: n, all: r, name: i, visible: a, t: o }) {
|
|
164
164
|
let s = Math.max(...r.map((e) => e.data.length)), c = r.find((e) => e.data.length === s)?.data ?? [], l = /* @__PURE__ */ f("table", {
|
|
165
165
|
id: n,
|
|
166
166
|
"data-chart-table": !0,
|
|
@@ -177,7 +177,7 @@ function P({ id: n, all: r, name: i, visible: a, t: o }) {
|
|
|
177
177
|
}), r.map((t, n) => /* @__PURE__ */ d("th", {
|
|
178
178
|
scope: "col",
|
|
179
179
|
className: e(a && "border-border border-b py-1 pr-3 font-medium"),
|
|
180
|
-
children:
|
|
180
|
+
children: A(t, n, o)
|
|
181
181
|
}, n))] }) }),
|
|
182
182
|
/* @__PURE__ */ d("tbody", { children: c.map((t, n) => /* @__PURE__ */ f("tr", { children: [/* @__PURE__ */ d("th", {
|
|
183
183
|
scope: "row",
|
|
@@ -185,7 +185,7 @@ function P({ id: n, all: r, name: i, visible: a, t: o }) {
|
|
|
185
185
|
children: String(t.x)
|
|
186
186
|
}), r.map((t, r) => /* @__PURE__ */ d("td", {
|
|
187
187
|
className: e(a && "py-0.5 pr-3"),
|
|
188
|
-
children:
|
|
188
|
+
children: T(t.data[n]?.y) ? String(t.data[n]?.y) : "—"
|
|
189
189
|
}, r))] }, n)) })
|
|
190
190
|
]
|
|
191
191
|
});
|
|
@@ -194,10 +194,10 @@ function P({ id: n, all: r, name: i, visible: a, t: o }) {
|
|
|
194
194
|
children: l
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
let T = n().chart, E = o().replace(/:/g, ""), D = `chart-cap-${E}`, O = `chart-title-${E}`, k = `chart-desc-${E}`,
|
|
199
|
-
process.env.NODE_ENV !== "production" && !
|
|
200
|
-
let H = (b ||
|
|
197
|
+
function I({ caption: t, ariaLabel: i, title: a, all: s, height: c, width: p, className: m, showAxis: h, ticks: g, xFirst: _, xLast: v, tableFallback: b, showTableToggle: x, state: S, labels: C, children: w }) {
|
|
198
|
+
let T = n().chart, E = o().replace(/:/g, ""), D = `chart-cap-${E}`, O = `chart-title-${E}`, k = `chart-desc-${E}`, A = `chart-table-${E}`, M = i ?? a, [I, R] = l(!1), { ref: z, width: B } = y(), V = L(s, T, C);
|
|
199
|
+
process.env.NODE_ENV !== "production" && !M && !t && console.warn("[craftzbay/ui] Chart: provide `caption`, `aria-label`, or `title` so the chart has an accessible name.");
|
|
200
|
+
let H = (b || I) && !S, U = S === "loading" ? /* @__PURE__ */ f("div", {
|
|
201
201
|
role: "status",
|
|
202
202
|
"aria-label": T.loading,
|
|
203
203
|
style: { height: c },
|
|
@@ -227,7 +227,7 @@ function F({ caption: t, ariaLabel: i, title: a, all: s, height: c, width: p, cl
|
|
|
227
227
|
U ?? /* @__PURE__ */ f(u, { children: [
|
|
228
228
|
/* @__PURE__ */ f("div", {
|
|
229
229
|
className: "flex",
|
|
230
|
-
children: [h && /* @__PURE__ */ d(
|
|
230
|
+
children: [h && /* @__PURE__ */ d(N, { ticks: g }), /* @__PURE__ */ d("div", {
|
|
231
231
|
ref: z,
|
|
232
232
|
className: "min-w-0 flex-1",
|
|
233
233
|
children: /* @__PURE__ */ f("svg", {
|
|
@@ -235,17 +235,17 @@ function F({ caption: t, ariaLabel: i, title: a, all: s, height: c, width: p, cl
|
|
|
235
235
|
width: B,
|
|
236
236
|
height: c,
|
|
237
237
|
role: "group",
|
|
238
|
-
"aria-labelledby": t ? D :
|
|
238
|
+
"aria-labelledby": t ? D : M ? O : void 0,
|
|
239
239
|
"aria-describedby": k,
|
|
240
240
|
className: "block max-w-full overflow-visible",
|
|
241
241
|
children: [
|
|
242
|
-
|
|
242
|
+
M && /* @__PURE__ */ d("title", {
|
|
243
243
|
id: O,
|
|
244
|
-
children:
|
|
244
|
+
children: M
|
|
245
245
|
}),
|
|
246
246
|
/* @__PURE__ */ d("desc", {
|
|
247
247
|
id: k,
|
|
248
|
-
children:
|
|
248
|
+
children: j(s, T, C)
|
|
249
249
|
}),
|
|
250
250
|
w({
|
|
251
251
|
width: B,
|
|
@@ -255,9 +255,9 @@ function F({ caption: t, ariaLabel: i, title: a, all: s, height: c, width: p, cl
|
|
|
255
255
|
})
|
|
256
256
|
})]
|
|
257
257
|
}),
|
|
258
|
-
h && /* @__PURE__ */ d(
|
|
258
|
+
h && /* @__PURE__ */ d(P, {
|
|
259
259
|
first: _,
|
|
260
|
-
last:
|
|
260
|
+
last: v
|
|
261
261
|
}),
|
|
262
262
|
/* @__PURE__ */ d("span", {
|
|
263
263
|
className: "sr-only",
|
|
@@ -269,36 +269,36 @@ function F({ caption: t, ariaLabel: i, title: a, all: s, height: c, width: p, cl
|
|
|
269
269
|
x && !S && /* @__PURE__ */ d("button", {
|
|
270
270
|
type: "button",
|
|
271
271
|
onClick: () => R((e) => !e),
|
|
272
|
-
"aria-expanded":
|
|
273
|
-
"aria-controls": H ?
|
|
272
|
+
"aria-expanded": I,
|
|
273
|
+
"aria-controls": H ? A : void 0,
|
|
274
274
|
className: e("text-foreground-subtle hover:text-foreground self-start rounded-sm text-xs underline-offset-2 outline-none hover:underline", "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2"),
|
|
275
|
-
children:
|
|
275
|
+
children: I ? T.hideTable : T.viewAsTable
|
|
276
276
|
}),
|
|
277
|
-
H && /* @__PURE__ */ d(
|
|
278
|
-
id:
|
|
277
|
+
H && /* @__PURE__ */ d(F, {
|
|
278
|
+
id: A,
|
|
279
279
|
all: s,
|
|
280
|
-
name:
|
|
281
|
-
visible:
|
|
280
|
+
name: M ?? (typeof t == "string" ? t : void 0),
|
|
281
|
+
visible: I,
|
|
282
282
|
t: T
|
|
283
283
|
})
|
|
284
284
|
]
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function L(t, n, r) {
|
|
288
288
|
let [a, o] = l(null), [s, c] = l(""), u = i((e, n) => {
|
|
289
289
|
let i = t[e], a = i?.data[n];
|
|
290
|
-
a &&
|
|
290
|
+
a && T(a.y) && (o({
|
|
291
291
|
series: e,
|
|
292
292
|
index: n
|
|
293
293
|
}), c(r.point(i.name, a.x, a.y)));
|
|
294
|
-
}, [t, r]), d = (e) => t[e].data.map((e, t) =>
|
|
294
|
+
}, [t, r]), d = (e) => t[e].data.map((e, t) => T(e.y) ? t : -1).filter((e) => e >= 0);
|
|
295
295
|
return {
|
|
296
296
|
active: a,
|
|
297
297
|
announcement: s,
|
|
298
298
|
seriesProps: (i) => ({
|
|
299
299
|
tabIndex: 0,
|
|
300
300
|
role: "group",
|
|
301
|
-
"aria-label": r.series(
|
|
301
|
+
"aria-label": r.series(A(t[i], i, n), d(i).length),
|
|
302
302
|
"data-chart-series": !0,
|
|
303
303
|
className: e("[&:focus-visible_[data-active]]:stroke-[var(--ring)] [&:focus-visible_[data-active]]:stroke-[3px]"),
|
|
304
304
|
onFocus: () => {
|
|
@@ -322,7 +322,7 @@ function I(t, n, r) {
|
|
|
322
322
|
})
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
|
-
function
|
|
325
|
+
function R({ x: t, y: n, color: r, label: i, always: a, active: o }) {
|
|
326
326
|
return /* @__PURE__ */ d("circle", {
|
|
327
327
|
cx: t,
|
|
328
328
|
cy: n,
|
|
@@ -333,33 +333,33 @@ function L({ x: t, y: n, color: r, label: i, always: a, active: o }) {
|
|
|
333
333
|
children: /* @__PURE__ */ d("title", { children: i })
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function z({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100%", caption: o, "aria-label": s, title: c, grid: l = !0, showAxis: p = !0, tableFallback: g = !0, showTableToggle: _, state: v, labels: y, className: b }) {
|
|
337
337
|
let x = n().chart, S = {
|
|
338
338
|
...m(x),
|
|
339
339
|
...y
|
|
340
|
-
},
|
|
341
|
-
return /* @__PURE__ */ d(
|
|
340
|
+
}, C = w(e, t), { min: A, range: j, ticks: N } = E(C), P = Math.max(...C.map((e) => e.data.length)), F = C[0].data;
|
|
341
|
+
return /* @__PURE__ */ d(I, {
|
|
342
342
|
caption: o,
|
|
343
343
|
ariaLabel: s,
|
|
344
344
|
title: c,
|
|
345
|
-
all:
|
|
345
|
+
all: C,
|
|
346
346
|
height: i,
|
|
347
347
|
width: a,
|
|
348
348
|
className: b,
|
|
349
349
|
showAxis: p,
|
|
350
350
|
ticks: N,
|
|
351
|
-
xFirst:
|
|
352
|
-
xLast:
|
|
351
|
+
xFirst: F[0],
|
|
352
|
+
xLast: F[F.length - 1],
|
|
353
353
|
tableFallback: g,
|
|
354
354
|
showTableToggle: _,
|
|
355
355
|
state: v,
|
|
356
356
|
labels: S,
|
|
357
|
-
children: ({ width: e, active: t, seriesProps: n }) => /* @__PURE__ */ f(u, { children: [l && /* @__PURE__ */ d(
|
|
357
|
+
children: ({ width: e, active: t, seriesProps: n }) => /* @__PURE__ */ f(u, { children: [l && /* @__PURE__ */ d(M, {
|
|
358
358
|
width: e,
|
|
359
359
|
height: i,
|
|
360
360
|
lines: N.length - 1
|
|
361
|
-
}),
|
|
362
|
-
let s = r[o % r.length], { sx: c, sy: l } =
|
|
361
|
+
}), C.map((a, o) => {
|
|
362
|
+
let s = r[o % r.length], { sx: c, sy: l } = D(P, e, i, A, j), u = k(a.data, c, l), p = u.map(O).join(" "), m = l(Math.max(A, 0)), h = u.map((e) => `${O(e)} L${e[e.length - 1][0].toFixed(1)},${m.toFixed(1)} L${e[0][0].toFixed(1)},${m.toFixed(1)} Z`).join(" "), g = a.data.map((e) => T(e.y)).lastIndexOf(!0);
|
|
363
363
|
return /* @__PURE__ */ f("g", {
|
|
364
364
|
...n(o),
|
|
365
365
|
children: [
|
|
@@ -376,7 +376,7 @@ function R({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100
|
|
|
376
376
|
strokeLinecap: "round",
|
|
377
377
|
strokeLinejoin: "round"
|
|
378
378
|
}),
|
|
379
|
-
a.data.map((e, n) =>
|
|
379
|
+
a.data.map((e, n) => T(e.y) ? /* @__PURE__ */ d(R, {
|
|
380
380
|
x: c(n),
|
|
381
381
|
y: l(e.y),
|
|
382
382
|
color: s,
|
|
@@ -389,15 +389,15 @@ function R({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100
|
|
|
389
389
|
})] })
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return /* @__PURE__ */ d(
|
|
392
|
+
function B(e) {
|
|
393
|
+
return /* @__PURE__ */ d(z, { ...e });
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
let S = n().chart,
|
|
395
|
+
function V({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100%", caption: o, "aria-label": s, title: c, grid: l = !0, showAxis: p = !0, tableFallback: g = !0, showTableToggle: v, state: y, labels: b, className: x }) {
|
|
396
|
+
let S = n().chart, C = {
|
|
397
397
|
...m(S),
|
|
398
398
|
...b
|
|
399
|
-
}, O =
|
|
400
|
-
return /* @__PURE__ */ d(
|
|
399
|
+
}, O = w(e, t), k = Math.max(...O.map((e) => e.data.length)), { min: A, range: j, ticks: N } = E(O), P = O[0].data;
|
|
400
|
+
return /* @__PURE__ */ d(I, {
|
|
401
401
|
caption: o,
|
|
402
402
|
ariaLabel: s,
|
|
403
403
|
title: c,
|
|
@@ -412,11 +412,11 @@ function B({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100
|
|
|
412
412
|
tableFallback: g,
|
|
413
413
|
showTableToggle: v,
|
|
414
414
|
state: y,
|
|
415
|
-
labels:
|
|
415
|
+
labels: C,
|
|
416
416
|
children: ({ width: e, active: t, seriesProps: n }) => {
|
|
417
|
-
let a = (e - 12) / Math.max(1, k), o = a * .62, s = Math.max(2, o / O.length), { sy: c } =
|
|
417
|
+
let a = (e - 12) / Math.max(1, k), o = a * .62, s = Math.max(2, o / O.length), { sy: c } = D(k, e, i, A, j), p = c(Math.min(Math.max(0, A), A + j));
|
|
418
418
|
return /* @__PURE__ */ f(u, { children: [
|
|
419
|
-
l && /* @__PURE__ */ d(
|
|
419
|
+
l && /* @__PURE__ */ d(M, {
|
|
420
420
|
width: e,
|
|
421
421
|
height: i,
|
|
422
422
|
lines: N.length - 1
|
|
@@ -433,8 +433,8 @@ function B({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100
|
|
|
433
433
|
O.map((e, i) => /* @__PURE__ */ d("g", {
|
|
434
434
|
...n(i),
|
|
435
435
|
children: e.data.map((n, l) => {
|
|
436
|
-
if (!
|
|
437
|
-
let u = c(n.y), f = _ + l * a + (a - o) / 2 + i * s, m =
|
|
436
|
+
if (!T(n.y)) return null;
|
|
437
|
+
let u = c(n.y), f = _ + l * a + (a - o) / 2 + i * s, m = C.point(e.name, n.x, n.y), h = t?.series === i && t.index === l;
|
|
438
438
|
return /* @__PURE__ */ d("rect", {
|
|
439
439
|
x: f,
|
|
440
440
|
y: Math.min(p, u),
|
|
@@ -453,6 +453,6 @@ function B({ data: e, series: t, colors: r = h, height: i = 160, width: a = "100
|
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
455
|
//#endregion
|
|
456
|
-
export {
|
|
456
|
+
export { B as AreaChart, V as BarChart, h as DEFAULT_CHART_COLORS, z as LineChart, x as abbreviateNumber, p as defaultChartLabels, C as niceTicks };
|
|
457
457
|
|
|
458
458
|
//# sourceMappingURL=Chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chart.js","names":[],"sources":["../../../src/components/ui/Chart.tsx"],"sourcesContent":["'use client';\n\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { formatString, type UiStrings } from '@/lib/strings';\nimport { Skeleton } from './Skeleton';\n\n/**\n * Tiny, dependency-free chart primitives for inline dashboards — sparklines,\n * KPI cards, at-a-glance trends. For heavy interactive visualisations reach for\n * a charting library. The SVG is drawn in real pixels: a ResizeObserver\n * measures the container width, so points and bars are never distorted.\n *\n * Keyboard: one tab stop per series; ←/→ (Home/End) move between points and\n * the active point is announced via a polite live region.\n */\n\nexport interface ChartPoint {\n x: string | number;\n /** `null` breaks the line (a gap) and is skipped in bars/tables. */\n y: number | null;\n}\n\nexport interface ChartSeries {\n /** Name used in the accessible summary, table header and tooltips. */\n name?: string;\n data: ChartPoint[];\n}\n\nexport type ChartState = 'loading' | 'empty' | 'error';\n\n/** Text builders for the accessible summary + point labels (i18n). */\nexport interface ChartLabels {\n /** `<desc>` sentence per series. */\n summary: (s: {\n name: string;\n count: number;\n min: number;\n max: number;\n lastX: string | number | undefined;\n lastY: number | undefined;\n }) => string;\n /** Label of one data point (tooltip, live region). */\n point: (name: string | undefined, x: string | number, y: number) => string;\n /** Accessible name of a series' tab stop. */\n series: (name: string, count: number) => string;\n}\n\nexport const defaultChartLabels: ChartLabels = {\n summary: ({ name, count, min, max, lastX, lastY }) =>\n `${name}: ${count} points, min ${min}, max ${max}, last ${lastX}: ${lastY}`,\n point: (name, x, y) => `${name ? `${name} — ` : ''}${x}: ${y}`,\n series: (name, count) => `${name}, ${count} points. Use arrow keys to move between points.`,\n};\n\nfunction chartLabelsFromStrings(t: UiStrings['chart']): ChartLabels {\n return {\n summary: ({ name, count, min, max, lastX, lastY }) =>\n formatString(t.summary, { name, count, min, max, x: lastX, y: lastY }),\n point: (name, x, y) => (name ? `${name} — ` : '') + formatString(t.point, { x, y }),\n series: (name, count) => formatString(t.seriesNav, { name, count }),\n };\n}\n\nexport interface ChartProps {\n /** Primary series. Ignored when `series` is provided. */\n data?: ChartPoint[];\n /** Multiple series drawn on the same scale. */\n series?: ChartSeries[];\n /** Per-series colours. Defaults to `--chart-1..6` (categorical; never the accent). */\n colors?: string[];\n /** Drawing height in px. */\n height?: number;\n /** Defaults to fluid 100%. */\n width?: number | string;\n /** Visible caption rendered above the chart. Doubles as the accessible name. */\n caption?: ReactNode;\n /** Accessible name when there is no `caption`. */\n 'aria-label'?: string;\n /** Alias of `aria-label` (SVG `<title>`). */\n title?: string;\n /** Faint horizontal gridlines. Default true. */\n grid?: boolean;\n /** Y-axis tick labels + first/last x labels. Default true. */\n showAxis?: boolean;\n /**\n * Render a visually-hidden `<table>` of the data after the SVG so screen\n * readers and copy/paste get the numbers. Default true.\n */\n tableFallback?: boolean;\n /** Show a small \"View as table\" toggle that reveals the fallback table. */\n showTableToggle?: boolean;\n /** Replace the drawing with a loading skeleton / empty / error message. */\n state?: ChartState;\n /** Override the generated accessible text (English defaults). */\n labels?: Partial<ChartLabels>;\n className?: string;\n}\n\nexport const DEFAULT_CHART_COLORS = [\n 'var(--chart-1)',\n 'var(--chart-2)',\n 'var(--chart-3)',\n 'var(--chart-4)',\n 'var(--chart-5)',\n 'var(--chart-6)',\n];\n\n// Width used before the container has been measured (SSR / first paint).\nconst FALLBACK_W = 600;\nconst PAD = 6;\n\n/** Measure the container's content width; re-renders on resize. */\nfunction useMeasuredWidth<T extends HTMLElement>() {\n const ref = useRef<T>(null);\n const [width, setWidth] = useState(0);\n const useIso = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n useIso(() => {\n const el = ref.current;\n if (!el) return;\n const update = () => setWidth(el.clientWidth);\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n return { ref, width: width || FALLBACK_W };\n}\nconst MAX_TICKS = 5;\n\n/** 1234 → \"1.2K\", 3_400_000 → \"3.4M\". */\nexport function abbreviateNumber(n: number): string {\n const abs = Math.abs(n);\n const fmt = (v: number, s: string) => `${(Math.round(v * 10) / 10).toString()}${s}`;\n if (abs >= 1e9) return fmt(n / 1e9, 'B');\n if (abs >= 1e6) return fmt(n / 1e6, 'M');\n if (abs >= 1e3) return fmt(n / 1e3, 'K');\n return Number.isInteger(n) ? String(n) : (Math.round(n * 100) / 100).toString();\n}\n\n/** Round a raw step up to 1 / 2 / 2.5 / 5 × 10^n. */\nfunction niceStep(raw: number): number {\n if (raw <= 0) return 1;\n const exp = Math.floor(Math.log10(raw));\n const base = 10 ** exp;\n const f = raw / base;\n const nice = f <= 1 ? 1 : f <= 2 ? 2 : f <= 2.5 ? 2.5 : f <= 5 ? 5 : 10;\n return nice * base;\n}\n\n/**\n * \"Nice\" axis: expands [min, max] to multiples of a 1/2/2.5/5 step so ticks\n * read as round numbers (never `754.5`).\n */\nexport function niceTicks(min: number, max: number, maxTicks = MAX_TICKS) {\n if (max === min) max = min + 1;\n const step = niceStep((max - min) / Math.max(1, maxTicks - 1));\n const lo = Math.floor(min / step) * step;\n const hi = Math.ceil(max / step) * step;\n const ticks: number[] = [];\n // +step/2 guards float drift; toFixed strips 0.30000000000000004-style noise.\n for (let v = hi; v >= lo - step / 2; v -= step) ticks.push(Number(v.toFixed(10)));\n return { min: lo, max: hi, ticks };\n}\n\nfunction resolveSeries(data?: ChartPoint[], series?: ChartSeries[]): ChartSeries[] {\n if (series && series.length) return series;\n return [{ data: data ?? [] }];\n}\n\nconst isNum = (v: number | null | undefined): v is number => typeof v === 'number';\n\nfunction domain(all: ChartSeries[], includeZero = true) {\n const ys = all.flatMap((s) => s.data.map((d) => d.y).filter(isNum));\n const rawMin = includeZero ? Math.min(0, ...ys) : Math.min(...ys);\n const rawMax = Math.max(...ys, includeZero ? 1 : -Infinity);\n const { min, max, ticks } = niceTicks(\n Number.isFinite(rawMin) ? rawMin : 0,\n rawMax === -Infinity ? 1 : rawMax,\n );\n return { min, max, range: max - min || 1, ticks };\n}\n\nfunction scales(length: number, w: number, h: number, min: number, range: number) {\n const innerW = w - PAD * 2;\n const innerH = h - PAD * 2;\n const sx = (i: number) => (length <= 1 ? PAD + innerW / 2 : PAD + (i / (length - 1)) * innerW);\n const sy = (v: number) => PAD + innerH - ((v - min) / range) * innerH;\n return { sx, sy };\n}\n\n/** Catmull-Rom → cubic bézier: a smooth curve through every point. */\nfunction smoothPath(pts: [number, number][]): string {\n if (pts.length === 0) return '';\n if (pts.length < 3) return pts.map((p, i) => `${i ? 'L' : 'M'}${p[0]},${p[1]}`).join(' ');\n let d = `M${pts[0][0]},${pts[0][1]}`;\n for (let i = 0; i < pts.length - 1; i++) {\n const p0 = pts[i - 1] ?? pts[i];\n const p1 = pts[i];\n const p2 = pts[i + 1];\n const p3 = pts[i + 2] ?? p2;\n const c1x = p1[0] + (p2[0] - p0[0]) / 6;\n const c1y = p1[1] + (p2[1] - p0[1]) / 6;\n const c2x = p2[0] - (p3[0] - p1[0]) / 6;\n const c2y = p2[1] - (p3[1] - p1[1]) / 6;\n d += ` C${c1x.toFixed(1)},${c1y.toFixed(1)} ${c2x.toFixed(1)},${c2y.toFixed(1)} ${p2[0].toFixed(1)},${p2[1].toFixed(1)}`;\n }\n return d;\n}\n\n/** Split at `null` gaps → one smooth sub-path per run of real values. */\nfunction segments(\n data: ChartPoint[],\n sx: (i: number) => number,\n sy: (v: number) => number,\n): [number, number][][] {\n const out: [number, number][][] = [];\n let run: [number, number][] = [];\n data.forEach((d, i) => {\n if (isNum(d.y)) run.push([sx(i), sy(d.y)]);\n else if (run.length) {\n out.push(run);\n run = [];\n }\n });\n if (run.length) out.push(run);\n return out;\n}\n\nconst seriesName = (s: ChartSeries, i: number, t: UiStrings['chart']) =>\n s.name ?? formatString(t.series, { n: i + 1 });\n\n/** Plain-language summary for the `<desc>` element. */\nfunction describe(all: ChartSeries[], t: UiStrings['chart'], labels: ChartLabels): string {\n return all\n .map((s, i) => {\n const ys = s.data.map((d) => d.y).filter(isNum);\n const name = seriesName(s, i, t);\n if (!ys.length) return `${name}: ${t.noData}`;\n const last = [...s.data].reverse().find((d) => isNum(d.y));\n return labels.summary({\n name,\n count: ys.length,\n min: Math.min(...ys),\n max: Math.max(...ys),\n lastX: last?.x,\n lastY: last?.y ?? undefined,\n });\n })\n .join('. ');\n}\n\nfunction Grid({ width, height, lines }: { width: number; height: number; lines: number }) {\n const innerH = height - PAD * 2;\n const n = Math.max(1, lines);\n return (\n <g aria-hidden>\n {Array.from({ length: n + 1 }, (_, i) => {\n const y = PAD + (i / n) * innerH;\n return (\n <line\n key={i}\n x1={0}\n x2={width}\n y1={y}\n y2={y}\n stroke=\"var(--color-border)\"\n strokeWidth={1}\n opacity={0.6}\n />\n );\n })}\n </g>\n );\n}\n\n/** Axis labels are HTML so they follow the document font and wrap normally. */\nfunction YAxis({ ticks }: { ticks: number[] }) {\n return (\n <div\n aria-hidden\n className=\"tabular text-foreground-subtle pointer-events-none flex shrink-0 flex-col justify-between py-1.5 pr-1.5 text-right text-xs\"\n >\n {ticks.map((t, i) => (\n <span key={i} className=\"leading-none\">\n {abbreviateNumber(t)}\n </span>\n ))}\n </div>\n );\n}\n\nfunction XAxis({ first, last }: { first?: ChartPoint; last?: ChartPoint }) {\n if (!first) return null;\n return (\n <div aria-hidden className=\"text-foreground-subtle flex justify-between text-xs\">\n <span>{String(first.x)}</span>\n {last && last !== first && <span>{String(last.x)}</span>}\n </div>\n );\n}\n\nfunction DataTable({\n id,\n all,\n name,\n visible,\n t,\n}: {\n id: string;\n all: ChartSeries[];\n name?: string;\n visible: boolean;\n t: UiStrings['chart'];\n}) {\n const longest = Math.max(...all.map((s) => s.data.length));\n const xs = all.find((s) => s.data.length === longest)?.data ?? [];\n // A <table> ignores `sr-only`'s 1px width (min-content wins) and can widen\n // the document on narrow viewports — hide it inside a wrapper instead.\n const table = (\n <table\n id={id}\n data-chart-table\n className={cn(visible && 'tabular text-foreground-muted mt-2 w-full text-left text-xs')}\n >\n <caption className={cn(visible && 'text-foreground-subtle pb-1 text-left')}>\n {formatString(t.tableCaption, { name: name ?? '' }).trim()}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\" className={cn(visible && 'border-border border-b py-1 pr-3 font-medium')}>\n x\n </th>\n {all.map((s, i) => (\n <th\n key={i}\n scope=\"col\"\n className={cn(visible && 'border-border border-b py-1 pr-3 font-medium')}\n >\n {seriesName(s, i, t)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {xs.map((p, i) => (\n <tr key={i}>\n <th scope=\"row\" className={cn(visible && 'py-0.5 pr-3 font-normal')}>\n {String(p.x)}\n </th>\n {all.map((s, si) => (\n <td key={si} className={cn(visible && 'py-0.5 pr-3')}>\n {isNum(s.data[i]?.y) ? String(s.data[i]?.y) : '—'}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n return visible ? table : <div className=\"sr-only\">{table}</div>;\n}\n\nfunction Frame({\n caption,\n ariaLabel,\n title,\n all,\n height,\n width,\n className,\n showAxis,\n ticks,\n xFirst,\n xLast,\n tableFallback,\n showTableToggle,\n state,\n labels,\n children,\n}: {\n caption?: ReactNode;\n ariaLabel?: string;\n title?: string;\n all: ChartSeries[];\n height: number;\n width: number | string;\n className?: string;\n showAxis: boolean;\n ticks: number[];\n xFirst?: ChartPoint;\n xLast?: ChartPoint;\n tableFallback: boolean;\n showTableToggle?: boolean;\n state?: ChartState;\n labels: ChartLabels;\n children: (ctx: FrameContext) => ReactNode;\n}) {\n const t = useStrings().chart;\n const id = useId().replace(/:/g, '');\n const captionId = `chart-cap-${id}`;\n const titleId = `chart-title-${id}`;\n const descId = `chart-desc-${id}`;\n const tableId = `chart-table-${id}`;\n const name = ariaLabel ?? title;\n const [tableOpen, setTableOpen] = useState(false);\n const { ref: plotRef, width: plotW } = useMeasuredWidth<HTMLDivElement>();\n const roving = useRovingPoints(all, t, labels);\n\n if (process.env.NODE_ENV !== 'production' && !name && !caption) {\n console.warn(\n '[craftzbay/ui] Chart: provide `caption`, `aria-label`, or `title` so the chart has an accessible name.',\n );\n }\n\n const tableRendered = (tableFallback || tableOpen) && !state;\n\n const stateNode =\n state === 'loading' ? (\n <div role=\"status\" aria-label={t.loading} style={{ height }} className=\"w-full\">\n <Skeleton style={{ height }} className=\"w-full\" />\n <span className=\"sr-only\">{t.loading}</span>\n </div>\n ) : state ? (\n <div\n role={state === 'error' ? 'alert' : 'status'}\n style={{ height }}\n className=\"text-foreground-subtle flex w-full items-center justify-center text-sm\"\n >\n {state === 'error' ? t.error : t.empty}\n </div>\n ) : null;\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)} style={{ width }}>\n {caption && (\n <figcaption id={captionId} className=\"text-foreground-muted text-xs\">\n {caption}\n </figcaption>\n )}\n {stateNode ?? (\n <>\n <div className=\"flex\">\n {showAxis && <YAxis ticks={ticks} />}\n {/* The plot area is measured; the SVG is drawn 1:1 in px inside it. */}\n <div ref={plotRef} className=\"min-w-0 flex-1\">\n {/* role=group (not img): series inside are focusable and carry their own labels. */}\n <svg\n viewBox={`0 0 ${plotW} ${height}`}\n width={plotW}\n height={height}\n role=\"group\"\n aria-labelledby={caption ? captionId : name ? titleId : undefined}\n aria-describedby={descId}\n className=\"block max-w-full overflow-visible\"\n >\n {name && <title id={titleId}>{name}</title>}\n <desc id={descId}>{describe(all, t, labels)}</desc>\n {children({ width: plotW, ...roving })}\n </svg>\n </div>\n </div>\n {showAxis && <XAxis first={xFirst} last={xLast} />}\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {roving.announcement}\n </span>\n </>\n )}\n {showTableToggle && !state && (\n <button\n type=\"button\"\n onClick={() => setTableOpen((v) => !v)}\n aria-expanded={tableOpen}\n aria-controls={tableRendered ? tableId : undefined}\n className={cn(\n 'text-foreground-subtle hover:text-foreground self-start rounded-sm text-xs underline-offset-2 outline-none hover:underline',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n )}\n >\n {tableOpen ? t.hideTable : t.viewAsTable}\n </button>\n )}\n {tableRendered && (\n <DataTable\n id={tableId}\n all={all}\n name={name ?? (typeof caption === 'string' ? caption : undefined)}\n visible={tableOpen}\n t={t}\n />\n )}\n </figure>\n );\n}\n\ninterface FrameContext {\n width: number;\n active: { series: number; index: number } | null;\n seriesProps: (si: number) => {\n tabIndex: number;\n role: 'group';\n 'aria-label': string;\n 'data-chart-series': true;\n onKeyDown: (e: KeyboardEvent<SVGGElement>) => void;\n onFocus: () => void;\n onBlur: () => void;\n className: string;\n };\n}\n\n/**\n * Roving focus: each series is a single tab stop; ←/→/Home/End move the\n * active point and the live region announces it. Per-point tab stops would\n * make a 200-point chart a 200-tab ordeal.\n */\nfunction useRovingPoints(all: ChartSeries[], t: UiStrings['chart'], labels: ChartLabels) {\n const [active, setActive] = useState<{ series: number; index: number } | null>(null);\n const [announcement, setAnnouncement] = useState('');\n\n const announce = useCallback(\n (si: number, idx: number) => {\n const s = all[si];\n const d = s?.data[idx];\n if (!d || !isNum(d.y)) return;\n setActive({ series: si, index: idx });\n setAnnouncement(labels.point(s.name, d.x, d.y));\n },\n [all, labels],\n );\n\n const validIndices = (si: number) =>\n all[si].data.map((d, i) => (isNum(d.y) ? i : -1)).filter((i) => i >= 0);\n\n const seriesProps = (si: number) => ({\n tabIndex: 0,\n role: 'group' as const,\n 'aria-label': labels.series(seriesName(all[si], si, t), validIndices(si).length),\n // Focus ring comes from theme.css `[data-chart-series]:focus-visible`\n // (CSS outline — Tailwind's box-shadow ring does not paint on SVG <g>).\n 'data-chart-series': true as const,\n className: cn(\n '[&:focus-visible_[data-active]]:stroke-[var(--ring)] [&:focus-visible_[data-active]]:stroke-[3px]',\n ),\n onFocus: () => {\n const idxs = validIndices(si);\n if (idxs.length) announce(si, active?.series === si ? active.index : idxs[idxs.length - 1]);\n },\n onBlur: () => {\n setActive(null);\n setAnnouncement('');\n },\n onKeyDown: (e: KeyboardEvent<SVGGElement>) => {\n const idxs = validIndices(si);\n if (!idxs.length) return;\n const pos = active?.series === si ? idxs.indexOf(active.index) : idxs.length - 1;\n let next = pos;\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') next = Math.min(idxs.length - 1, pos + 1);\n else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') next = Math.max(0, pos - 1);\n else if (e.key === 'Home') next = 0;\n else if (e.key === 'End') next = idxs.length - 1;\n else return;\n e.preventDefault();\n announce(si, idxs[next]);\n },\n });\n\n return { active, announcement, seriesProps };\n}\n\n/** Labelled data point. Invisible until hovered / active unless `always`. */\nfunction Point({\n x,\n y,\n color,\n label,\n always,\n active,\n}: {\n x: number;\n y: number;\n color: string;\n label: string;\n always?: boolean;\n active?: boolean;\n}) {\n return (\n <circle\n cx={x}\n cy={y}\n r={3.5}\n fill={color}\n data-active={active || undefined}\n className={cn(!always && !active && 'opacity-0 hover:opacity-100')}\n >\n <title>{label}</title>\n </circle>\n );\n}\n\nexport function LineChart({\n data,\n series,\n colors = DEFAULT_CHART_COLORS,\n height = 160,\n width = '100%',\n caption,\n 'aria-label': ariaLabel,\n title,\n grid = true,\n showAxis = true,\n tableFallback = true,\n showTableToggle,\n state,\n labels: labelsProp,\n className,\n}: ChartProps) {\n const t = useStrings().chart;\n const labels = { ...chartLabelsFromStrings(t), ...labelsProp };\n const all = resolveSeries(data, series);\n const { min, range, ticks } = domain(all);\n const longest = Math.max(...all.map((s) => s.data.length));\n const primary = all[0].data;\n\n return (\n <Frame\n caption={caption}\n ariaLabel={ariaLabel}\n title={title}\n all={all}\n height={height}\n width={width}\n className={className}\n showAxis={showAxis}\n ticks={ticks}\n xFirst={primary[0]}\n xLast={primary[primary.length - 1]}\n tableFallback={tableFallback}\n showTableToggle={showTableToggle}\n state={state}\n labels={labels}\n >\n {({ width: w, active, seriesProps }) => (\n <>\n {grid && <Grid width={w} height={height} lines={ticks.length - 1} />}\n {all.map((s, si) => {\n const color = colors[si % colors.length];\n const { sx, sy } = scales(longest, w, height, min, range);\n const segs = segments(s.data, sx, sy);\n const line = segs.map(smoothPath).join(' ');\n const baseline = sy(Math.max(min, 0));\n const area = segs\n .map(\n (pts) =>\n `${smoothPath(pts)} L${pts[pts.length - 1][0].toFixed(1)},${baseline.toFixed(1)} L${pts[0][0].toFixed(1)},${baseline.toFixed(1)} Z`,\n )\n .join(' ');\n const lastIdx = s.data.map((d) => isNum(d.y)).lastIndexOf(true);\n return (\n <g key={si} {...seriesProps(si)}>\n {area && <path d={area} fill={color} fillOpacity={0.08} />}\n <path\n d={line}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n {s.data.map((d, i) =>\n isNum(d.y) ? (\n <Point\n key={i}\n x={sx(i)}\n y={sy(d.y)}\n color={color}\n always={i === lastIdx}\n active={active?.series === si && active.index === i}\n label={labels.point(s.name, d.x, d.y)}\n />\n ) : null,\n )}\n </g>\n );\n })}\n </>\n )}\n </Frame>\n );\n}\n\nexport function AreaChart(props: ChartProps) {\n // The line chart already renders a flat low-opacity area; alias for intent / naming.\n return <LineChart {...props} />;\n}\n\nexport function BarChart({\n data,\n series,\n colors = DEFAULT_CHART_COLORS,\n height = 160,\n width = '100%',\n caption,\n 'aria-label': ariaLabel,\n title,\n grid = true,\n showAxis = true,\n tableFallback = true,\n showTableToggle,\n state,\n labels: labelsProp,\n className,\n}: ChartProps) {\n const t = useStrings().chart;\n const labels = { ...chartLabelsFromStrings(t), ...labelsProp };\n const all = resolveSeries(data, series);\n const longest = Math.max(...all.map((s) => s.data.length));\n const { min, range, ticks } = domain(all);\n const primary = all[0].data;\n\n return (\n <Frame\n caption={caption}\n ariaLabel={ariaLabel}\n title={title}\n all={all}\n height={height}\n width={width}\n className={className}\n showAxis={showAxis}\n ticks={ticks}\n xFirst={primary[0]}\n xLast={primary[primary.length - 1]}\n tableFallback={tableFallback}\n showTableToggle={showTableToggle}\n state={state}\n labels={labels}\n >\n {({ width: w, active, seriesProps }) => {\n const innerW = w - PAD * 2;\n const slot = innerW / Math.max(1, longest);\n const groupW = slot * 0.62;\n const barW = Math.max(2, groupW / all.length);\n const { sy } = scales(longest, w, height, min, range);\n // Bars grow from the zero line, so negatives hang below it.\n const zeroY = sy(Math.min(Math.max(0, min), min + range));\n return (\n <>\n {grid && <Grid width={w} height={height} lines={ticks.length - 1} />}\n {min < 0 && (\n <line\n aria-hidden\n x1={0}\n x2={w}\n y1={zeroY}\n y2={zeroY}\n stroke=\"var(--color-border-strong)\"\n strokeWidth={1}\n />\n )}\n {all.map((s, si) => (\n <g key={si} {...seriesProps(si)}>\n {s.data.map((d, i) => {\n if (!isNum(d.y)) return null;\n const yv = sy(d.y);\n const x = PAD + i * slot + (slot - groupW) / 2 + si * barW;\n const label = labels.point(s.name, d.x, d.y);\n const isActive = active?.series === si && active.index === i;\n return (\n <rect\n key={i}\n x={x}\n y={Math.min(zeroY, yv)}\n width={barW}\n height={Math.abs(zeroY - yv)}\n fill={colors[si % colors.length]}\n rx={2}\n data-active={isActive || undefined}\n className=\"transition-opacity hover:opacity-80\"\n >\n <title>{label}</title>\n </rect>\n );\n })}\n </g>\n ))}\n </>\n );\n }}\n </Frame>\n );\n}\n"],"mappings":";;;;;;;;AA0DA,IAAa,IAAkC;CAC7C,UAAU,EAAE,SAAM,UAAO,QAAK,QAAK,UAAO,eACxC,GAAG,EAAK,IAAI,EAAM,eAAe,EAAI,QAAQ,EAAI,SAAS,EAAM,IAAI;CACtE,QAAQ,GAAM,GAAG,MAAM,GAAG,IAAO,GAAG,EAAK,OAAO,KAAK,EAAE,IAAI;CAC3D,SAAS,GAAM,MAAU,GAAG,EAAK,IAAI,EAAM;AAC7C;AAEA,SAAS,EAAuB,GAAoC;CAClE,OAAO;EACL,UAAU,EAAE,SAAM,UAAO,QAAK,QAAK,UAAO,eACxC,EAAa,EAAE,SAAS;GAAE;GAAM;GAAO;GAAK;GAAK,GAAG;GAAO,GAAG;EAAM,CAAC;EACvE,QAAQ,GAAM,GAAG,OAAO,IAAO,GAAG,EAAK,OAAO,MAAM,EAAa,EAAE,OAAO;GAAE;GAAG;EAAE,CAAC;EAClF,SAAS,GAAM,MAAU,EAAa,EAAE,WAAW;GAAE;GAAM;EAAM,CAAC;C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AAC,GACX,IAAI,IAAM,IAAI,KAAQ,IAAO,KAAU,IAAI,IAAK,GAChD,IAAQ,EAAO,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GACrC,IAAW,GAAQ,WAAW,KAAM,EAAO,UAAU;MAC3D,OACE,kBAAC,QAAD;OAEK;OACH,GAAG,KAAK,IAAI,GAAO,CAAE;OACrB,OAAO;OACP,QAAQ,KAAK,IAAI,IAAQ,CAAE;OAC3B,MAAM,EAAO,IAAK,EAAO;OACzB,IAAI;OACJ,eAAa,KAAY,KAAA;OACzB,WAAU;OAEV,UAAA,kBAAC,SAAD,EAAA,UAAQ,EAAa,CAAA;MACjB,GAXC,CAWD;KAEV,CAAC;IACA,GAvBK,CAuBL,CACJ;GACD,EAAA,CAAA;EAEN;CACK,CAAA;AAEX"}
|
|
1
|
+
{"version":3,"file":"Chart.js","names":[],"sources":["../../../src/components/ui/Chart.tsx"],"sourcesContent":["'use client';\n\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { formatString, type UiStrings } from '@/lib/strings';\nimport { Skeleton } from './Skeleton';\n\n/**\n * Tiny, dependency-free chart primitives for inline dashboards — sparklines,\n * KPI cards, at-a-glance trends. For heavy interactive visualisations reach for\n * a charting library. The SVG is drawn in real pixels: a ResizeObserver\n * measures the container width, so points and bars are never distorted.\n *\n * Keyboard: one tab stop per series; ←/→ (Home/End) move between points and\n * the active point is announced via a polite live region.\n */\n\nexport interface ChartPoint {\n x: string | number;\n /** `null` breaks the line (a gap) and is skipped in bars/tables. */\n y: number | null;\n}\n\nexport interface ChartSeries {\n /** Name used in the accessible summary, table header and tooltips. */\n name?: string;\n data: ChartPoint[];\n}\n\nexport type ChartState = 'loading' | 'empty' | 'error';\n\n/** Text builders for the accessible summary + point labels (i18n). */\nexport interface ChartLabels {\n /** `<desc>` sentence per series. */\n summary: (s: {\n name: string;\n count: number;\n min: number;\n max: number;\n lastX: string | number | undefined;\n lastY: number | undefined;\n }) => string;\n /** Label of one data point (tooltip, live region). */\n point: (name: string | undefined, x: string | number, y: number) => string;\n /** Accessible name of a series' tab stop. */\n series: (name: string, count: number) => string;\n}\n\nexport const defaultChartLabels: ChartLabels = {\n summary: ({ name, count, min, max, lastX, lastY }) =>\n `${name}: ${count} points, min ${min}, max ${max}, last ${lastX}: ${lastY}`,\n point: (name, x, y) => `${name ? `${name} — ` : ''}${x}: ${y}`,\n series: (name, count) => `${name}, ${count} points. Use arrow keys to move between points.`,\n};\n\nfunction chartLabelsFromStrings(t: UiStrings['chart']): ChartLabels {\n return {\n summary: ({ name, count, min, max, lastX, lastY }) =>\n formatString(t.summary, { name, count, min, max, x: lastX, y: lastY }),\n point: (name, x, y) => (name ? `${name} — ` : '') + formatString(t.point, { x, y }),\n series: (name, count) => formatString(t.seriesNav, { name, count }),\n };\n}\n\nexport interface ChartProps {\n /** Primary series. Ignored when `series` is provided. */\n data?: ChartPoint[];\n /** Multiple series drawn on the same scale. */\n series?: ChartSeries[];\n /** Per-series colours. Defaults to `--chart-1..6` (categorical; never the accent). */\n colors?: string[];\n /** Drawing height in px. */\n height?: number;\n /** Defaults to fluid 100%. */\n width?: number | string;\n /** Visible caption rendered above the chart. Doubles as the accessible name. */\n caption?: ReactNode;\n /** Accessible name when there is no `caption`. */\n 'aria-label'?: string;\n /** Alias of `aria-label` (SVG `<title>`). */\n title?: string;\n /** Faint horizontal gridlines. Default true. */\n grid?: boolean;\n /** Y-axis tick labels + first/last x labels. Default true. */\n showAxis?: boolean;\n /**\n * Render a visually-hidden `<table>` of the data after the SVG so screen\n * readers and copy/paste get the numbers. Default true.\n */\n tableFallback?: boolean;\n /** Show a small \"View as table\" toggle that reveals the fallback table. */\n showTableToggle?: boolean;\n /** Replace the drawing with a loading skeleton / empty / error message. */\n state?: ChartState;\n /** Override the generated accessible text (English defaults). */\n labels?: Partial<ChartLabels>;\n className?: string;\n}\n\nexport const DEFAULT_CHART_COLORS = [\n 'var(--chart-1)',\n 'var(--chart-2)',\n 'var(--chart-3)',\n 'var(--chart-4)',\n 'var(--chart-5)',\n 'var(--chart-6)',\n];\n\n// Width used before the container has been measured (SSR / first paint).\nconst FALLBACK_W = 600;\nconst PAD = 6;\n\n/** `useLayoutEffect` warns during SSR; fall back to `useEffect` there. */\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n/** Measure the container's content width; re-renders on resize. */\nfunction useMeasuredWidth<T extends HTMLElement>() {\n const ref = useRef<T>(null);\n const [width, setWidth] = useState(0);\n useIsomorphicLayoutEffect(() => {\n const el = ref.current;\n if (!el) return;\n const update = () => setWidth(el.clientWidth);\n update();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(update);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n return { ref, width: width || FALLBACK_W };\n}\nconst MAX_TICKS = 5;\n\n/** 1234 → \"1.2K\", 3_400_000 → \"3.4M\". */\nexport function abbreviateNumber(n: number): string {\n const abs = Math.abs(n);\n const fmt = (v: number, s: string) => `${(Math.round(v * 10) / 10).toString()}${s}`;\n if (abs >= 1e9) return fmt(n / 1e9, 'B');\n if (abs >= 1e6) return fmt(n / 1e6, 'M');\n if (abs >= 1e3) return fmt(n / 1e3, 'K');\n return Number.isInteger(n) ? String(n) : (Math.round(n * 100) / 100).toString();\n}\n\n/** Round a raw step up to 1 / 2 / 2.5 / 5 × 10^n. */\nfunction niceStep(raw: number): number {\n if (raw <= 0) return 1;\n const exp = Math.floor(Math.log10(raw));\n const base = 10 ** exp;\n const f = raw / base;\n const nice = f <= 1 ? 1 : f <= 2 ? 2 : f <= 2.5 ? 2.5 : f <= 5 ? 5 : 10;\n return nice * base;\n}\n\n/**\n * \"Nice\" axis: expands [min, max] to multiples of a 1/2/2.5/5 step so ticks\n * read as round numbers (never `754.5`).\n */\nexport function niceTicks(min: number, max: number, maxTicks = MAX_TICKS) {\n if (max === min) max = min + 1;\n const step = niceStep((max - min) / Math.max(1, maxTicks - 1));\n const lo = Math.floor(min / step) * step;\n const hi = Math.ceil(max / step) * step;\n const ticks: number[] = [];\n // +step/2 guards float drift; toFixed strips 0.30000000000000004-style noise.\n for (let v = hi; v >= lo - step / 2; v -= step) ticks.push(Number(v.toFixed(10)));\n return { min: lo, max: hi, ticks };\n}\n\nfunction resolveSeries(data?: ChartPoint[], series?: ChartSeries[]): ChartSeries[] {\n if (series && series.length) return series;\n return [{ data: data ?? [] }];\n}\n\nconst isNum = (v: number | null | undefined): v is number => typeof v === 'number';\n\nfunction domain(all: ChartSeries[], includeZero = true) {\n const ys = all.flatMap((s) => s.data.map((d) => d.y).filter(isNum));\n const rawMin = includeZero ? Math.min(0, ...ys) : Math.min(...ys);\n const rawMax = Math.max(...ys, includeZero ? 1 : -Infinity);\n const { min, max, ticks } = niceTicks(\n Number.isFinite(rawMin) ? rawMin : 0,\n rawMax === -Infinity ? 1 : rawMax,\n );\n return { min, max, range: max - min || 1, ticks };\n}\n\nfunction scales(length: number, w: number, h: number, min: number, range: number) {\n const innerW = w - PAD * 2;\n const innerH = h - PAD * 2;\n const sx = (i: number) => (length <= 1 ? PAD + innerW / 2 : PAD + (i / (length - 1)) * innerW);\n const sy = (v: number) => PAD + innerH - ((v - min) / range) * innerH;\n return { sx, sy };\n}\n\n/** Catmull-Rom → cubic bézier: a smooth curve through every point. */\nfunction smoothPath(pts: [number, number][]): string {\n if (pts.length === 0) return '';\n if (pts.length < 3) return pts.map((p, i) => `${i ? 'L' : 'M'}${p[0]},${p[1]}`).join(' ');\n let d = `M${pts[0][0]},${pts[0][1]}`;\n for (let i = 0; i < pts.length - 1; i++) {\n const p0 = pts[i - 1] ?? pts[i];\n const p1 = pts[i];\n const p2 = pts[i + 1];\n const p3 = pts[i + 2] ?? p2;\n const c1x = p1[0] + (p2[0] - p0[0]) / 6;\n const c1y = p1[1] + (p2[1] - p0[1]) / 6;\n const c2x = p2[0] - (p3[0] - p1[0]) / 6;\n const c2y = p2[1] - (p3[1] - p1[1]) / 6;\n d += ` C${c1x.toFixed(1)},${c1y.toFixed(1)} ${c2x.toFixed(1)},${c2y.toFixed(1)} ${p2[0].toFixed(1)},${p2[1].toFixed(1)}`;\n }\n return d;\n}\n\n/** Split at `null` gaps → one smooth sub-path per run of real values. */\nfunction segments(\n data: ChartPoint[],\n sx: (i: number) => number,\n sy: (v: number) => number,\n): [number, number][][] {\n const out: [number, number][][] = [];\n let run: [number, number][] = [];\n data.forEach((d, i) => {\n if (isNum(d.y)) run.push([sx(i), sy(d.y)]);\n else if (run.length) {\n out.push(run);\n run = [];\n }\n });\n if (run.length) out.push(run);\n return out;\n}\n\nconst seriesName = (s: ChartSeries, i: number, t: UiStrings['chart']) =>\n s.name ?? formatString(t.series, { n: i + 1 });\n\n/** Plain-language summary for the `<desc>` element. */\nfunction describe(all: ChartSeries[], t: UiStrings['chart'], labels: ChartLabels): string {\n return all\n .map((s, i) => {\n const ys = s.data.map((d) => d.y).filter(isNum);\n const name = seriesName(s, i, t);\n if (!ys.length) return `${name}: ${t.noData}`;\n const last = [...s.data].reverse().find((d) => isNum(d.y));\n return labels.summary({\n name,\n count: ys.length,\n min: Math.min(...ys),\n max: Math.max(...ys),\n lastX: last?.x,\n lastY: last?.y ?? undefined,\n });\n })\n .join('. ');\n}\n\nfunction Grid({ width, height, lines }: { width: number; height: number; lines: number }) {\n const innerH = height - PAD * 2;\n const n = Math.max(1, lines);\n return (\n <g aria-hidden>\n {Array.from({ length: n + 1 }, (_, i) => {\n const y = PAD + (i / n) * innerH;\n return (\n <line\n key={i}\n x1={0}\n x2={width}\n y1={y}\n y2={y}\n stroke=\"var(--color-border)\"\n strokeWidth={1}\n opacity={0.6}\n />\n );\n })}\n </g>\n );\n}\n\n/** Axis labels are HTML so they follow the document font and wrap normally. */\nfunction YAxis({ ticks }: { ticks: number[] }) {\n return (\n <div\n aria-hidden\n className=\"tabular text-foreground-subtle pointer-events-none flex shrink-0 flex-col justify-between py-1.5 pr-1.5 text-right text-xs\"\n >\n {ticks.map((t, i) => (\n <span key={i} className=\"leading-none\">\n {abbreviateNumber(t)}\n </span>\n ))}\n </div>\n );\n}\n\nfunction XAxis({ first, last }: { first?: ChartPoint; last?: ChartPoint }) {\n if (!first) return null;\n return (\n <div aria-hidden className=\"text-foreground-subtle flex justify-between text-xs\">\n <span>{String(first.x)}</span>\n {last && last !== first && <span>{String(last.x)}</span>}\n </div>\n );\n}\n\nfunction DataTable({\n id,\n all,\n name,\n visible,\n t,\n}: {\n id: string;\n all: ChartSeries[];\n name?: string;\n visible: boolean;\n t: UiStrings['chart'];\n}) {\n const longest = Math.max(...all.map((s) => s.data.length));\n const xs = all.find((s) => s.data.length === longest)?.data ?? [];\n // A <table> ignores `sr-only`'s 1px width (min-content wins) and can widen\n // the document on narrow viewports — hide it inside a wrapper instead.\n const table = (\n <table\n id={id}\n data-chart-table\n className={cn(visible && 'tabular text-foreground-muted mt-2 w-full text-left text-xs')}\n >\n <caption className={cn(visible && 'text-foreground-subtle pb-1 text-left')}>\n {formatString(t.tableCaption, { name: name ?? '' }).trim()}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\" className={cn(visible && 'border-border border-b py-1 pr-3 font-medium')}>\n x\n </th>\n {all.map((s, i) => (\n <th\n key={i}\n scope=\"col\"\n className={cn(visible && 'border-border border-b py-1 pr-3 font-medium')}\n >\n {seriesName(s, i, t)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {xs.map((p, i) => (\n <tr key={i}>\n <th scope=\"row\" className={cn(visible && 'py-0.5 pr-3 font-normal')}>\n {String(p.x)}\n </th>\n {all.map((s, si) => (\n <td key={si} className={cn(visible && 'py-0.5 pr-3')}>\n {isNum(s.data[i]?.y) ? String(s.data[i]?.y) : '—'}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n return visible ? table : <div className=\"sr-only\">{table}</div>;\n}\n\nfunction Frame({\n caption,\n ariaLabel,\n title,\n all,\n height,\n width,\n className,\n showAxis,\n ticks,\n xFirst,\n xLast,\n tableFallback,\n showTableToggle,\n state,\n labels,\n children,\n}: {\n caption?: ReactNode;\n ariaLabel?: string;\n title?: string;\n all: ChartSeries[];\n height: number;\n width: number | string;\n className?: string;\n showAxis: boolean;\n ticks: number[];\n xFirst?: ChartPoint;\n xLast?: ChartPoint;\n tableFallback: boolean;\n showTableToggle?: boolean;\n state?: ChartState;\n labels: ChartLabels;\n children: (ctx: FrameContext) => ReactNode;\n}) {\n const t = useStrings().chart;\n const id = useId().replace(/:/g, '');\n const captionId = `chart-cap-${id}`;\n const titleId = `chart-title-${id}`;\n const descId = `chart-desc-${id}`;\n const tableId = `chart-table-${id}`;\n const name = ariaLabel ?? title;\n const [tableOpen, setTableOpen] = useState(false);\n const { ref: plotRef, width: plotW } = useMeasuredWidth<HTMLDivElement>();\n const roving = useRovingPoints(all, t, labels);\n\n if (process.env.NODE_ENV !== 'production' && !name && !caption) {\n console.warn(\n '[craftzbay/ui] Chart: provide `caption`, `aria-label`, or `title` so the chart has an accessible name.',\n );\n }\n\n const tableRendered = (tableFallback || tableOpen) && !state;\n\n const stateNode =\n state === 'loading' ? (\n <div role=\"status\" aria-label={t.loading} style={{ height }} className=\"w-full\">\n <Skeleton style={{ height }} className=\"w-full\" />\n <span className=\"sr-only\">{t.loading}</span>\n </div>\n ) : state ? (\n <div\n role={state === 'error' ? 'alert' : 'status'}\n style={{ height }}\n className=\"text-foreground-subtle flex w-full items-center justify-center text-sm\"\n >\n {state === 'error' ? t.error : t.empty}\n </div>\n ) : null;\n\n return (\n <figure className={cn('flex flex-col gap-1.5', className)} style={{ width }}>\n {caption && (\n <figcaption id={captionId} className=\"text-foreground-muted text-xs\">\n {caption}\n </figcaption>\n )}\n {stateNode ?? (\n <>\n <div className=\"flex\">\n {showAxis && <YAxis ticks={ticks} />}\n {/* The plot area is measured; the SVG is drawn 1:1 in px inside it. */}\n <div ref={plotRef} className=\"min-w-0 flex-1\">\n {/* role=group (not img): series inside are focusable and carry their own labels. */}\n <svg\n viewBox={`0 0 ${plotW} ${height}`}\n width={plotW}\n height={height}\n role=\"group\"\n aria-labelledby={caption ? captionId : name ? titleId : undefined}\n aria-describedby={descId}\n className=\"block max-w-full overflow-visible\"\n >\n {name && <title id={titleId}>{name}</title>}\n <desc id={descId}>{describe(all, t, labels)}</desc>\n {children({ width: plotW, ...roving })}\n </svg>\n </div>\n </div>\n {showAxis && <XAxis first={xFirst} last={xLast} />}\n <span className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {roving.announcement}\n </span>\n </>\n )}\n {showTableToggle && !state && (\n <button\n type=\"button\"\n onClick={() => setTableOpen((v) => !v)}\n aria-expanded={tableOpen}\n aria-controls={tableRendered ? tableId : undefined}\n className={cn(\n 'text-foreground-subtle hover:text-foreground self-start rounded-sm text-xs underline-offset-2 outline-none hover:underline',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n )}\n >\n {tableOpen ? t.hideTable : t.viewAsTable}\n </button>\n )}\n {tableRendered && (\n <DataTable\n id={tableId}\n all={all}\n name={name ?? (typeof caption === 'string' ? caption : undefined)}\n visible={tableOpen}\n t={t}\n />\n )}\n </figure>\n );\n}\n\ninterface FrameContext {\n width: number;\n active: { series: number; index: number } | null;\n seriesProps: (si: number) => {\n tabIndex: number;\n role: 'group';\n 'aria-label': string;\n 'data-chart-series': true;\n onKeyDown: (e: KeyboardEvent<SVGGElement>) => void;\n onFocus: () => void;\n onBlur: () => void;\n className: string;\n };\n}\n\n/**\n * Roving focus: each series is a single tab stop; ←/→/Home/End move the\n * active point and the live region announces it. Per-point tab stops would\n * make a 200-point chart a 200-tab ordeal.\n */\nfunction useRovingPoints(all: ChartSeries[], t: UiStrings['chart'], labels: ChartLabels) {\n const [active, setActive] = useState<{ series: number; index: number } | null>(null);\n const [announcement, setAnnouncement] = useState('');\n\n const announce = useCallback(\n (si: number, idx: number) => {\n const s = all[si];\n const d = s?.data[idx];\n if (!d || !isNum(d.y)) return;\n setActive({ series: si, index: idx });\n setAnnouncement(labels.point(s.name, d.x, d.y));\n },\n [all, labels],\n );\n\n const validIndices = (si: number) =>\n all[si].data.map((d, i) => (isNum(d.y) ? i : -1)).filter((i) => i >= 0);\n\n const seriesProps = (si: number) => ({\n tabIndex: 0,\n role: 'group' as const,\n 'aria-label': labels.series(seriesName(all[si], si, t), validIndices(si).length),\n // Focus ring comes from theme.css `[data-chart-series]:focus-visible`\n // (CSS outline — Tailwind's box-shadow ring does not paint on SVG <g>).\n 'data-chart-series': true as const,\n className: cn(\n '[&:focus-visible_[data-active]]:stroke-[var(--ring)] [&:focus-visible_[data-active]]:stroke-[3px]',\n ),\n onFocus: () => {\n const idxs = validIndices(si);\n if (idxs.length) announce(si, active?.series === si ? active.index : idxs[idxs.length - 1]);\n },\n onBlur: () => {\n setActive(null);\n setAnnouncement('');\n },\n onKeyDown: (e: KeyboardEvent<SVGGElement>) => {\n const idxs = validIndices(si);\n if (!idxs.length) return;\n const pos = active?.series === si ? idxs.indexOf(active.index) : idxs.length - 1;\n let next = pos;\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') next = Math.min(idxs.length - 1, pos + 1);\n else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') next = Math.max(0, pos - 1);\n else if (e.key === 'Home') next = 0;\n else if (e.key === 'End') next = idxs.length - 1;\n else return;\n e.preventDefault();\n announce(si, idxs[next]);\n },\n });\n\n return { active, announcement, seriesProps };\n}\n\n/** Labelled data point. Invisible until hovered / active unless `always`. */\nfunction Point({\n x,\n y,\n color,\n label,\n always,\n active,\n}: {\n x: number;\n y: number;\n color: string;\n label: string;\n always?: boolean;\n active?: boolean;\n}) {\n return (\n <circle\n cx={x}\n cy={y}\n r={3.5}\n fill={color}\n data-active={active || undefined}\n className={cn(!always && !active && 'opacity-0 hover:opacity-100')}\n >\n <title>{label}</title>\n </circle>\n );\n}\n\nexport function LineChart({\n data,\n series,\n colors = DEFAULT_CHART_COLORS,\n height = 160,\n width = '100%',\n caption,\n 'aria-label': ariaLabel,\n title,\n grid = true,\n showAxis = true,\n tableFallback = true,\n showTableToggle,\n state,\n labels: labelsProp,\n className,\n}: ChartProps) {\n const t = useStrings().chart;\n const labels = { ...chartLabelsFromStrings(t), ...labelsProp };\n const all = resolveSeries(data, series);\n const { min, range, ticks } = domain(all);\n const longest = Math.max(...all.map((s) => s.data.length));\n const primary = all[0].data;\n\n return (\n <Frame\n caption={caption}\n ariaLabel={ariaLabel}\n title={title}\n all={all}\n height={height}\n width={width}\n className={className}\n showAxis={showAxis}\n ticks={ticks}\n xFirst={primary[0]}\n xLast={primary[primary.length - 1]}\n tableFallback={tableFallback}\n showTableToggle={showTableToggle}\n state={state}\n labels={labels}\n >\n {({ width: w, active, seriesProps }) => (\n <>\n {grid && <Grid width={w} height={height} lines={ticks.length - 1} />}\n {all.map((s, si) => {\n const color = colors[si % colors.length];\n const { sx, sy } = scales(longest, w, height, min, range);\n const segs = segments(s.data, sx, sy);\n const line = segs.map(smoothPath).join(' ');\n const baseline = sy(Math.max(min, 0));\n const area = segs\n .map(\n (pts) =>\n `${smoothPath(pts)} L${pts[pts.length - 1][0].toFixed(1)},${baseline.toFixed(1)} L${pts[0][0].toFixed(1)},${baseline.toFixed(1)} Z`,\n )\n .join(' ');\n const lastIdx = s.data.map((d) => isNum(d.y)).lastIndexOf(true);\n return (\n <g key={si} {...seriesProps(si)}>\n {area && <path d={area} fill={color} fillOpacity={0.08} />}\n <path\n d={line}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n {s.data.map((d, i) =>\n isNum(d.y) ? (\n <Point\n key={i}\n x={sx(i)}\n y={sy(d.y)}\n color={color}\n always={i === lastIdx}\n active={active?.series === si && active.index === i}\n label={labels.point(s.name, d.x, d.y)}\n />\n ) : null,\n )}\n </g>\n );\n })}\n </>\n )}\n </Frame>\n );\n}\n\nexport function AreaChart(props: ChartProps) {\n // The line chart already renders a flat low-opacity area; alias for intent / naming.\n return <LineChart {...props} />;\n}\n\nexport function BarChart({\n data,\n series,\n colors = DEFAULT_CHART_COLORS,\n height = 160,\n width = '100%',\n caption,\n 'aria-label': ariaLabel,\n title,\n grid = true,\n showAxis = true,\n tableFallback = true,\n showTableToggle,\n state,\n labels: labelsProp,\n className,\n}: ChartProps) {\n const t = useStrings().chart;\n const labels = { ...chartLabelsFromStrings(t), ...labelsProp };\n const all = resolveSeries(data, series);\n const longest = Math.max(...all.map((s) => s.data.length));\n const { min, range, ticks } = domain(all);\n const primary = all[0].data;\n\n return (\n <Frame\n caption={caption}\n ariaLabel={ariaLabel}\n title={title}\n all={all}\n height={height}\n width={width}\n className={className}\n showAxis={showAxis}\n ticks={ticks}\n xFirst={primary[0]}\n xLast={primary[primary.length - 1]}\n tableFallback={tableFallback}\n showTableToggle={showTableToggle}\n state={state}\n labels={labels}\n >\n {({ width: w, active, seriesProps }) => {\n const innerW = w - PAD * 2;\n const slot = innerW / Math.max(1, longest);\n const groupW = slot * 0.62;\n const barW = Math.max(2, groupW / all.length);\n const { sy } = scales(longest, w, height, min, range);\n // Bars grow from the zero line, so negatives hang below it.\n const zeroY = sy(Math.min(Math.max(0, min), min + range));\n return (\n <>\n {grid && <Grid width={w} height={height} lines={ticks.length - 1} />}\n {min < 0 && (\n <line\n aria-hidden\n x1={0}\n x2={w}\n y1={zeroY}\n y2={zeroY}\n stroke=\"var(--color-border-strong)\"\n strokeWidth={1}\n />\n )}\n {all.map((s, si) => (\n <g key={si} {...seriesProps(si)}>\n {s.data.map((d, i) => {\n if (!isNum(d.y)) return null;\n const yv = sy(d.y);\n const x = PAD + i * slot + (slot - groupW) / 2 + si * barW;\n const label = labels.point(s.name, d.x, d.y);\n const isActive = active?.series === si && active.index === i;\n return (\n <rect\n key={i}\n x={x}\n y={Math.min(zeroY, yv)}\n width={barW}\n height={Math.abs(zeroY - yv)}\n fill={colors[si % colors.length]}\n rx={2}\n data-active={isActive || undefined}\n className=\"transition-opacity hover:opacity-80\"\n >\n <title>{label}</title>\n </rect>\n );\n })}\n </g>\n ))}\n </>\n );\n }}\n </Frame>\n );\n}\n"],"mappings":";;;;;;;;AA0DA,IAAa,IAAkC;CAC7C,UAAU,EAAE,SAAM,UAAO,QAAK,QAAK,UAAO,eACxC,GAAG,EAAK,IAAI,EAAM,eAAe,EAAI,QAAQ,EAAI,SAAS,EAAM,IAAI;CACtE,QAAQ,GAAM,GAAG,MAAM,GAAG,IAAO,GAAG,EAAK,OAAO,KAAK,EAAE,IAAI;CAC3D,SAAS,GAAM,MAAU,GAAG,EAAK,IAAI,EAAM;AAC7C;AAEA,SAAS,EAAuB,GAAoC;CAClE,OAAO;EACL,UAAU,EAAE,SAAM,UAAO,QAAK,QAAK,UAAO,eACxC,EAAa,EAAE,SAAS;GAAE;GAAM;GAAO;GAAK;GAAK,GAAG;GAAO,GAAG;EAAM,CAAC;EACvE,QAAQ,GAAM,GAAG,OAAO,IAAO,GAAG,EAAK,OAAO,MAAM,EAAa,EAAE,OAAO;GAAE;GAAG;EAAE,CAAC;EAClF,SAAS,GAAM,MAAU,EAAa,EAAE,WAAW;GAAE;GAAM;EAAM,CAAC;CACpE;AACF;AAqCA,IAAa,IAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;AACF,GAGM,IAAa,KACb,IAAM,GAGN,IAA4B,OAAO,SAAW,MAAc,IAAY;AAG9E,SAAS,IAA0C;CACjD,IAAM,IAAM,EAAU,IAAI,GACpB,CAAC,GAAO,KAAY,EAAS,CAAC;CAWpC,OAVA,QAAgC;EAC9B,IAAM,IAAK,EAAI;EACf,IAAI,CAAC,GAAI;EACT,IAAM,UAAe,EAAS,EAAG,WAAW;EAE5C,IADA,EAAO,GACH,OAAO,iBAAmB,KAAa;EAC3C,IAAM,IAAK,IAAI,eAAe,CAAM;EAEpC,OADA,EAAG,QAAQ,CAAE,SACA,EAAG,WAAW;CAC7B,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A,GAvBK,CAuBL,CACJ;GACD,EAAA,CAAA;EAEN;CACK,CAAA;AAEX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":[],"sources":["../../../src/components/ui/Icon.tsx"],"sourcesContent":["'use client';\n\nimport { lazy, Suspense, useMemo, type LazyExoticComponent, type ReactNode } from 'react';\nimport dynamicIconImports from 'lucide-react/dynamicIconImports';\nimport type { LucideIcon, LucideProps } from 'lucide-react';\n\n/** Every lucide icon name, kebab-case — e.g. `calendar`, `chevrons-up-down`. */\nexport type IconName = keyof typeof dynamicIconImports;\n\n/** All available icon names (useful for pickers and docs). */\nexport const iconNames = Object.keys(dynamicIconImports) as IconName[];\n\n// lazy() must return a stable component per name or React remounts (and\n// re-suspends) on every render.\nconst cache = new Map<IconName, LazyExoticComponent<LucideIcon>>();\nconst warned = new Set<string>();\n\nfunction getIcon(name: IconName): LazyExoticComponent<LucideIcon> | null {\n const cached = cache.get(name);\n if (cached) return cached;\n const loader = dynamicIconImports[name];\n if (typeof loader !== 'function') {\n // Unknown name (data-driven input) → render nothing, warn once in dev.\n if (process.env.NODE_ENV !== 'production' && !warned.has(name)) {\n warned.add(name);\n console.warn(\n `[@craftzbay/ui] <Icon name=\"${name}\"> is not a lucide icon; rendering nothing.`,\n );\n }\n return null;\n }\n const created = lazy(loader);\n cache.set(name, created);\n return created;\n}\n\nexport interface IconProps extends Omit<LucideProps, 'ref'> {\n /** Lucide icon name in kebab-case, e.g. `name=\"calendar\"`. Autocompletes. */\n name: IconName;\n /**\n * Shown while the icon chunk loads (first use only — icons are cached).\n * Defaults to an invisible square so layout doesn't shift.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Name-addressed lucide icon. Use when the icon is dynamic (data-driven\n * nav items, user-configurable dashboards) or when importing components for\n * every icon is friction.\n *\n * Each icon is code-split and loaded on first use, so referencing the full\n * lucide set costs nothing up front — `<Icon name=\"rocket\" />` ships only\n * the rocket.\n *\n * @example\n * <Icon name=\"calendar\" className=\"size-4\" />\n * <Icon name=\"chevrons-up-down\" size={16} strokeWidth={1.5} />\n *\n * @do Use `size-4` (16px) inline with text, `size-5` (20px) inside buttons.\n * @dont Reach for this in hot lists with hundreds of distinct icons on first\n * paint — statically imported icons from `Icons` skip the lazy hop.\n */\nexport function Icon({ name, fallback, ...props }: IconProps) {\n const LucideIcon = useMemo(() => getIcon(name), [name]);\n\n const placeholder = fallback ?? (\n <span\n aria-hidden\n className={props.className}\n style={{ display: 'inline-block', width: props.size ?? '1em', height: props.size ?? '1em' }}\n />\n );\n\n if (!LucideIcon) return null;\n\n return (\n <Suspense fallback={placeholder}>\n <LucideIcon {...props} />\n </Suspense>\n );\n}\n"],"mappings":";;;;;AAUA,IAAa,IAAY,OAAO,KAAK,CAAkB,GAIjD,oBAAQ,IAAI,IAA+C,GAC3D,oBAAS,IAAI,IAAY;AAE/B,SAAS,EAAQ,GAAwD;CACvE,IAAM,IAAS,EAAM,IAAI,CAAI;CAC7B,IAAI,GAAQ,OAAO;CACnB,IAAM,IAAS,EAAmB;CAClC,IAAI,OAAO,KAAW,YAQpB,OANA,QAAA,IAAA,aAA6B,gBAAgB,CAAC,EAAO,IAAI,CAAI,MAC3D,EAAO,IAAI,CAAI,GACf,QAAQ,KACN,+BAA+B,EAAK,4CACtC,IAEK;CAET,IAAM,IAAU,EAAK,CAAM;CAE3B,OADA,EAAM,IAAI,GAAM,CAAO,GAChB;AACT;AA6BA,SAAgB,EAAK,EAAE,SAAM,aAAU,GAAG,KAAoB;CAC5D,IAAM,IAAa,QAAc,EAAQ,CAAI,GAAG,CAAC,CAAI,CAAC,GAEhD,IAAc,KAClB,kBAAC,QAAD;EACE,eAAA;EACA,WAAW,EAAM;EACjB,OAAO;GAAE,SAAS;GAAgB,OAAO,EAAM,QAAQ;GAAO,QAAQ,EAAM,QAAQ;EAAM;CAC3F,CAAA;CAKH,OAFK,IAGH,kBAAC,GAAD;EAAU,UAAU;
|
|
1
|
+
{"version":3,"file":"Icon.js","names":[],"sources":["../../../src/components/ui/Icon.tsx"],"sourcesContent":["'use client';\n\nimport { lazy, Suspense, useMemo, type LazyExoticComponent, type ReactNode } from 'react';\nimport dynamicIconImports from 'lucide-react/dynamicIconImports';\nimport type { LucideIcon, LucideProps } from 'lucide-react';\n\n/** Every lucide icon name, kebab-case — e.g. `calendar`, `chevrons-up-down`. */\nexport type IconName = keyof typeof dynamicIconImports;\n\n/** All available icon names (useful for pickers and docs). */\nexport const iconNames = Object.keys(dynamicIconImports) as IconName[];\n\n// lazy() must return a stable component per name or React remounts (and\n// re-suspends) on every render.\nconst cache = new Map<IconName, LazyExoticComponent<LucideIcon>>();\nconst warned = new Set<string>();\n\nfunction getIcon(name: IconName): LazyExoticComponent<LucideIcon> | null {\n const cached = cache.get(name);\n if (cached) return cached;\n const loader = dynamicIconImports[name];\n if (typeof loader !== 'function') {\n // Unknown name (data-driven input) → render nothing, warn once in dev.\n if (process.env.NODE_ENV !== 'production' && !warned.has(name)) {\n warned.add(name);\n console.warn(\n `[@craftzbay/ui] <Icon name=\"${name}\"> is not a lucide icon; rendering nothing.`,\n );\n }\n return null;\n }\n const created = lazy(loader);\n cache.set(name, created);\n return created;\n}\n\nexport interface IconProps extends Omit<LucideProps, 'ref'> {\n /** Lucide icon name in kebab-case, e.g. `name=\"calendar\"`. Autocompletes. */\n name: IconName;\n /**\n * Shown while the icon chunk loads (first use only — icons are cached).\n * Defaults to an invisible square so layout doesn't shift.\n */\n fallback?: ReactNode;\n}\n\n/**\n * Name-addressed lucide icon. Use when the icon is dynamic (data-driven\n * nav items, user-configurable dashboards) or when importing components for\n * every icon is friction.\n *\n * Each icon is code-split and loaded on first use, so referencing the full\n * lucide set costs nothing up front — `<Icon name=\"rocket\" />` ships only\n * the rocket.\n *\n * @example\n * <Icon name=\"calendar\" className=\"size-4\" />\n * <Icon name=\"chevrons-up-down\" size={16} strokeWidth={1.5} />\n *\n * @do Use `size-4` (16px) inline with text, `size-5` (20px) inside buttons.\n * @dont Reach for this in hot lists with hundreds of distinct icons on first\n * paint — statically imported icons from `Icons` skip the lazy hop.\n */\nexport function Icon({ name, fallback, ...props }: IconProps) {\n const LucideIcon = useMemo(() => getIcon(name), [name]);\n\n const placeholder = fallback ?? (\n <span\n aria-hidden\n className={props.className}\n style={{ display: 'inline-block', width: props.size ?? '1em', height: props.size ?? '1em' }}\n />\n );\n\n if (!LucideIcon) return null;\n\n return (\n <Suspense fallback={placeholder}>\n {/* `getIcon` returns the same lazy component for a name (module cache),\n so its identity is stable across renders. */}\n {/* eslint-disable-next-line react-hooks/static-components */}\n <LucideIcon {...props} />\n </Suspense>\n );\n}\n"],"mappings":";;;;;AAUA,IAAa,IAAY,OAAO,KAAK,CAAkB,GAIjD,oBAAQ,IAAI,IAA+C,GAC3D,oBAAS,IAAI,IAAY;AAE/B,SAAS,EAAQ,GAAwD;CACvE,IAAM,IAAS,EAAM,IAAI,CAAI;CAC7B,IAAI,GAAQ,OAAO;CACnB,IAAM,IAAS,EAAmB;CAClC,IAAI,OAAO,KAAW,YAQpB,OANA,QAAA,IAAA,aAA6B,gBAAgB,CAAC,EAAO,IAAI,CAAI,MAC3D,EAAO,IAAI,CAAI,GACf,QAAQ,KACN,+BAA+B,EAAK,4CACtC,IAEK;CAET,IAAM,IAAU,EAAK,CAAM;CAE3B,OADA,EAAM,IAAI,GAAM,CAAO,GAChB;AACT;AA6BA,SAAgB,EAAK,EAAE,SAAM,aAAU,GAAG,KAAoB;CAC5D,IAAM,IAAa,QAAc,EAAQ,CAAI,GAAG,CAAC,CAAI,CAAC,GAEhD,IAAc,KAClB,kBAAC,QAAD;EACE,eAAA;EACA,WAAW,EAAM;EACjB,OAAO;GAAE,SAAS;GAAgB,OAAO,EAAM,QAAQ;GAAO,QAAQ,EAAM,QAAQ;EAAM;CAC3F,CAAA;CAKH,OAFK,IAGH,kBAAC,GAAD;EAAU,UAAU;EAIlB,UAAA,kBAAC,GAAD,EAAY,GAAI,EAAQ,CAAA;CAChB,CAAA,IARY;AAU1B"}
|
|
@@ -4,13 +4,10 @@ import { useCallback as e, useEffect as t, useRef as n, useState as r } from "re
|
|
|
4
4
|
function i(e, n = 300) {
|
|
5
5
|
let [i, a] = r(e);
|
|
6
6
|
return t(() => {
|
|
7
|
-
if (n <= 0)
|
|
8
|
-
a(e);
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
7
|
+
if (n <= 0) return;
|
|
11
8
|
let t = window.setTimeout(() => a(e), n);
|
|
12
9
|
return () => window.clearTimeout(t);
|
|
13
|
-
}, [e, n]), i;
|
|
10
|
+
}, [e, n]), n <= 0 ? e : i;
|
|
14
11
|
}
|
|
15
12
|
function a(r, i = 300) {
|
|
16
13
|
let a = n(r), o = n(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-debounce.js","names":[],"sources":["../../src/hooks/use-debounce.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\n/**\n * Returns `value` after it has stopped changing for `delay` ms. Use for\n * search inputs that drive a query (URL or fetch) without firing per keystroke.\n *\n * @example\n * const [q, setQ] = useState('');\n * const debouncedQ = useDebounce(q); // 300ms\n * useEffect(() => { fetchRows(debouncedQ); }, [debouncedQ]);\n */\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n if (delay <= 0)
|
|
1
|
+
{"version":3,"file":"use-debounce.js","names":[],"sources":["../../src/hooks/use-debounce.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\n/**\n * Returns `value` after it has stopped changing for `delay` ms. Use for\n * search inputs that drive a query (URL or fetch) without firing per keystroke.\n *\n * @example\n * const [q, setQ] = useState('');\n * const debouncedQ = useDebounce(q); // 300ms\n * useEffect(() => { fetchRows(debouncedQ); }, [debouncedQ]);\n */\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n if (delay <= 0) return;\n const t = window.setTimeout(() => setDebounced(value), delay);\n return () => window.clearTimeout(t);\n }, [value, delay]);\n // With no delay the value is the debounced value — derive it instead of\n // writing state from the effect.\n return delay <= 0 ? value : debounced;\n}\n\n/**\n * Stable callback that runs `fn` once `delay` ms have passed since the last\n * call. Always invokes the latest `fn`; pending calls are dropped on unmount.\n *\n * @example\n * const save = useDebouncedCallback((draft: string) => api.save(draft), 500);\n * <Textarea onChange={(e) => save(e.target.value)} />\n */\nexport function useDebouncedCallback<A extends unknown[]>(\n fn: (...args: A) => void,\n delay = 300,\n): (...args: A) => void {\n const fnRef = useRef(fn);\n const timer = useRef<number | null>(null);\n useEffect(() => {\n fnRef.current = fn;\n }, [fn]);\n useEffect(\n () => () => {\n if (timer.current !== null) window.clearTimeout(timer.current);\n },\n [],\n );\n return useCallback(\n (...args: A) => {\n if (timer.current !== null) window.clearTimeout(timer.current);\n timer.current = window.setTimeout(() => {\n timer.current = null;\n fnRef.current(...args);\n }, delay);\n },\n [delay],\n );\n}\n"],"mappings":";;;AAaA,SAAgB,EAAe,GAAU,IAAQ,KAAQ;CACvD,IAAM,CAAC,GAAW,KAAgB,EAAS,CAAK;CAQhD,OAPA,QAAgB;EACd,IAAI,KAAS,GAAG;EAChB,IAAM,IAAI,OAAO,iBAAiB,EAAa,CAAK,GAAG,CAAK;EAC5D,aAAa,OAAO,aAAa,CAAC;CACpC,GAAG,CAAC,GAAO,CAAK,CAAC,GAGV,KAAS,IAAI,IAAQ;AAC9B;AAUA,SAAgB,EACd,GACA,IAAQ,KACc;CACtB,IAAM,IAAQ,EAAO,CAAE,GACjB,IAAQ,EAAsB,IAAI;CAUxC,OATA,QAAgB;EACd,EAAM,UAAU;CAClB,GAAG,CAAC,CAAE,CAAC,GACP,cACc;EACV,AAAI,EAAM,YAAY,QAAM,OAAO,aAAa,EAAM,OAAO;CAC/D,GACA,CAAC,CACH,GACO,GACJ,GAAG,MAAY;EAEd,AADI,EAAM,YAAY,QAAM,OAAO,aAAa,EAAM,OAAO,GAC7D,EAAM,UAAU,OAAO,iBAAiB;GAEtC,AADA,EAAM,UAAU,MAChB,EAAM,QAAQ,GAAG,CAAI;EACvB,GAAG,CAAK;CACV,GACA,CAAC,CAAK,CACR;AACF"}
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
3
3
|
//#region src/hooks/use-delayed-loading.ts
|
|
4
4
|
function r(r, { minVisible: i = 500 } = {}) {
|
|
5
|
-
let [a, o] = n(r <= 0), s = t(
|
|
5
|
+
let [a, o] = n(r <= 0), s = t(null);
|
|
6
6
|
return e(() => {
|
|
7
7
|
let e = () => {
|
|
8
8
|
s.current = Date.now(), o(!0);
|
|
9
9
|
};
|
|
10
10
|
if (r <= 0) {
|
|
11
|
-
s.current ??= Date.now()
|
|
12
|
-
|
|
11
|
+
s.current ??= Date.now();
|
|
12
|
+
let t = window.setTimeout(e, 0);
|
|
13
|
+
return () => window.clearTimeout(t);
|
|
13
14
|
}
|
|
14
|
-
let t = s.current === null ? 0 : Math.max(0, i - (Date.now() - s.current)), n = [];
|
|
15
|
-
return
|
|
15
|
+
let t = s.current === null ? 0 : Math.max(0, i - (Date.now() - s.current)), n = [window.setTimeout(() => o(!1), t), window.setTimeout(e, t + r)];
|
|
16
|
+
return () => n.forEach((e) => window.clearTimeout(e));
|
|
16
17
|
}, [r, i]), a;
|
|
17
18
|
}
|
|
18
19
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-delayed-loading.js","names":[],"sources":["../../src/hooks/use-delayed-loading.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nexport interface DelayedLoadingOptions {\n /**\n * Once `true`, the value holds for at least this many ms even if `ms`\n * changes, so a placeholder that did appear never flickers away. Default 500.\n */\n minVisible?: number;\n}\n\n/**\n * Returns `false` until `ms` has elapsed, then `true`. Gate skeletons and\n * spinners behind it so sub-300ms loads never flash a placeholder.\n * `ms <= 0` returns `true` immediately (and synchronously on first render).\n *\n * Once shown, the value stays `true` for `minVisible` ms (default 500). Keep\n * the gated component mounted for that window on the consumer side too —\n * unmounting it early defeats the hold.\n *\n * @example\n * const showSkeleton = useDelayedLoading(300);\n * if (isLoading) return showSkeleton ? <Skeleton /> : null;\n */\nexport function useDelayedLoading(\n ms: number,\n { minVisible = 500 }: DelayedLoadingOptions = {},\n): boolean {\n const [ready, setReady] = useState(ms <= 0);\n const shownAt = useRef<number | null>(
|
|
1
|
+
{"version":3,"file":"use-delayed-loading.js","names":[],"sources":["../../src/hooks/use-delayed-loading.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef, useState } from 'react';\n\nexport interface DelayedLoadingOptions {\n /**\n * Once `true`, the value holds for at least this many ms even if `ms`\n * changes, so a placeholder that did appear never flickers away. Default 500.\n */\n minVisible?: number;\n}\n\n/**\n * Returns `false` until `ms` has elapsed, then `true`. Gate skeletons and\n * spinners behind it so sub-300ms loads never flash a placeholder.\n * `ms <= 0` returns `true` immediately (and synchronously on first render).\n *\n * Once shown, the value stays `true` for `minVisible` ms (default 500). Keep\n * the gated component mounted for that window on the consumer side too —\n * unmounting it early defeats the hold.\n *\n * @example\n * const showSkeleton = useDelayedLoading(300);\n * if (isLoading) return showSkeleton ? <Skeleton /> : null;\n */\nexport function useDelayedLoading(\n ms: number,\n { minVisible = 500 }: DelayedLoadingOptions = {},\n): boolean {\n const [ready, setReady] = useState(ms <= 0);\n const shownAt = useRef<number | null>(null);\n\n // Every transition runs from a timer (a 0 ms one when it is due now), so the\n // effect itself never writes state synchronously.\n useEffect(() => {\n const show = () => {\n shownAt.current = Date.now();\n setReady(true);\n };\n if (ms <= 0) {\n shownAt.current ??= Date.now();\n const t = window.setTimeout(show, 0);\n return () => window.clearTimeout(t);\n }\n // Respect the minimum-visible window before hiding again.\n const hold =\n shownAt.current === null ? 0 : Math.max(0, minVisible - (Date.now() - shownAt.current));\n const timers = [\n window.setTimeout(() => setReady(false), hold),\n window.setTimeout(show, hold + ms),\n ];\n return () => timers.forEach((t) => window.clearTimeout(t));\n }, [ms, minVisible]);\n\n return ready;\n}\n"],"mappings":";;;AAyBA,SAAgB,EACd,GACA,EAAE,gBAAa,QAA+B,CAAC,GACtC;CACT,IAAM,CAAC,GAAO,KAAY,EAAS,KAAM,CAAC,GACpC,IAAU,EAAsB,IAAI;CAwB1C,OApBA,QAAgB;EACd,IAAM,UAAa;GAEjB,AADA,EAAQ,UAAU,KAAK,IAAI,GAC3B,EAAS,EAAI;EACf;EACA,IAAI,KAAM,GAAG;GACX,EAAQ,YAAY,KAAK,IAAI;GAC7B,IAAM,IAAI,OAAO,WAAW,GAAM,CAAC;GACnC,aAAa,OAAO,aAAa,CAAC;EACpC;EAEA,IAAM,IACJ,EAAQ,YAAY,OAAO,IAAI,KAAK,IAAI,GAAG,KAAc,KAAK,IAAI,IAAI,EAAQ,QAAQ,GAClF,IAAS,CACb,OAAO,iBAAiB,EAAS,EAAK,GAAG,CAAI,GAC7C,OAAO,WAAW,GAAM,IAAO,CAAE,CACnC;EACA,aAAa,EAAO,SAAS,MAAM,OAAO,aAAa,CAAC,CAAC;CAC3D,GAAG,CAAC,GAAI,CAAU,CAAC,GAEZ;AACT"}
|
|
@@ -6,8 +6,4 @@ export interface ModifierKey {
|
|
|
6
6
|
/** Spoken/long form for aria-labels and tooltips: `Cmd` / `Ctrl`. */
|
|
7
7
|
label: 'Cmd' | 'Ctrl';
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Platform-correct command modifier for shortcut hints (⌘K vs Ctrl K).
|
|
11
|
-
* Defaults to Ctrl until mounted so server output is deterministic.
|
|
12
|
-
*/
|
|
13
9
|
export declare function useModifierKey(): ModifierKey;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { useSyncExternalStore as e } from "react";
|
|
3
3
|
//#region src/hooks/use-modifier-key.ts
|
|
4
|
-
function
|
|
4
|
+
function t() {
|
|
5
5
|
if (typeof navigator > "u") return !1;
|
|
6
6
|
let e = navigator, t = e.userAgentData?.platform ?? e.platform ?? "";
|
|
7
7
|
return /mac|iphone|ipad|ipod/i.test(t) || /Mac OS X/i.test(e.userAgent ?? "");
|
|
8
8
|
}
|
|
9
|
+
var n = () => () => {};
|
|
9
10
|
function r() {
|
|
10
|
-
|
|
11
|
-
return e(() => {
|
|
12
|
-
i(n());
|
|
13
|
-
}, []), r ? {
|
|
11
|
+
return e(n, t, () => !1) ? {
|
|
14
12
|
symbol: "⌘",
|
|
15
13
|
label: "Cmd"
|
|
16
14
|
} : {
|
|
@@ -19,6 +17,6 @@ function r() {
|
|
|
19
17
|
};
|
|
20
18
|
}
|
|
21
19
|
//#endregion
|
|
22
|
-
export {
|
|
20
|
+
export { t as isApplePlatform, r as useModifierKey };
|
|
23
21
|
|
|
24
22
|
//# sourceMappingURL=use-modifier-key.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-modifier-key.js","names":[],"sources":["../../src/hooks/use-modifier-key.ts"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"use-modifier-key.js","names":[],"sources":["../../src/hooks/use-modifier-key.ts"],"sourcesContent":["'use client';\n\nimport { useSyncExternalStore } from 'react';\n\n/** True on macOS / iOS / iPadOS, where the command modifier is ⌘. */\nexport function isApplePlatform(): boolean {\n if (typeof navigator === 'undefined') return false;\n const nav = navigator as Navigator & { userAgentData?: { platform?: string } };\n const platform = nav.userAgentData?.platform ?? nav.platform ?? '';\n return /mac|iphone|ipad|ipod/i.test(platform) || /Mac OS X/i.test(nav.userAgent ?? '');\n}\n\nexport interface ModifierKey {\n /** Glyph for `<Kbd>`: `⌘` on Apple platforms, `Ctrl` elsewhere. */\n symbol: '⌘' | 'Ctrl';\n /** Spoken/long form for aria-labels and tooltips: `Cmd` / `Ctrl`. */\n label: 'Cmd' | 'Ctrl';\n}\n\n/**\n * Platform-correct command modifier for shortcut hints (⌘K vs Ctrl K).\n * Defaults to Ctrl until mounted so server output is deterministic.\n */\nconst subscribe = () => () => {};\n\nexport function useModifierKey(): ModifierKey {\n // Platform never changes, so there is nothing to subscribe to; the store\n // shape just gives a `false` server snapshot and the real value after\n // hydration without a state write in an effect.\n const apple = useSyncExternalStore(subscribe, isApplePlatform, () => false);\n return apple ? { symbol: '⌘', label: 'Cmd' } : { symbol: 'Ctrl', label: 'Ctrl' };\n}\n"],"mappings":";;;AAKA,SAAgB,IAA2B;CACzC,IAAI,OAAO,YAAc,KAAa,OAAO;CAC7C,IAAM,IAAM,WACN,IAAW,EAAI,eAAe,YAAY,EAAI,YAAY;CAChE,OAAO,wBAAwB,KAAK,CAAQ,KAAK,YAAY,KAAK,EAAI,aAAa,EAAE;AACvF;AAaA,IAAM,gBAAwB,CAAC;AAE/B,SAAgB,IAA8B;CAK5C,OADc,EAAqB,GAAW,SAAuB,EAC9D,IAAQ;EAAE,QAAQ;EAAK,OAAO;CAAM,IAAI;EAAE,QAAQ;EAAQ,OAAO;CAAO;AACjF"}
|
|
@@ -38,7 +38,7 @@ export declare const FileText: LucideIcon;
|
|
|
38
38
|
export declare const Filter: LucideIcon;
|
|
39
39
|
export declare const Folder: LucideIcon;
|
|
40
40
|
export declare const FolderOpen: LucideIcon;
|
|
41
|
-
export declare const
|
|
41
|
+
export declare const Code: LucideIcon;
|
|
42
42
|
export declare const GripVertical: LucideIcon;
|
|
43
43
|
export declare const Heart: LucideIcon;
|
|
44
44
|
export declare const HelpCircle: LucideIcon;
|
package/dist-lib/icons/index.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
import { __exportAll as ee } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import te from "lucide-react/dist/esm/icons/alert-circle.
|
|
3
|
-
import ne from "lucide-react/dist/esm/icons/alert-triangle.
|
|
4
|
-
import re from "lucide-react/dist/esm/icons/arrow-down.
|
|
5
|
-
import ie from "lucide-react/dist/esm/icons/arrow-left.
|
|
6
|
-
import ae from "lucide-react/dist/esm/icons/arrow-right.
|
|
7
|
-
import oe from "lucide-react/dist/esm/icons/arrow-up.
|
|
8
|
-
import se from "lucide-react/dist/esm/icons/arrow-up-down.
|
|
9
|
-
import ce from "lucide-react/dist/esm/icons/at-sign.
|
|
10
|
-
import le from "lucide-react/dist/esm/icons/bar-chart-3.
|
|
11
|
-
import ue from "lucide-react/dist/esm/icons/bell.
|
|
12
|
-
import de from "lucide-react/dist/esm/icons/bookmark.
|
|
13
|
-
import fe from "lucide-react/dist/esm/icons/calendar.
|
|
14
|
-
import pe from "lucide-react/dist/esm/icons/chart-pie.
|
|
15
|
-
import me from "lucide-react/dist/esm/icons/check.
|
|
16
|
-
import he from "lucide-react/dist/esm/icons/handshake.
|
|
17
|
-
import ge from "lucide-react/dist/esm/icons/image.
|
|
18
|
-
import _e from "lucide-react/dist/esm/icons/check-circle-2.
|
|
19
|
-
import ve from "lucide-react/dist/esm/icons/chevron-down.
|
|
20
|
-
import ye from "lucide-react/dist/esm/icons/chevron-left.
|
|
21
|
-
import be from "lucide-react/dist/esm/icons/chevron-right.
|
|
22
|
-
import xe from "lucide-react/dist/esm/icons/chevron-up.
|
|
23
|
-
import Se from "lucide-react/dist/esm/icons/chevrons-left.
|
|
24
|
-
import Ce from "lucide-react/dist/esm/icons/chevrons-right.
|
|
25
|
-
import we from "lucide-react/dist/esm/icons/chevrons-up-down.
|
|
26
|
-
import Te from "lucide-react/dist/esm/icons/circle.
|
|
27
|
-
import Ee from "lucide-react/dist/esm/icons/copy.
|
|
28
|
-
import De from "lucide-react/dist/esm/icons/corner-down-left.
|
|
29
|
-
import Oe from "lucide-react/dist/esm/icons/credit-card.
|
|
30
|
-
import ke from "lucide-react/dist/esm/icons/download.
|
|
31
|
-
import Ae from "lucide-react/dist/esm/icons/edit-2.
|
|
32
|
-
import je from "lucide-react/dist/esm/icons/ellipsis.
|
|
33
|
-
import Me from "lucide-react/dist/esm/icons/external-link.
|
|
34
|
-
import Ne from "lucide-react/dist/esm/icons/eye.
|
|
35
|
-
import Pe from "lucide-react/dist/esm/icons/eye-off.
|
|
36
|
-
import Fe from "lucide-react/dist/esm/icons/file.
|
|
37
|
-
import Ie from "lucide-react/dist/esm/icons/file-text.
|
|
38
|
-
import Le from "lucide-react/dist/esm/icons/filter.
|
|
39
|
-
import Re from "lucide-react/dist/esm/icons/folder.
|
|
40
|
-
import ze from "lucide-react/dist/esm/icons/folder-open.
|
|
41
|
-
import Be from "lucide-react/dist/esm/icons/
|
|
42
|
-
import Ve from "lucide-react/dist/esm/icons/grip-vertical.
|
|
43
|
-
import He from "lucide-react/dist/esm/icons/heart.
|
|
44
|
-
import Ue from "lucide-react/dist/esm/icons/help-circle.
|
|
45
|
-
import We from "lucide-react/dist/esm/icons/home.
|
|
46
|
-
import Ge from "lucide-react/dist/esm/icons/inbox.
|
|
47
|
-
import Ke from "lucide-react/dist/esm/icons/info.
|
|
48
|
-
import qe from "lucide-react/dist/esm/icons/kanban.
|
|
49
|
-
import Je from "lucide-react/dist/esm/icons/key.
|
|
50
|
-
import Ye from "lucide-react/dist/esm/icons/layout-grid.
|
|
51
|
-
import Xe from "lucide-react/dist/esm/icons/link-2.
|
|
52
|
-
import Ze from "lucide-react/dist/esm/icons/loader-2.
|
|
53
|
-
import Qe from "lucide-react/dist/esm/icons/lock.
|
|
54
|
-
import $e from "lucide-react/dist/esm/icons/log-out.
|
|
55
|
-
import et from "lucide-react/dist/esm/icons/mail.
|
|
56
|
-
import tt from "lucide-react/dist/esm/icons/menu.
|
|
57
|
-
import nt from "lucide-react/dist/esm/icons/message-square.
|
|
58
|
-
import rt from "lucide-react/dist/esm/icons/minus.
|
|
59
|
-
import it from "lucide-react/dist/esm/icons/moon.
|
|
60
|
-
import at from "lucide-react/dist/esm/icons/more-horizontal.
|
|
61
|
-
import ot from "lucide-react/dist/esm/icons/package.
|
|
62
|
-
import st from "lucide-react/dist/esm/icons/pencil.
|
|
63
|
-
import ct from "lucide-react/dist/esm/icons/plug.
|
|
64
|
-
import lt from "lucide-react/dist/esm/icons/plus.
|
|
65
|
-
import ut from "lucide-react/dist/esm/icons/receipt.
|
|
66
|
-
import dt from "lucide-react/dist/esm/icons/search.
|
|
67
|
-
import ft from "lucide-react/dist/esm/icons/settings.
|
|
68
|
-
import pt from "lucide-react/dist/esm/icons/shopping-cart.
|
|
69
|
-
import mt from "lucide-react/dist/esm/icons/sparkles.
|
|
70
|
-
import ht from "lucide-react/dist/esm/icons/star.
|
|
71
|
-
import gt from "lucide-react/dist/esm/icons/sun.
|
|
72
|
-
import _t from "lucide-react/dist/esm/icons/tags.
|
|
73
|
-
import vt from "lucide-react/dist/esm/icons/trash-2.
|
|
74
|
-
import yt from "lucide-react/dist/esm/icons/upload.
|
|
75
|
-
import bt from "lucide-react/dist/esm/icons/user.
|
|
76
|
-
import xt from "lucide-react/dist/esm/icons/users.
|
|
77
|
-
import St from "lucide-react/dist/esm/icons/wallet.
|
|
78
|
-
import Ct from "lucide-react/dist/esm/icons/x.
|
|
79
|
-
import wt from "lucide-react/dist/esm/icons/x-circle.
|
|
80
|
-
import Tt from "lucide-react/dist/esm/icons/zap.
|
|
2
|
+
import te from "lucide-react/dist/esm/icons/alert-circle.mjs";
|
|
3
|
+
import ne from "lucide-react/dist/esm/icons/alert-triangle.mjs";
|
|
4
|
+
import re from "lucide-react/dist/esm/icons/arrow-down.mjs";
|
|
5
|
+
import ie from "lucide-react/dist/esm/icons/arrow-left.mjs";
|
|
6
|
+
import ae from "lucide-react/dist/esm/icons/arrow-right.mjs";
|
|
7
|
+
import oe from "lucide-react/dist/esm/icons/arrow-up.mjs";
|
|
8
|
+
import se from "lucide-react/dist/esm/icons/arrow-up-down.mjs";
|
|
9
|
+
import ce from "lucide-react/dist/esm/icons/at-sign.mjs";
|
|
10
|
+
import le from "lucide-react/dist/esm/icons/bar-chart-3.mjs";
|
|
11
|
+
import ue from "lucide-react/dist/esm/icons/bell.mjs";
|
|
12
|
+
import de from "lucide-react/dist/esm/icons/bookmark.mjs";
|
|
13
|
+
import fe from "lucide-react/dist/esm/icons/calendar.mjs";
|
|
14
|
+
import pe from "lucide-react/dist/esm/icons/chart-pie.mjs";
|
|
15
|
+
import me from "lucide-react/dist/esm/icons/check.mjs";
|
|
16
|
+
import he from "lucide-react/dist/esm/icons/handshake.mjs";
|
|
17
|
+
import ge from "lucide-react/dist/esm/icons/image.mjs";
|
|
18
|
+
import _e from "lucide-react/dist/esm/icons/check-circle-2.mjs";
|
|
19
|
+
import ve from "lucide-react/dist/esm/icons/chevron-down.mjs";
|
|
20
|
+
import ye from "lucide-react/dist/esm/icons/chevron-left.mjs";
|
|
21
|
+
import be from "lucide-react/dist/esm/icons/chevron-right.mjs";
|
|
22
|
+
import xe from "lucide-react/dist/esm/icons/chevron-up.mjs";
|
|
23
|
+
import Se from "lucide-react/dist/esm/icons/chevrons-left.mjs";
|
|
24
|
+
import Ce from "lucide-react/dist/esm/icons/chevrons-right.mjs";
|
|
25
|
+
import we from "lucide-react/dist/esm/icons/chevrons-up-down.mjs";
|
|
26
|
+
import Te from "lucide-react/dist/esm/icons/circle.mjs";
|
|
27
|
+
import Ee from "lucide-react/dist/esm/icons/copy.mjs";
|
|
28
|
+
import De from "lucide-react/dist/esm/icons/corner-down-left.mjs";
|
|
29
|
+
import Oe from "lucide-react/dist/esm/icons/credit-card.mjs";
|
|
30
|
+
import ke from "lucide-react/dist/esm/icons/download.mjs";
|
|
31
|
+
import Ae from "lucide-react/dist/esm/icons/edit-2.mjs";
|
|
32
|
+
import je from "lucide-react/dist/esm/icons/ellipsis.mjs";
|
|
33
|
+
import Me from "lucide-react/dist/esm/icons/external-link.mjs";
|
|
34
|
+
import Ne from "lucide-react/dist/esm/icons/eye.mjs";
|
|
35
|
+
import Pe from "lucide-react/dist/esm/icons/eye-off.mjs";
|
|
36
|
+
import Fe from "lucide-react/dist/esm/icons/file.mjs";
|
|
37
|
+
import Ie from "lucide-react/dist/esm/icons/file-text.mjs";
|
|
38
|
+
import Le from "lucide-react/dist/esm/icons/filter.mjs";
|
|
39
|
+
import Re from "lucide-react/dist/esm/icons/folder.mjs";
|
|
40
|
+
import ze from "lucide-react/dist/esm/icons/folder-open.mjs";
|
|
41
|
+
import Be from "lucide-react/dist/esm/icons/code.mjs";
|
|
42
|
+
import Ve from "lucide-react/dist/esm/icons/grip-vertical.mjs";
|
|
43
|
+
import He from "lucide-react/dist/esm/icons/heart.mjs";
|
|
44
|
+
import Ue from "lucide-react/dist/esm/icons/help-circle.mjs";
|
|
45
|
+
import We from "lucide-react/dist/esm/icons/home.mjs";
|
|
46
|
+
import Ge from "lucide-react/dist/esm/icons/inbox.mjs";
|
|
47
|
+
import Ke from "lucide-react/dist/esm/icons/info.mjs";
|
|
48
|
+
import qe from "lucide-react/dist/esm/icons/kanban.mjs";
|
|
49
|
+
import Je from "lucide-react/dist/esm/icons/key.mjs";
|
|
50
|
+
import Ye from "lucide-react/dist/esm/icons/layout-grid.mjs";
|
|
51
|
+
import Xe from "lucide-react/dist/esm/icons/link-2.mjs";
|
|
52
|
+
import Ze from "lucide-react/dist/esm/icons/loader-2.mjs";
|
|
53
|
+
import Qe from "lucide-react/dist/esm/icons/lock.mjs";
|
|
54
|
+
import $e from "lucide-react/dist/esm/icons/log-out.mjs";
|
|
55
|
+
import et from "lucide-react/dist/esm/icons/mail.mjs";
|
|
56
|
+
import tt from "lucide-react/dist/esm/icons/menu.mjs";
|
|
57
|
+
import nt from "lucide-react/dist/esm/icons/message-square.mjs";
|
|
58
|
+
import rt from "lucide-react/dist/esm/icons/minus.mjs";
|
|
59
|
+
import it from "lucide-react/dist/esm/icons/moon.mjs";
|
|
60
|
+
import at from "lucide-react/dist/esm/icons/more-horizontal.mjs";
|
|
61
|
+
import ot from "lucide-react/dist/esm/icons/package.mjs";
|
|
62
|
+
import st from "lucide-react/dist/esm/icons/pencil.mjs";
|
|
63
|
+
import ct from "lucide-react/dist/esm/icons/plug.mjs";
|
|
64
|
+
import lt from "lucide-react/dist/esm/icons/plus.mjs";
|
|
65
|
+
import ut from "lucide-react/dist/esm/icons/receipt.mjs";
|
|
66
|
+
import dt from "lucide-react/dist/esm/icons/search.mjs";
|
|
67
|
+
import ft from "lucide-react/dist/esm/icons/settings.mjs";
|
|
68
|
+
import pt from "lucide-react/dist/esm/icons/shopping-cart.mjs";
|
|
69
|
+
import mt from "lucide-react/dist/esm/icons/sparkles.mjs";
|
|
70
|
+
import ht from "lucide-react/dist/esm/icons/star.mjs";
|
|
71
|
+
import gt from "lucide-react/dist/esm/icons/sun.mjs";
|
|
72
|
+
import _t from "lucide-react/dist/esm/icons/tags.mjs";
|
|
73
|
+
import vt from "lucide-react/dist/esm/icons/trash-2.mjs";
|
|
74
|
+
import yt from "lucide-react/dist/esm/icons/upload.mjs";
|
|
75
|
+
import bt from "lucide-react/dist/esm/icons/user.mjs";
|
|
76
|
+
import xt from "lucide-react/dist/esm/icons/users.mjs";
|
|
77
|
+
import St from "lucide-react/dist/esm/icons/wallet.mjs";
|
|
78
|
+
import Ct from "lucide-react/dist/esm/icons/x.mjs";
|
|
79
|
+
import wt from "lucide-react/dist/esm/icons/x-circle.mjs";
|
|
80
|
+
import Tt from "lucide-react/dist/esm/icons/zap.mjs";
|
|
81
81
|
//#region src/icons/index.ts
|
|
82
82
|
var Et = /* @__PURE__ */ ee({
|
|
83
83
|
AlertCircle: () => e,
|
|
@@ -103,6 +103,7 @@ var Et = /* @__PURE__ */ ee({
|
|
|
103
103
|
ChevronsRight: () => x,
|
|
104
104
|
ChevronsUpDown: () => S,
|
|
105
105
|
Circle: () => C,
|
|
106
|
+
Code: () => R,
|
|
106
107
|
Copy: () => w,
|
|
107
108
|
CornerDownLeft: () => T,
|
|
108
109
|
CreditCard: () => E,
|
|
@@ -117,7 +118,6 @@ var Et = /* @__PURE__ */ ee({
|
|
|
117
118
|
Filter: () => F,
|
|
118
119
|
Folder: () => I,
|
|
119
120
|
FolderOpen: () => L,
|
|
120
|
-
Github: () => R,
|
|
121
121
|
GripVertical: () => z,
|
|
122
122
|
Handshake: () => p,
|
|
123
123
|
Heart: () => B,
|
|
@@ -161,6 +161,6 @@ var Et = /* @__PURE__ */ ee({
|
|
|
161
161
|
Zap: () => $
|
|
162
162
|
}), e = te, t = ne, n = re, r = ie, Dt = ae, i = oe, a = se, o = ce, s = le, c = ue, l = de, u = fe, d = pe, f = me, p = he, m = ge, h = _e, g = ve, _ = ye, v = be, y = xe, b = Se, x = Ce, S = we, C = Te, w = Ee, T = De, E = Oe, D = ke, O = Ae, k = je, A = Me, j = Ne, M = Pe, N = Fe, P = Ie, F = Le, I = Re, L = ze, R = Be, z = Ve, B = He, V = Ue, H = We, U = Ge, W = Ke, G = qe, K = Je, q = Ye, J = Xe, Y = Ze, X = Qe, Z = $e, Q = et, Ot = tt, kt = nt, At = rt, jt = it, Mt = at, Nt = ot, Pt = st, Ft = ct, It = lt, Lt = ut, Rt = dt, zt = ft, Bt = pt, Vt = mt, Ht = ht, Ut = gt, Wt = _t, Gt = vt, Kt = yt, qt = bt, Jt = xt, Yt = St, Xt = Ct, Zt = wt, $ = Tt;
|
|
163
163
|
//#endregion
|
|
164
|
-
export { e as AlertCircle, t as AlertTriangle, n as ArrowDown, r as ArrowLeft, Dt as ArrowRight, i as ArrowUp, a as ArrowUpDown, o as AtSign, s as BarChart3, c as Bell, l as Bookmark, u as Calendar, d as ChartPie, f as Check, h as CheckCircle2, g as ChevronDown, _ as ChevronLeft, v as ChevronRight, y as ChevronUp, b as ChevronsLeft, x as ChevronsRight, S as ChevronsUpDown, C as Circle, w as Copy, T as CornerDownLeft, E as CreditCard, D as Download, O as Edit2, k as Ellipsis, A as ExternalLink, j as Eye, M as EyeOff, N as File, P as FileText, F as Filter, I as Folder, L as FolderOpen,
|
|
164
|
+
export { e as AlertCircle, t as AlertTriangle, n as ArrowDown, r as ArrowLeft, Dt as ArrowRight, i as ArrowUp, a as ArrowUpDown, o as AtSign, s as BarChart3, c as Bell, l as Bookmark, u as Calendar, d as ChartPie, f as Check, h as CheckCircle2, g as ChevronDown, _ as ChevronLeft, v as ChevronRight, y as ChevronUp, b as ChevronsLeft, x as ChevronsRight, S as ChevronsUpDown, C as Circle, R as Code, w as Copy, T as CornerDownLeft, E as CreditCard, D as Download, O as Edit2, k as Ellipsis, A as ExternalLink, j as Eye, M as EyeOff, N as File, P as FileText, F as Filter, I as Folder, L as FolderOpen, z as GripVertical, p as Handshake, B as Heart, V as HelpCircle, H as Home, m as ImageIcon, U as Inbox, W as Info, G as Kanban, K as Key, q as LayoutGrid, J as Link2, Y as Loader2, X as Lock, Z as LogOut, Q as Mail, Ot as Menu, kt as MessageSquare, At as Minus, jt as Moon, Mt as MoreHorizontal, Nt as Package, Pt as Pencil, Ft as Plug, It as Plus, Lt as Receipt, Rt as Search, zt as Settings, Bt as ShoppingCart, Vt as Sparkles, Ht as Star, Ut as Sun, Wt as Tags, Gt as Trash2, Kt as Upload, qt as User, Jt as Users, Yt as Wallet, Xt as X, Zt as XCircle, $ as Zap, Et as icons_exports };
|
|
165
165
|
|
|
166
166
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/icons/index.ts"],"sourcesContent":["/**\n * Curated re-exports from lucide-react. Components should import icons from\n * here, never directly from 'lucide-react', so the design system can swap\n * icon sets later if needed and so unused icons stay tree-shakable.\n *\n * Icons are imported via their per-module paths (not the package barrel) on\n * purpose: the `@craftzbay/ui/icon` entry lazy-loads arbitrary icons through\n * lucide-react/dynamicIconImports, and if the barrel were in the static module\n * graph, Rollup would co-locate every dynamically imported icon into the\n * barrel's chunk — inlining the entire icon set instead of code-splitting it\n * (verified: the showcase vendor chunk goes 614 kB → 1.4 MB). The deep paths\n * are typed by `src/types/lucide-deep.d.ts`; each export is re-typed as\n * `LucideIcon` below so the emitted declarations only reference the package\n * root.\n *\n * Defaults applied at the call site:\n * - 16px for inline-with-text usage\n * - 20px for use inside buttons\n * - strokeWidth 1.5\n */\nimport type { LucideIcon } from 'lucide-react';\n\nimport _AlertCircle from 'lucide-react/dist/esm/icons/alert-circle.js';\nimport _AlertTriangle from 'lucide-react/dist/esm/icons/alert-triangle.js';\nimport _ArrowDown from 'lucide-react/dist/esm/icons/arrow-down.js';\nimport _ArrowLeft from 'lucide-react/dist/esm/icons/arrow-left.js';\nimport _ArrowRight from 'lucide-react/dist/esm/icons/arrow-right.js';\nimport _ArrowUp from 'lucide-react/dist/esm/icons/arrow-up.js';\nimport _ArrowUpDown from 'lucide-react/dist/esm/icons/arrow-up-down.js';\nimport _AtSign from 'lucide-react/dist/esm/icons/at-sign.js';\nimport _BarChart3 from 'lucide-react/dist/esm/icons/bar-chart-3.js';\nimport _Bell from 'lucide-react/dist/esm/icons/bell.js';\nimport _Bookmark from 'lucide-react/dist/esm/icons/bookmark.js';\nimport _Calendar from 'lucide-react/dist/esm/icons/calendar.js';\nimport _ChartPie from 'lucide-react/dist/esm/icons/chart-pie.js';\nimport _Check from 'lucide-react/dist/esm/icons/check.js';\nimport _Handshake from 'lucide-react/dist/esm/icons/handshake.js';\nimport _Image from 'lucide-react/dist/esm/icons/image.js';\nimport _CheckCircle2 from 'lucide-react/dist/esm/icons/check-circle-2.js';\nimport _ChevronDown from 'lucide-react/dist/esm/icons/chevron-down.js';\nimport _ChevronLeft from 'lucide-react/dist/esm/icons/chevron-left.js';\nimport _ChevronRight from 'lucide-react/dist/esm/icons/chevron-right.js';\nimport _ChevronUp from 'lucide-react/dist/esm/icons/chevron-up.js';\nimport _ChevronsLeft from 'lucide-react/dist/esm/icons/chevrons-left.js';\nimport _ChevronsRight from 'lucide-react/dist/esm/icons/chevrons-right.js';\nimport _ChevronsUpDown from 'lucide-react/dist/esm/icons/chevrons-up-down.js';\nimport _Circle from 'lucide-react/dist/esm/icons/circle.js';\nimport _Copy from 'lucide-react/dist/esm/icons/copy.js';\nimport _CornerDownLeft from 'lucide-react/dist/esm/icons/corner-down-left.js';\nimport _CreditCard from 'lucide-react/dist/esm/icons/credit-card.js';\nimport _Download from 'lucide-react/dist/esm/icons/download.js';\nimport _Edit2 from 'lucide-react/dist/esm/icons/edit-2.js';\nimport _Ellipsis from 'lucide-react/dist/esm/icons/ellipsis.js';\nimport _ExternalLink from 'lucide-react/dist/esm/icons/external-link.js';\nimport _Eye from 'lucide-react/dist/esm/icons/eye.js';\nimport _EyeOff from 'lucide-react/dist/esm/icons/eye-off.js';\nimport _File from 'lucide-react/dist/esm/icons/file.js';\nimport _FileText from 'lucide-react/dist/esm/icons/file-text.js';\nimport _Filter from 'lucide-react/dist/esm/icons/filter.js';\nimport _Folder from 'lucide-react/dist/esm/icons/folder.js';\nimport _FolderOpen from 'lucide-react/dist/esm/icons/folder-open.js';\nimport _Github from 'lucide-react/dist/esm/icons/github.js';\nimport _GripVertical from 'lucide-react/dist/esm/icons/grip-vertical.js';\nimport _Heart from 'lucide-react/dist/esm/icons/heart.js';\nimport _HelpCircle from 'lucide-react/dist/esm/icons/help-circle.js';\nimport _Home from 'lucide-react/dist/esm/icons/home.js';\nimport _Inbox from 'lucide-react/dist/esm/icons/inbox.js';\nimport _Info from 'lucide-react/dist/esm/icons/info.js';\nimport _Kanban from 'lucide-react/dist/esm/icons/kanban.js';\nimport _Key from 'lucide-react/dist/esm/icons/key.js';\nimport _LayoutGrid from 'lucide-react/dist/esm/icons/layout-grid.js';\nimport _Link2 from 'lucide-react/dist/esm/icons/link-2.js';\nimport _Loader2 from 'lucide-react/dist/esm/icons/loader-2.js';\nimport _Lock from 'lucide-react/dist/esm/icons/lock.js';\nimport _LogOut from 'lucide-react/dist/esm/icons/log-out.js';\nimport _Mail from 'lucide-react/dist/esm/icons/mail.js';\nimport _Menu from 'lucide-react/dist/esm/icons/menu.js';\nimport _MessageSquare from 'lucide-react/dist/esm/icons/message-square.js';\nimport _Minus from 'lucide-react/dist/esm/icons/minus.js';\nimport _Moon from 'lucide-react/dist/esm/icons/moon.js';\nimport _MoreHorizontal from 'lucide-react/dist/esm/icons/more-horizontal.js';\nimport _Package from 'lucide-react/dist/esm/icons/package.js';\nimport _Pencil from 'lucide-react/dist/esm/icons/pencil.js';\nimport _Plug from 'lucide-react/dist/esm/icons/plug.js';\nimport _Plus from 'lucide-react/dist/esm/icons/plus.js';\nimport _Receipt from 'lucide-react/dist/esm/icons/receipt.js';\nimport _Search from 'lucide-react/dist/esm/icons/search.js';\nimport _Settings from 'lucide-react/dist/esm/icons/settings.js';\nimport _ShoppingCart from 'lucide-react/dist/esm/icons/shopping-cart.js';\nimport _Sparkles from 'lucide-react/dist/esm/icons/sparkles.js';\nimport _Star from 'lucide-react/dist/esm/icons/star.js';\nimport _Sun from 'lucide-react/dist/esm/icons/sun.js';\nimport _Tags from 'lucide-react/dist/esm/icons/tags.js';\nimport _Trash2 from 'lucide-react/dist/esm/icons/trash-2.js';\nimport _Upload from 'lucide-react/dist/esm/icons/upload.js';\nimport _User from 'lucide-react/dist/esm/icons/user.js';\nimport _Users from 'lucide-react/dist/esm/icons/users.js';\nimport _Wallet from 'lucide-react/dist/esm/icons/wallet.js';\nimport _X from 'lucide-react/dist/esm/icons/x.js';\nimport _XCircle from 'lucide-react/dist/esm/icons/x-circle.js';\nimport _Zap from 'lucide-react/dist/esm/icons/zap.js';\n\nexport const AlertCircle: LucideIcon = _AlertCircle;\nexport const AlertTriangle: LucideIcon = _AlertTriangle;\nexport const ArrowDown: LucideIcon = _ArrowDown;\nexport const ArrowLeft: LucideIcon = _ArrowLeft;\nexport const ArrowRight: LucideIcon = _ArrowRight;\nexport const ArrowUp: LucideIcon = _ArrowUp;\nexport const ArrowUpDown: LucideIcon = _ArrowUpDown;\nexport const AtSign: LucideIcon = _AtSign;\nexport const BarChart3: LucideIcon = _BarChart3;\nexport const Bell: LucideIcon = _Bell;\nexport const Bookmark: LucideIcon = _Bookmark;\nexport const Calendar: LucideIcon = _Calendar;\nexport const ChartPie: LucideIcon = _ChartPie;\nexport const Check: LucideIcon = _Check;\nexport const Handshake: LucideIcon = _Handshake;\nexport const ImageIcon: LucideIcon = _Image;\nexport const CheckCircle2: LucideIcon = _CheckCircle2;\nexport const ChevronDown: LucideIcon = _ChevronDown;\nexport const ChevronLeft: LucideIcon = _ChevronLeft;\nexport const ChevronRight: LucideIcon = _ChevronRight;\nexport const ChevronUp: LucideIcon = _ChevronUp;\nexport const ChevronsLeft: LucideIcon = _ChevronsLeft;\nexport const ChevronsRight: LucideIcon = _ChevronsRight;\nexport const ChevronsUpDown: LucideIcon = _ChevronsUpDown;\nexport const Circle: LucideIcon = _Circle;\nexport const Copy: LucideIcon = _Copy;\nexport const CornerDownLeft: LucideIcon = _CornerDownLeft;\nexport const CreditCard: LucideIcon = _CreditCard;\nexport const Download: LucideIcon = _Download;\nexport const Edit2: LucideIcon = _Edit2;\nexport const Ellipsis: LucideIcon = _Ellipsis;\nexport const ExternalLink: LucideIcon = _ExternalLink;\nexport const Eye: LucideIcon = _Eye;\nexport const EyeOff: LucideIcon = _EyeOff;\nexport const File: LucideIcon = _File;\nexport const FileText: LucideIcon = _FileText;\nexport const Filter: LucideIcon = _Filter;\nexport const Folder: LucideIcon = _Folder;\nexport const FolderOpen: LucideIcon = _FolderOpen;\nexport const Github: LucideIcon = _Github;\nexport const GripVertical: LucideIcon = _GripVertical;\nexport const Heart: LucideIcon = _Heart;\nexport const HelpCircle: LucideIcon = _HelpCircle;\nexport const Home: LucideIcon = _Home;\nexport const Inbox: LucideIcon = _Inbox;\nexport const Info: LucideIcon = _Info;\nexport const Kanban: LucideIcon = _Kanban;\nexport const Key: LucideIcon = _Key;\nexport const LayoutGrid: LucideIcon = _LayoutGrid;\nexport const Link2: LucideIcon = _Link2;\nexport const Loader2: LucideIcon = _Loader2;\nexport const Lock: LucideIcon = _Lock;\nexport const LogOut: LucideIcon = _LogOut;\nexport const Mail: LucideIcon = _Mail;\nexport const Menu: LucideIcon = _Menu;\nexport const MessageSquare: LucideIcon = _MessageSquare;\nexport const Minus: LucideIcon = _Minus;\nexport const Moon: LucideIcon = _Moon;\nexport const MoreHorizontal: LucideIcon = _MoreHorizontal;\nexport const Package: LucideIcon = _Package;\nexport const Pencil: LucideIcon = _Pencil;\nexport const Plug: LucideIcon = _Plug;\nexport const Plus: LucideIcon = _Plus;\nexport const Receipt: LucideIcon = _Receipt;\nexport const Search: LucideIcon = _Search;\nexport const Settings: LucideIcon = _Settings;\nexport const ShoppingCart: LucideIcon = _ShoppingCart;\nexport const Sparkles: LucideIcon = _Sparkles;\nexport const Star: LucideIcon = _Star;\nexport const Sun: LucideIcon = _Sun;\nexport const Tags: LucideIcon = _Tags;\nexport const Trash2: LucideIcon = _Trash2;\nexport const Upload: LucideIcon = _Upload;\nexport const User: LucideIcon = _User;\nexport const Users: LucideIcon = _Users;\nexport const Wallet: LucideIcon = _Wallet;\nexport const X: LucideIcon = _X;\nexport const XCircle: LucideIcon = _XCircle;\nexport const Zap: LucideIcon = _Zap;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsGa,IAA0B,IAC1B,IAA4B,IAC5B,IAAwB,IACxB,IAAwB,IACxB,KAAyB,IACzB,IAAsB,IACtB,IAA0B,IAC1B,IAAqB,IACrB,IAAwB,IACxB,IAAmB,IACnB,IAAuB,IACvB,IAAuB,IACvB,IAAuB,IACvB,IAAoB,IACpB,IAAwB,IACxB,IAAwB,IACxB,IAA2B,IAC3B,IAA0B,IAC1B,IAA0B,IAC1B,IAA2B,IAC3B,IAAwB,IACxB,IAA2B,IAC3B,IAA4B,IAC5B,IAA6B,IAC7B,IAAqB,IACrB,IAAmB,IACnB,IAA6B,IAC7B,IAAyB,IACzB,IAAuB,IACvB,IAAoB,IACpB,IAAuB,IACvB,IAA2B,IAC3B,IAAkB,IAClB,IAAqB,IACrB,IAAmB,IACnB,IAAuB,IACvB,IAAqB,IACrB,IAAqB,IACrB,IAAyB,IACzB,IAAqB,IACrB,IAA2B,IAC3B,IAAoB,IACpB,IAAyB,IACzB,IAAmB,IACnB,IAAoB,IACpB,IAAmB,IACnB,IAAqB,IACrB,IAAkB,IAClB,IAAyB,IACzB,IAAoB,IACpB,IAAsB,IACtB,IAAmB,IACnB,IAAqB,IACrB,IAAmB,IACnB,KAAmB,IACnB,KAA4B,IAC5B,KAAoB,IACpB,KAAmB,IACnB,KAA6B,IAC7B,KAAsB,IACtB,KAAqB,IACrB,KAAmB,IACnB,KAAmB,IACnB,KAAsB,IACtB,KAAqB,IACrB,KAAuB,IACvB,KAA2B,IAC3B,KAAuB,IACvB,KAAmB,IACnB,KAAkB,IAClB,KAAmB,IACnB,KAAqB,IACrB,KAAqB,IACrB,KAAmB,IACnB,KAAoB,IACpB,KAAqB,IACrB,KAAgB,IAChB,KAAsB,IACtB,IAAkB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/icons/index.ts"],"sourcesContent":["/**\n * Curated re-exports from lucide-react. Components should import icons from\n * here, never directly from 'lucide-react', so the design system can swap\n * icon sets later if needed and so unused icons stay tree-shakable.\n *\n * Icons are imported via their per-module paths (not the package barrel) on\n * purpose: the `@craftzbay/ui/icon` entry lazy-loads arbitrary icons through\n * lucide-react/dynamicIconImports, and if the barrel were in the static module\n * graph, Rollup would co-locate every dynamically imported icon into the\n * barrel's chunk — inlining the entire icon set instead of code-splitting it\n * (verified: the showcase vendor chunk goes 614 kB → 1.4 MB). The deep paths\n * are typed by `src/types/lucide-deep.d.ts`; each export is re-typed as\n * `LucideIcon` below so the emitted declarations only reference the package\n * root.\n *\n * Defaults applied at the call site:\n * - 16px for inline-with-text usage\n * - 20px for use inside buttons\n * - strokeWidth 1.5\n */\nimport type { LucideIcon } from 'lucide-react';\n\nimport _AlertCircle from 'lucide-react/dist/esm/icons/alert-circle.mjs';\nimport _AlertTriangle from 'lucide-react/dist/esm/icons/alert-triangle.mjs';\nimport _ArrowDown from 'lucide-react/dist/esm/icons/arrow-down.mjs';\nimport _ArrowLeft from 'lucide-react/dist/esm/icons/arrow-left.mjs';\nimport _ArrowRight from 'lucide-react/dist/esm/icons/arrow-right.mjs';\nimport _ArrowUp from 'lucide-react/dist/esm/icons/arrow-up.mjs';\nimport _ArrowUpDown from 'lucide-react/dist/esm/icons/arrow-up-down.mjs';\nimport _AtSign from 'lucide-react/dist/esm/icons/at-sign.mjs';\nimport _BarChart3 from 'lucide-react/dist/esm/icons/bar-chart-3.mjs';\nimport _Bell from 'lucide-react/dist/esm/icons/bell.mjs';\nimport _Bookmark from 'lucide-react/dist/esm/icons/bookmark.mjs';\nimport _Calendar from 'lucide-react/dist/esm/icons/calendar.mjs';\nimport _ChartPie from 'lucide-react/dist/esm/icons/chart-pie.mjs';\nimport _Check from 'lucide-react/dist/esm/icons/check.mjs';\nimport _Handshake from 'lucide-react/dist/esm/icons/handshake.mjs';\nimport _Image from 'lucide-react/dist/esm/icons/image.mjs';\nimport _CheckCircle2 from 'lucide-react/dist/esm/icons/check-circle-2.mjs';\nimport _ChevronDown from 'lucide-react/dist/esm/icons/chevron-down.mjs';\nimport _ChevronLeft from 'lucide-react/dist/esm/icons/chevron-left.mjs';\nimport _ChevronRight from 'lucide-react/dist/esm/icons/chevron-right.mjs';\nimport _ChevronUp from 'lucide-react/dist/esm/icons/chevron-up.mjs';\nimport _ChevronsLeft from 'lucide-react/dist/esm/icons/chevrons-left.mjs';\nimport _ChevronsRight from 'lucide-react/dist/esm/icons/chevrons-right.mjs';\nimport _ChevronsUpDown from 'lucide-react/dist/esm/icons/chevrons-up-down.mjs';\nimport _Circle from 'lucide-react/dist/esm/icons/circle.mjs';\nimport _Copy from 'lucide-react/dist/esm/icons/copy.mjs';\nimport _CornerDownLeft from 'lucide-react/dist/esm/icons/corner-down-left.mjs';\nimport _CreditCard from 'lucide-react/dist/esm/icons/credit-card.mjs';\nimport _Download from 'lucide-react/dist/esm/icons/download.mjs';\nimport _Edit2 from 'lucide-react/dist/esm/icons/edit-2.mjs';\nimport _Ellipsis from 'lucide-react/dist/esm/icons/ellipsis.mjs';\nimport _ExternalLink from 'lucide-react/dist/esm/icons/external-link.mjs';\nimport _Eye from 'lucide-react/dist/esm/icons/eye.mjs';\nimport _EyeOff from 'lucide-react/dist/esm/icons/eye-off.mjs';\nimport _File from 'lucide-react/dist/esm/icons/file.mjs';\nimport _FileText from 'lucide-react/dist/esm/icons/file-text.mjs';\nimport _Filter from 'lucide-react/dist/esm/icons/filter.mjs';\nimport _Folder from 'lucide-react/dist/esm/icons/folder.mjs';\nimport _FolderOpen from 'lucide-react/dist/esm/icons/folder-open.mjs';\nimport _Code from 'lucide-react/dist/esm/icons/code.mjs';\nimport _GripVertical from 'lucide-react/dist/esm/icons/grip-vertical.mjs';\nimport _Heart from 'lucide-react/dist/esm/icons/heart.mjs';\nimport _HelpCircle from 'lucide-react/dist/esm/icons/help-circle.mjs';\nimport _Home from 'lucide-react/dist/esm/icons/home.mjs';\nimport _Inbox from 'lucide-react/dist/esm/icons/inbox.mjs';\nimport _Info from 'lucide-react/dist/esm/icons/info.mjs';\nimport _Kanban from 'lucide-react/dist/esm/icons/kanban.mjs';\nimport _Key from 'lucide-react/dist/esm/icons/key.mjs';\nimport _LayoutGrid from 'lucide-react/dist/esm/icons/layout-grid.mjs';\nimport _Link2 from 'lucide-react/dist/esm/icons/link-2.mjs';\nimport _Loader2 from 'lucide-react/dist/esm/icons/loader-2.mjs';\nimport _Lock from 'lucide-react/dist/esm/icons/lock.mjs';\nimport _LogOut from 'lucide-react/dist/esm/icons/log-out.mjs';\nimport _Mail from 'lucide-react/dist/esm/icons/mail.mjs';\nimport _Menu from 'lucide-react/dist/esm/icons/menu.mjs';\nimport _MessageSquare from 'lucide-react/dist/esm/icons/message-square.mjs';\nimport _Minus from 'lucide-react/dist/esm/icons/minus.mjs';\nimport _Moon from 'lucide-react/dist/esm/icons/moon.mjs';\nimport _MoreHorizontal from 'lucide-react/dist/esm/icons/more-horizontal.mjs';\nimport _Package from 'lucide-react/dist/esm/icons/package.mjs';\nimport _Pencil from 'lucide-react/dist/esm/icons/pencil.mjs';\nimport _Plug from 'lucide-react/dist/esm/icons/plug.mjs';\nimport _Plus from 'lucide-react/dist/esm/icons/plus.mjs';\nimport _Receipt from 'lucide-react/dist/esm/icons/receipt.mjs';\nimport _Search from 'lucide-react/dist/esm/icons/search.mjs';\nimport _Settings from 'lucide-react/dist/esm/icons/settings.mjs';\nimport _ShoppingCart from 'lucide-react/dist/esm/icons/shopping-cart.mjs';\nimport _Sparkles from 'lucide-react/dist/esm/icons/sparkles.mjs';\nimport _Star from 'lucide-react/dist/esm/icons/star.mjs';\nimport _Sun from 'lucide-react/dist/esm/icons/sun.mjs';\nimport _Tags from 'lucide-react/dist/esm/icons/tags.mjs';\nimport _Trash2 from 'lucide-react/dist/esm/icons/trash-2.mjs';\nimport _Upload from 'lucide-react/dist/esm/icons/upload.mjs';\nimport _User from 'lucide-react/dist/esm/icons/user.mjs';\nimport _Users from 'lucide-react/dist/esm/icons/users.mjs';\nimport _Wallet from 'lucide-react/dist/esm/icons/wallet.mjs';\nimport _X from 'lucide-react/dist/esm/icons/x.mjs';\nimport _XCircle from 'lucide-react/dist/esm/icons/x-circle.mjs';\nimport _Zap from 'lucide-react/dist/esm/icons/zap.mjs';\n\nexport const AlertCircle: LucideIcon = _AlertCircle;\nexport const AlertTriangle: LucideIcon = _AlertTriangle;\nexport const ArrowDown: LucideIcon = _ArrowDown;\nexport const ArrowLeft: LucideIcon = _ArrowLeft;\nexport const ArrowRight: LucideIcon = _ArrowRight;\nexport const ArrowUp: LucideIcon = _ArrowUp;\nexport const ArrowUpDown: LucideIcon = _ArrowUpDown;\nexport const AtSign: LucideIcon = _AtSign;\nexport const BarChart3: LucideIcon = _BarChart3;\nexport const Bell: LucideIcon = _Bell;\nexport const Bookmark: LucideIcon = _Bookmark;\nexport const Calendar: LucideIcon = _Calendar;\nexport const ChartPie: LucideIcon = _ChartPie;\nexport const Check: LucideIcon = _Check;\nexport const Handshake: LucideIcon = _Handshake;\nexport const ImageIcon: LucideIcon = _Image;\nexport const CheckCircle2: LucideIcon = _CheckCircle2;\nexport const ChevronDown: LucideIcon = _ChevronDown;\nexport const ChevronLeft: LucideIcon = _ChevronLeft;\nexport const ChevronRight: LucideIcon = _ChevronRight;\nexport const ChevronUp: LucideIcon = _ChevronUp;\nexport const ChevronsLeft: LucideIcon = _ChevronsLeft;\nexport const ChevronsRight: LucideIcon = _ChevronsRight;\nexport const ChevronsUpDown: LucideIcon = _ChevronsUpDown;\nexport const Circle: LucideIcon = _Circle;\nexport const Copy: LucideIcon = _Copy;\nexport const CornerDownLeft: LucideIcon = _CornerDownLeft;\nexport const CreditCard: LucideIcon = _CreditCard;\nexport const Download: LucideIcon = _Download;\nexport const Edit2: LucideIcon = _Edit2;\nexport const Ellipsis: LucideIcon = _Ellipsis;\nexport const ExternalLink: LucideIcon = _ExternalLink;\nexport const Eye: LucideIcon = _Eye;\nexport const EyeOff: LucideIcon = _EyeOff;\nexport const File: LucideIcon = _File;\nexport const FileText: LucideIcon = _FileText;\nexport const Filter: LucideIcon = _Filter;\nexport const Folder: LucideIcon = _Folder;\nexport const FolderOpen: LucideIcon = _FolderOpen;\nexport const Code: LucideIcon = _Code;\nexport const GripVertical: LucideIcon = _GripVertical;\nexport const Heart: LucideIcon = _Heart;\nexport const HelpCircle: LucideIcon = _HelpCircle;\nexport const Home: LucideIcon = _Home;\nexport const Inbox: LucideIcon = _Inbox;\nexport const Info: LucideIcon = _Info;\nexport const Kanban: LucideIcon = _Kanban;\nexport const Key: LucideIcon = _Key;\nexport const LayoutGrid: LucideIcon = _LayoutGrid;\nexport const Link2: LucideIcon = _Link2;\nexport const Loader2: LucideIcon = _Loader2;\nexport const Lock: LucideIcon = _Lock;\nexport const LogOut: LucideIcon = _LogOut;\nexport const Mail: LucideIcon = _Mail;\nexport const Menu: LucideIcon = _Menu;\nexport const MessageSquare: LucideIcon = _MessageSquare;\nexport const Minus: LucideIcon = _Minus;\nexport const Moon: LucideIcon = _Moon;\nexport const MoreHorizontal: LucideIcon = _MoreHorizontal;\nexport const Package: LucideIcon = _Package;\nexport const Pencil: LucideIcon = _Pencil;\nexport const Plug: LucideIcon = _Plug;\nexport const Plus: LucideIcon = _Plus;\nexport const Receipt: LucideIcon = _Receipt;\nexport const Search: LucideIcon = _Search;\nexport const Settings: LucideIcon = _Settings;\nexport const ShoppingCart: LucideIcon = _ShoppingCart;\nexport const Sparkles: LucideIcon = _Sparkles;\nexport const Star: LucideIcon = _Star;\nexport const Sun: LucideIcon = _Sun;\nexport const Tags: LucideIcon = _Tags;\nexport const Trash2: LucideIcon = _Trash2;\nexport const Upload: LucideIcon = _Upload;\nexport const User: LucideIcon = _User;\nexport const Users: LucideIcon = _Users;\nexport const Wallet: LucideIcon = _Wallet;\nexport const X: LucideIcon = _X;\nexport const XCircle: LucideIcon = _XCircle;\nexport const Zap: LucideIcon = _Zap;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsGa,IAA0B,IAC1B,IAA4B,IAC5B,IAAwB,IACxB,IAAwB,IACxB,KAAyB,IACzB,IAAsB,IACtB,IAA0B,IAC1B,IAAqB,IACrB,IAAwB,IACxB,IAAmB,IACnB,IAAuB,IACvB,IAAuB,IACvB,IAAuB,IACvB,IAAoB,IACpB,IAAwB,IACxB,IAAwB,IACxB,IAA2B,IAC3B,IAA0B,IAC1B,IAA0B,IAC1B,IAA2B,IAC3B,IAAwB,IACxB,IAA2B,IAC3B,IAA4B,IAC5B,IAA6B,IAC7B,IAAqB,IACrB,IAAmB,IACnB,IAA6B,IAC7B,IAAyB,IACzB,IAAuB,IACvB,IAAoB,IACpB,IAAuB,IACvB,IAA2B,IAC3B,IAAkB,IAClB,IAAqB,IACrB,IAAmB,IACnB,IAAuB,IACvB,IAAqB,IACrB,IAAqB,IACrB,IAAyB,IACzB,IAAmB,IACnB,IAA2B,IAC3B,IAAoB,IACpB,IAAyB,IACzB,IAAmB,IACnB,IAAoB,IACpB,IAAmB,IACnB,IAAqB,IACrB,IAAkB,IAClB,IAAyB,IACzB,IAAoB,IACpB,IAAsB,IACtB,IAAmB,IACnB,IAAqB,IACrB,IAAmB,IACnB,KAAmB,IACnB,KAA4B,IAC5B,KAAoB,IACpB,KAAmB,IACnB,KAA6B,IAC7B,KAAsB,IACtB,KAAqB,IACrB,KAAmB,IACnB,KAAmB,IACnB,KAAsB,IACtB,KAAqB,IACrB,KAAuB,IACvB,KAA2B,IAC3B,KAAuB,IACvB,KAAmB,IACnB,KAAkB,IAClB,KAAmB,IACnB,KAAqB,IACrB,KAAqB,IACrB,KAAmB,IACnB,KAAoB,IACpB,KAAqB,IACrB,KAAgB,IAChB,KAAsB,IACtB,IAAkB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@craftzbay/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Refined-minimal Tailwind v4 + React design system — 50+ accessible, themeable primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "craftzbay",
|
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
"clsx": "^2.1.1",
|
|
88
88
|
"cmdk": "^1.1.1",
|
|
89
89
|
"embla-carousel-react": "^8.6.0",
|
|
90
|
-
"lucide-react": "^
|
|
90
|
+
"lucide-react": "^1.41.0",
|
|
91
91
|
"react-day-picker": "^10.0.1",
|
|
92
92
|
"react-hook-form": "^7.87.0",
|
|
93
93
|
"tailwind-merge": "^3.6.0",
|
|
94
94
|
"vaul": "^1.1.2"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@changesets/cli": "^
|
|
97
|
+
"@changesets/cli": "^3.0.2",
|
|
98
98
|
"@tailwindcss/postcss": "^4.3.3",
|
|
99
99
|
"@tailwindcss/vite": "^4.3.3",
|
|
100
100
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -102,23 +102,23 @@
|
|
|
102
102
|
"@testing-library/user-event": "^14.6.7",
|
|
103
103
|
"@types/jest-axe": "^3.5.9",
|
|
104
104
|
"@types/node": "^22.20.1",
|
|
105
|
-
"@types/react": "^
|
|
106
|
-
"@types/react-dom": "^
|
|
105
|
+
"@types/react": "^19.2.18",
|
|
106
|
+
"@types/react-dom": "^19.2.7",
|
|
107
107
|
"@vitejs/plugin-react": "^6.1.1",
|
|
108
108
|
"@vitest/coverage-v8": "^5.0.0",
|
|
109
109
|
"@vitest/ui": "^5.0.0",
|
|
110
110
|
"autoprefixer": "^10.5.5",
|
|
111
111
|
"eslint": "^9.39.5",
|
|
112
112
|
"eslint-plugin-react": "^7.37.5",
|
|
113
|
-
"eslint-plugin-react-hooks": "^
|
|
113
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
114
114
|
"jest-axe": "^11.0.0",
|
|
115
115
|
"jsdom": "^30.0.1",
|
|
116
116
|
"postcss": "^8.5.28",
|
|
117
117
|
"prettier": "^3.9.6",
|
|
118
118
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
119
|
-
"react": "^
|
|
119
|
+
"react": "^19.2.8",
|
|
120
120
|
"react-docgen-typescript": "^2.4.0",
|
|
121
|
-
"react-dom": "^
|
|
121
|
+
"react-dom": "^19.2.8",
|
|
122
122
|
"tailwindcss": "^4.3.3",
|
|
123
123
|
"tsx": "^4.23.13",
|
|
124
124
|
"tw-animate-css": "^1.4.0",
|