@jbpark/ui-kit 2.12.0 → 3.1.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/dist/Button.mjs +0 -1
- package/dist/Button.mjs.map +1 -1
- package/dist/components/atoms/date-picker.d.mts +20 -0
- package/dist/components/atoms/date-picker.d.mts.map +1 -0
- package/dist/components/atoms/date-picker.mjs +41 -0
- package/dist/components/atoms/date-picker.mjs.map +1 -0
- package/dist/components/atoms/float-button/back-top.mjs +3 -3
- package/dist/components/atoms/float-button/back-top.mjs.map +1 -1
- package/dist/components/atoms/index.d.mts +1 -0
- package/dist/components/atoms/radio/context.mjs +21 -0
- package/dist/components/atoms/radio/context.mjs.map +1 -0
- package/dist/components/atoms/radio/group.d.mts.map +1 -1
- package/dist/components/atoms/radio/group.mjs +25 -2
- package/dist/components/atoms/radio/group.mjs.map +1 -1
- package/dist/components/atoms/radio/radio.d.mts +7 -0
- package/dist/components/atoms/radio/radio.d.mts.map +1 -1
- package/dist/components/atoms/radio/radio.mjs +23 -19
- package/dist/components/atoms/radio/radio.mjs.map +1 -1
- package/dist/components/molecules/index.d.mts +2 -1
- package/dist/components/molecules/upload.d.mts +37 -0
- package/dist/components/molecules/upload.d.mts.map +1 -0
- package/dist/components/molecules/upload.mjs +101 -0
- package/dist/components/molecules/upload.mjs.map +1 -0
- package/dist/components/organisms/drawer.d.mts.map +1 -1
- package/dist/components/organisms/drawer.mjs +9 -2
- package/dist/components/organisms/drawer.mjs.map +1 -1
- package/dist/components/organisms/list/list.d.mts +7 -0
- package/dist/components/organisms/list/list.d.mts.map +1 -1
- package/dist/components/organisms/list/list.mjs +1 -1
- package/dist/components/organisms/list/list.mjs.map +1 -1
- package/dist/components/organisms/swiper/swiper.d.mts +17 -5
- package/dist/components/organisms/swiper/swiper.d.mts.map +1 -1
- package/dist/components/organisms/swiper/swiper.mjs +7 -12
- package/dist/components/organisms/swiper/swiper.mjs.map +1 -1
- package/dist/core/badge.d.mts +1 -1
- package/dist/core/button.d.mts +3 -3
- package/dist/core/button.mjs +1 -1
- package/dist/core/calendar.d.mts +30 -0
- package/dist/core/calendar.d.mts.map +1 -0
- package/dist/core/calendar.mjs +136 -0
- package/dist/core/calendar.mjs.map +1 -0
- package/dist/core.d.mts +2 -1
- package/dist/core.mjs +2 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.mjs +3 -1
- package/dist/style.css +262 -0
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.mjs","names":["drawer"],"sources":["../../../src/components/organisms/drawer.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { X } from 'lucide-react';\n\nimport { drawer } from '@repo/ui/core';\nimport { cn, renderConditional } from '@repo/ui/utils';\n\nimport Button from '../atoms/button';\n\nconst {\n DrawerContent,\n Drawer: DrawerCore,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n} = drawer;\n\nexport interface Props {\n open: boolean;\n children?: React.ReactNode;\n title?: React.ReactNode;\n extra?: React.ReactNode;\n footer?: React.ReactNode;\n closable?: boolean;\n closeIcon?: React.ReactNode;\n direction?: 'top' | 'bottom' | 'left' | 'right';\n size?: 'small' | 'medium' | 'large' | 'full' | string;\n maskClosable?: boolean;\n handlebar?: boolean;\n draggable?: boolean;\n rounded?: boolean;\n mask?: boolean;\n className?: string;\n style?: React.CSSProperties;\n classNames?: {\n mask?: string;\n content?: string;\n handlebar?: string;\n header?: string;\n title?: string;\n close?: string;\n extra?: string;\n body?: string;\n footer?: string;\n };\n container?: HTMLElement;\n onClose: () => void;\n}\n\nconst SIZES: Record<string, string> = {\n small: '30%',\n medium: '50%',\n large: '75%',\n full: '90%',\n};\n\nconst getSizeStyles = (\n direction: 'top' | 'bottom' | 'left' | 'right',\n size: string,\n): React.CSSProperties => {\n const value = SIZES[size] || size;\n\n return direction === 'top' || direction === 'bottom'\n ? { height: value }\n : { width: value };\n};\n\nconst Drawer = ({\n open,\n title,\n extra,\n footer,\n closable = true,\n closeIcon,\n direction = 'bottom',\n size = 'medium',\n maskClosable = true,\n handlebar = true,\n draggable = false,\n rounded = false,\n mask = true,\n className,\n classNames,\n style,\n children,\n container,\n onClose,\n ...props\n}: Props) => {\n useEffect(() => {\n if (!open || mask) {\n return;\n }\n\n
|
|
1
|
+
{"version":3,"file":"drawer.mjs","names":["drawer"],"sources":["../../../src/components/organisms/drawer.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport { X } from 'lucide-react';\n\nimport { drawer } from '@repo/ui/core';\nimport { cn, renderConditional } from '@repo/ui/utils';\n\nimport Button from '../atoms/button';\n\nconst {\n DrawerContent,\n Drawer: DrawerCore,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerTitle,\n} = drawer;\n\n// `document.body.style.pointerEvents` is global state, so several mask-less\n// overlays opening at once would otherwise race: each instance would capture\n// whatever the previous one had already written and the last cleanup would\n// restore a stale value. Reference counting makes only the first instance\n// capture the original value and only the last one restore it.\nlet maskLessOverlayCount = 0;\nlet originalBodyPointerEvents: string | null = null;\n\nexport interface Props {\n open: boolean;\n children?: React.ReactNode;\n title?: React.ReactNode;\n extra?: React.ReactNode;\n footer?: React.ReactNode;\n closable?: boolean;\n closeIcon?: React.ReactNode;\n direction?: 'top' | 'bottom' | 'left' | 'right';\n size?: 'small' | 'medium' | 'large' | 'full' | string;\n maskClosable?: boolean;\n handlebar?: boolean;\n draggable?: boolean;\n rounded?: boolean;\n mask?: boolean;\n className?: string;\n style?: React.CSSProperties;\n classNames?: {\n mask?: string;\n content?: string;\n handlebar?: string;\n header?: string;\n title?: string;\n close?: string;\n extra?: string;\n body?: string;\n footer?: string;\n };\n container?: HTMLElement;\n onClose: () => void;\n}\n\nconst SIZES: Record<string, string> = {\n small: '30%',\n medium: '50%',\n large: '75%',\n full: '90%',\n};\n\nconst getSizeStyles = (\n direction: 'top' | 'bottom' | 'left' | 'right',\n size: string,\n): React.CSSProperties => {\n const value = SIZES[size] || size;\n\n return direction === 'top' || direction === 'bottom'\n ? { height: value }\n : { width: value };\n};\n\nconst Drawer = ({\n open,\n title,\n extra,\n footer,\n closable = true,\n closeIcon,\n direction = 'bottom',\n size = 'medium',\n maskClosable = true,\n handlebar = true,\n draggable = false,\n rounded = false,\n mask = true,\n className,\n classNames,\n style,\n children,\n container,\n onClose,\n ...props\n}: Props) => {\n useEffect(() => {\n if (!open || mask) {\n return;\n }\n\n if (maskLessOverlayCount === 0) {\n originalBodyPointerEvents = document.body.style.pointerEvents;\n }\n maskLessOverlayCount += 1;\n\n const raf = window.requestAnimationFrame(() => {\n document.body.style.pointerEvents = 'auto';\n });\n\n return () => {\n window.cancelAnimationFrame(raf);\n maskLessOverlayCount -= 1;\n\n if (maskLessOverlayCount === 0) {\n document.body.style.pointerEvents = originalBodyPointerEvents ?? '';\n originalBodyPointerEvents = null;\n }\n };\n }, [open, mask]);\n\n return (\n <DrawerCore\n open={open}\n direction={direction}\n handleOnly={!draggable}\n container={container}\n onOpenChange={open => {\n if (!open) {\n onClose();\n }\n }}\n {...props}\n >\n <DrawerContent\n className={cn(\n 'border-none outline-none',\n rounded ? 'rounded-t-[30px]!' : 'rounded-none!',\n classNames?.content,\n className,\n //\n )}\n handlebar={handlebar}\n mask={mask}\n onPointerDownOutside={event => {\n if (!maskClosable) {\n event.preventDefault();\n }\n }}\n classNames={{\n mask: classNames?.mask || '',\n handlebar: classNames?.handlebar || '',\n }}\n style={{\n ...getSizeStyles(direction, size),\n ...style,\n }}\n >\n <DrawerHeader\n className={cn(\n classNames?.header,\n !title && 'p-0',\n //\n )}\n >\n <div className=\"flex items-start gap-2\">\n {renderConditional(closable ? closeIcon || <X /> : null, v => (\n <Button\n type=\"text\"\n shape=\"circle\"\n size=\"small\"\n aria-label=\"닫기\"\n icon={v}\n onClick={onClose}\n className={cn(classNames?.close)}\n />\n ))}\n <div className=\"flex flex-1 items-start justify-between gap-2\">\n <DrawerTitle className={cn(classNames?.title)}>\n {title}\n </DrawerTitle>\n {renderConditional(extra, v => (\n <div className={cn('shrink-0', classNames?.extra)}>{v}</div>\n ))}\n </div>\n </div>\n <DrawerDescription className=\"hidden\" />\n </DrawerHeader>\n <div\n className={cn(\n 'overflow-auto p-5',\n classNames?.body,\n //\n )}\n >\n {children}\n </div>\n {renderConditional(footer, v => (\n <DrawerFooter className={cn(classNames?.footer)}>{v}</DrawerFooter>\n ))}\n </DrawerContent>\n </DrawerCore>\n );\n};\n\nexport default Drawer;\n"],"mappings":";;;;;;;;;;AAWA,MAAM,EACJ,eACA,QAAQ,YACR,mBACA,cACA,cACA,gBACEA;AAOJ,IAAI,uBAAuB;AAC3B,IAAI,4BAA2C;AAkC/C,MAAM,QAAgC;CACpC,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACP;AAED,MAAM,iBACJ,WACA,SACwB;CACxB,MAAM,QAAQ,MAAM,SAAS;AAE7B,QAAO,cAAc,SAAS,cAAc,WACxC,EAAE,QAAQ,OAAO,GACjB,EAAE,OAAO,OAAO;;AAGtB,MAAM,UAAU,EACd,MACA,OACA,OACA,QACA,WAAW,MACX,WACA,YAAY,UACZ,OAAO,UACP,eAAe,MACf,YAAY,MACZ,YAAY,OACZ,UAAU,OACV,OAAO,MACP,WACA,YACA,OACA,UACA,WACA,SACA,GAAG,YACQ;AACX,iBAAgB;AACd,MAAI,CAAC,QAAQ,KACX;AAGF,MAAI,yBAAyB,EAC3B,6BAA4B,SAAS,KAAK,MAAM;AAElD,0BAAwB;EAExB,MAAM,MAAM,OAAO,4BAA4B;AAC7C,YAAS,KAAK,MAAM,gBAAgB;IACpC;AAEF,eAAa;AACX,UAAO,qBAAqB,IAAI;AAChC,2BAAwB;AAExB,OAAI,yBAAyB,GAAG;AAC9B,aAAS,KAAK,MAAM,gBAAgB,6BAA6B;AACjE,gCAA4B;;;IAG/B,CAAC,MAAM,KAAK,CAAC;AAEhB,QACE,oBAAC;EACO;EACK;EACX,YAAY,CAAC;EACF;EACX,eAAc,SAAQ;AACpB,OAAI,CAAC,KACH,UAAS;;EAGb,GAAI;YAEJ,qBAAC;GACC,WAAW,GACT,4BACA,UAAU,sBAAsB,iBAChC,YAAY,SACZ,UAED;GACU;GACL;GACN,uBAAsB,UAAS;AAC7B,QAAI,CAAC,aACH,OAAM,gBAAgB;;GAG1B,YAAY;IACV,MAAM,YAAY,QAAQ;IAC1B,WAAW,YAAY,aAAa;IACrC;GACD,OAAO;IACL,GAAG,cAAc,WAAW,KAAK;IACjC,GAAG;IACJ;;IAED,qBAAC;KACC,WAAW,GACT,YAAY,QACZ,CAAC,SAAS,MAEX;gBAED,qBAAC;MAAI,WAAU;iBACZ,kBAAkB,WAAW,aAAa,oBAAC,MAAI,GAAG,OAAM,MACvD,oBAAC;OACC,MAAK;OACL,OAAM;OACN,MAAK;OACL,cAAW;OACX,MAAM;OACN,SAAS;OACT,WAAW,GAAG,YAAY,MAAM;QAChC,CACF,EACF,qBAAC;OAAI,WAAU;kBACb,oBAAC;QAAY,WAAW,GAAG,YAAY,MAAM;kBAC1C;SACW,EACb,kBAAkB,QAAO,MACxB,oBAAC;QAAI,WAAW,GAAG,YAAY,YAAY,MAAM;kBAAG;SAAQ,CAC5D;QACE;OACF,EACN,oBAAC,qBAAkB,WAAU,WAAW;MAC3B;IACf,oBAAC;KACC,WAAW,GACT,qBACA,YAAY,KAEb;KAEA;MACG;IACL,kBAAkB,SAAQ,MACzB,oBAAC;KAAa,WAAW,GAAG,YAAY,OAAO;eAAG;MAAiB,CACnE;;IACY;GACL"}
|
|
@@ -21,6 +21,13 @@ interface Props<T> extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title'>
|
|
|
21
21
|
loading: boolean;
|
|
22
22
|
loader?: React.ReactNode;
|
|
23
23
|
options?: IntersectionObserverInit;
|
|
24
|
+
/**
|
|
25
|
+
* Called when more items should be fetched. `List` tracks in-flight
|
|
26
|
+
* requests via `loading` — the caller MUST flip `loading` back to
|
|
27
|
+
* `false` when the fetch settles, including on failure/rejection.
|
|
28
|
+
* If `loading` never becomes `false` again after a failed fetch,
|
|
29
|
+
* `List` will stop calling `next()` for subsequent intersections.
|
|
30
|
+
*/
|
|
24
31
|
next: () => void;
|
|
25
32
|
};
|
|
26
33
|
data?: T[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.mts","names":[],"sources":["../../../../src/components/organisms/list/list.tsx"],"mappings":";;;;;UAWU,KAAA,YAAiB,IAAA,CACzB,KAAA,CAAM,wBAAA;EAGN,OAAA;EACA,WAAA,GAAc,KAAA,CAAM,cAAA,QAAsB,QAAA;EAC1C,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,UAAA;EACA,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,UAAA;IACE,KAAA;IACA,MAAA;IACA,IAAA;EAAA;EAEF,MAAA;IACE,OAAA;IACA,OAAA;IACA,MAAA,GAAS,KAAA,CAAM,SAAA;IACf,OAAA,GAAU,wBAAA;
|
|
1
|
+
{"version":3,"file":"list.d.mts","names":[],"sources":["../../../../src/components/organisms/list/list.tsx"],"mappings":";;;;;UAWU,KAAA,YAAiB,IAAA,CACzB,KAAA,CAAM,wBAAA;EAGN,OAAA;EACA,WAAA,GAAc,KAAA,CAAM,cAAA,QAAsB,QAAA;EAC1C,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,UAAA;EACA,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,KAAA,GAAQ,KAAA,CAAM,SAAA;EACd,UAAA;IACE,KAAA;IACA,MAAA;IACA,IAAA;EAAA;EAEF,MAAA;IACE,OAAA;IACA,OAAA;IACA,MAAA,GAAS,KAAA,CAAM,SAAA;IACf,OAAA,GAAU,wBAAA;IAYK;;;;;;;IAJf,IAAA;EAAA;EAEF,IAAA,GAAO,CAAA;EACP,UAAA,IAAc,IAAA,EAAM,CAAA,EAAG,KAAA,aAAkB,KAAA,CAAM,SAAA;EAC/C,OAAA,IAAW,IAAA,EAAM,CAAA,EAAG,KAAA,aAAkB,KAAA,CAAM,GAAA;AAAA;AAAA,cAGxC,IAAA;EAAY,OAAA;EAAA,WAAA;EAAA,MAAA;EAAA,MAAA;EAAA,KAAA;EAAA,UAAA;EAAA,KAAA;EAAA,MAAA;EAAA,IAAA;EAAA,SAAA;EAAA,UAAA;EAAA,UAAA;EAAA,OAAA;EAAA,GAAA;AAAA,GAef,KAAA,CAAM,CAAA,wCAAE,QAAA,CAAA,KAAA,CAAA,SAAA,IAAA,OAAA,sCAAA,KAAA,CAAA,WAAA,GAAA,KAAA,CAAA,YAAA,mBAAA,KAAA,CAAA,qBAAA,SAAA,QAAA,CAAA,KAAA,CAAA,SAAA,wBAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -5,7 +5,7 @@ import Title from "../../atoms/typography/title.mjs";
|
|
|
5
5
|
import Skeleton from "../../atoms/skeleton/index.mjs";
|
|
6
6
|
import React, { useEffect, useRef } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { useIntersectionObserver } from "@
|
|
8
|
+
import { useIntersectionObserver } from "@jbpark/use-hooks";
|
|
9
9
|
|
|
10
10
|
//#region src/components/organisms/list/list.tsx
|
|
11
11
|
const List = ({ loading, loaderProps, loader, header, title, titleLevel = 2, empty, scroll, data, className, classNames, renderItem = () => null, itemKey, ...props }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","names":[],"sources":["../../../../src/components/organisms/list/list.tsx"],"sourcesContent":["'use client';\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { useIntersectionObserver } from '@
|
|
1
|
+
{"version":3,"file":"list.mjs","names":[],"sources":["../../../../src/components/organisms/list/list.tsx"],"sourcesContent":["'use client';\n\nimport React, { useEffect, useRef } from 'react';\n\nimport { useIntersectionObserver } from '@jbpark/use-hooks';\n\nimport { cn, renderConditional } from '@repo/ui/utils';\n\nimport Skeleton from '../../atoms/skeleton';\nimport { Title } from '../../atoms/typography';\n\ninterface Props<T> extends Omit<\n React.ComponentPropsWithoutRef<'div'>,\n 'title'\n> {\n loading?: boolean;\n loaderProps?: React.ComponentProps<typeof Skeleton>;\n loader?: React.ReactNode;\n title?: React.ReactNode;\n titleLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n header?: React.ReactNode;\n empty?: React.ReactNode;\n classNames?: {\n title?: string;\n header?: string;\n body?: string;\n };\n scroll?: {\n hasMore: boolean;\n loading: boolean;\n loader?: React.ReactNode;\n options?: IntersectionObserverInit;\n /**\n * Called when more items should be fetched. `List` tracks in-flight\n * requests via `loading` — the caller MUST flip `loading` back to\n * `false` when the fetch settles, including on failure/rejection.\n * If `loading` never becomes `false` again after a failed fetch,\n * `List` will stop calling `next()` for subsequent intersections.\n */\n next: () => void;\n };\n data?: T[];\n renderItem?: (item: T, index: number) => React.ReactNode;\n itemKey?: (item: T, index: number) => React.Key;\n}\n\nconst List = <T,>({\n loading,\n loaderProps,\n loader,\n header,\n title,\n titleLevel = 2,\n empty,\n scroll,\n data,\n className,\n classNames,\n renderItem = () => null,\n itemKey,\n ...props\n}: Props<T>) => {\n const [loaderRef, entry] = useIntersectionObserver({\n threshold: 0,\n root: null,\n rootMargin: '0px',\n ...scroll?.options,\n });\n\n // `scroll` is typically a new object identity every render, so this\n // effect re-runs often. Guard with a ref (updated synchronously, unlike\n // the `loading` prop which only reflects the caller's next state update)\n // to avoid firing `next()` again for the same in-flight request before\n // the caller's `loading` has had a chance to become true.\n const fetchingRef = useRef(false);\n\n useEffect(() => {\n if (!scroll) {\n return;\n }\n\n if (scroll.loading) {\n fetchingRef.current = false;\n return;\n }\n\n if (entry?.isIntersecting && scroll.hasMore && !fetchingRef.current) {\n fetchingRef.current = true;\n scroll.next();\n }\n }, [entry, scroll]);\n\n if (loading) {\n return (\n loader || (\n <div className={cn(className)} {...props}>\n <div className={cn(classNames?.title)}>{title && <Skeleton />}</div>\n <div className={cn(classNames?.header)}>\n {header && <Skeleton size=\"small\" />}\n </div>\n <div className={cn('space-y-2', classNames?.body)}>\n <Skeleton.Node count={10} gap={10} {...loaderProps} />\n </div>\n </div>\n )\n );\n }\n\n if (!data?.length && empty) {\n return (\n <div className={cn(className)} {...props}>\n {empty}\n </div>\n );\n }\n\n return (\n <div\n className={cn(\n className,\n //\n )}\n {...props}\n >\n {renderConditional(title, v => (\n <Title\n level={titleLevel}\n className={cn(\n 'px-1.5 py-4',\n 'text-black-90 text-lg leading-5.75 font-bold',\n //\n )}\n >\n {v}\n </Title>\n ))}\n <div className={cn(classNames?.header)}>{header}</div>\n <div role=\"list\" className={cn('space-y-2', classNames?.body)}>\n {data?.map((item, i) =>\n itemKey ? (\n <React.Fragment key={itemKey(item, i)}>\n {renderItem(item, i)}\n </React.Fragment>\n ) : (\n renderItem(item, i)\n ),\n )}\n {scroll?.loading &&\n (scroll?.loader ?? (\n <Skeleton.Node count={10} gap={10} {...loaderProps} />\n ))}\n {scroll && <div ref={loaderRef} />}\n </div>\n </div>\n );\n};\n\nexport default List;\n"],"mappings":";;;;;;;;;;AA8CA,MAAM,QAAY,EAChB,SACA,aACA,QACA,QACA,OACA,aAAa,GACb,OACA,QACA,MACA,WACA,YACA,mBAAmB,MACnB,SACA,GAAG,YACW;CACd,MAAM,CAAC,WAAW,SAAS,wBAAwB;EACjD,WAAW;EACX,MAAM;EACN,YAAY;EACZ,GAAG,QAAQ;EACZ,CAAC;CAOF,MAAM,cAAc,OAAO,MAAM;AAEjC,iBAAgB;AACd,MAAI,CAAC,OACH;AAGF,MAAI,OAAO,SAAS;AAClB,eAAY,UAAU;AACtB;;AAGF,MAAI,OAAO,kBAAkB,OAAO,WAAW,CAAC,YAAY,SAAS;AACnE,eAAY,UAAU;AACtB,UAAO,MAAM;;IAEd,CAAC,OAAO,OAAO,CAAC;AAEnB,KAAI,QACF,QACE,UACE,qBAAC;EAAI,WAAW,GAAG,UAAU;EAAE,GAAI;;GACjC,oBAAC;IAAI,WAAW,GAAG,YAAY,MAAM;cAAG,SAAS,oBAAC,aAAW;KAAO;GACpE,oBAAC;IAAI,WAAW,GAAG,YAAY,OAAO;cACnC,UAAU,oBAAC,YAAS,MAAK,UAAU;KAChC;GACN,oBAAC;IAAI,WAAW,GAAG,aAAa,YAAY,KAAK;cAC/C,oBAAC,SAAS;KAAK,OAAO;KAAI,KAAK;KAAI,GAAI;MAAe;KAClD;;GACF;AAKZ,KAAI,CAAC,MAAM,UAAU,MACnB,QACE,oBAAC;EAAI,WAAW,GAAG,UAAU;EAAE,GAAI;YAChC;GACG;AAIV,QACE,qBAAC;EACC,WAAW,GACT,UAED;EACD,GAAI;;GAEH,kBAAkB,QAAO,MACxB,oBAAC;IACC,OAAO;IACP,WAAW,GACT,eACA,+CAED;cAEA;KACK,CACR;GACF,oBAAC;IAAI,WAAW,GAAG,YAAY,OAAO;cAAG;KAAa;GACtD,qBAAC;IAAI,MAAK;IAAO,WAAW,GAAG,aAAa,YAAY,KAAK;;KAC1D,MAAM,KAAK,MAAM,MAChB,UACE,oBAAC,MAAM,sBACJ,WAAW,MAAM,EAAE,IADD,QAAQ,MAAM,EAAE,CAEpB,GAEjB,WAAW,MAAM,EAAE,CAEtB;KACA,QAAQ,YACN,QAAQ,UACP,oBAAC,SAAS;MAAK,OAAO;MAAI,KAAK;MAAI,GAAI;OAAe;KAEzD,UAAU,oBAAC,SAAI,KAAK,YAAa;;KAC9B;;GACF"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { SwiperProps } from "swiper/react";
|
|
3
3
|
import "swiper/css";
|
|
4
|
-
import "swiper/
|
|
5
|
-
import "swiper/css/effect-cards";
|
|
6
|
-
import "swiper/css/navigation";
|
|
7
|
-
import "swiper/css/scrollbar";
|
|
8
|
-
import { SwiperOptions } from "swiper/types";
|
|
4
|
+
import { SwiperModule, SwiperOptions } from "swiper/types";
|
|
9
5
|
|
|
10
6
|
//#region src/components/organisms/swiper/swiper.d.ts
|
|
11
7
|
interface Props<T> extends SwiperProps {
|
|
@@ -13,6 +9,21 @@ interface Props<T> extends SwiperProps {
|
|
|
13
9
|
loader?: React.ReactNode;
|
|
14
10
|
loadingClassName?: string;
|
|
15
11
|
options?: SwiperOptions;
|
|
12
|
+
/**
|
|
13
|
+
* Swiper feature modules to activate. Nothing is bundled by default — import
|
|
14
|
+
* the modules you need from `swiper/modules` together with their stylesheets
|
|
15
|
+
* (`swiper/css/<module>`) and pass them here.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import { Autoplay, Navigation } from 'swiper/modules';
|
|
19
|
+
* import 'swiper/css/autoplay';
|
|
20
|
+
* import 'swiper/css/navigation';
|
|
21
|
+
*
|
|
22
|
+
* <Swiper modules={[Autoplay, Navigation]} ... />
|
|
23
|
+
*
|
|
24
|
+
* @default []
|
|
25
|
+
*/
|
|
26
|
+
modules?: SwiperModule[];
|
|
16
27
|
data: T[];
|
|
17
28
|
renderItem(item: T, key: number): React.ReactNode;
|
|
18
29
|
}
|
|
@@ -20,6 +31,7 @@ declare const Swiper$1: <T>({
|
|
|
20
31
|
loading,
|
|
21
32
|
loader,
|
|
22
33
|
options,
|
|
34
|
+
modules,
|
|
23
35
|
data,
|
|
24
36
|
style,
|
|
25
37
|
renderItem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swiper.d.mts","names":[],"sources":["../../../../src/components/organisms/swiper/swiper.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"swiper.d.mts","names":[],"sources":["../../../../src/components/organisms/swiper/swiper.tsx"],"mappings":";;;;;;UA6BU,KAAA,YAAiB,WAAA;EACzB,OAAA;EACA,MAAA,GAAS,KAAA,CAAM,SAAA;EACf,gBAAA;EACA,OAAA,GAAU,aAAA;EAiBwB;;;;;;;;;;;;;;EAFlC,OAAA,GAAU,YAAA;EACV,IAAA,EAAM,CAAA;EACN,UAAA,CAAW,IAAA,EAAM,CAAA,EAAG,GAAA,WAAc,KAAA,CAAM,SAAA;AAAA;AAAA,cAGpC,QAAA;EAAc,OAAA;EAAA,MAAA;EAAA,OAAA;EAAA,OAAA;EAAA,IAAA;EAAA,KAAA;EAAA,UAAA;EAAA,gBAAA;EAAA,GAAA;AAAA,GAUjB,KAAA,CAAM,CAAA,MAAE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -4,14 +4,14 @@ import { cn } from "../../../utils.mjs";
|
|
|
4
4
|
import Spin from "../../atoms/spin.mjs";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { Swiper } from "swiper/react";
|
|
7
|
-
import { Autoplay, EffectCards, Navigation, Scrollbar } from "swiper/modules";
|
|
8
7
|
import "swiper/css";
|
|
9
|
-
import "swiper/css/autoplay";
|
|
10
|
-
import "swiper/css/effect-cards";
|
|
11
|
-
import "swiper/css/navigation";
|
|
12
|
-
import "swiper/css/scrollbar";
|
|
13
8
|
|
|
14
9
|
//#region src/components/organisms/swiper/swiper.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Baseline Swiper options. `navigation` / `autoplay` are inert unless the
|
|
12
|
+
* matching modules are passed through the `modules` prop — see the README next
|
|
13
|
+
* to this file.
|
|
14
|
+
*/
|
|
15
15
|
const initialOptions = {
|
|
16
16
|
loop: false,
|
|
17
17
|
spaceBetween: 8,
|
|
@@ -27,18 +27,13 @@ const initialStyle = {
|
|
|
27
27
|
maxWidth: "100vw",
|
|
28
28
|
overflow: "hidden"
|
|
29
29
|
};
|
|
30
|
-
const Swiper$1 = ({ loading, loader, options = {}, data = [], style, renderItem, loadingClassName, ...props }) => {
|
|
30
|
+
const Swiper$1 = ({ loading, loader, options = {}, modules = [], data = [], style, renderItem, loadingClassName, ...props }) => {
|
|
31
31
|
if (loading) return /* @__PURE__ */ jsx("div", {
|
|
32
32
|
className: cn("h-32", loadingClassName),
|
|
33
33
|
children: loader || /* @__PURE__ */ jsx(Spin, { spinning: true })
|
|
34
34
|
});
|
|
35
35
|
return /* @__PURE__ */ jsx(Swiper, {
|
|
36
|
-
modules
|
|
37
|
-
Navigation,
|
|
38
|
-
Scrollbar,
|
|
39
|
-
Autoplay,
|
|
40
|
-
EffectCards
|
|
41
|
-
],
|
|
36
|
+
modules,
|
|
42
37
|
...initialOptions,
|
|
43
38
|
...options,
|
|
44
39
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swiper.mjs","names":["Swiper","SwiperCore"],"sources":["../../../../src/components/organisms/swiper/swiper.tsx"],"sourcesContent":["'use client';\n\nimport {
|
|
1
|
+
{"version":3,"file":"swiper.mjs","names":["Swiper","SwiperCore"],"sources":["../../../../src/components/organisms/swiper/swiper.tsx"],"sourcesContent":["'use client';\n\nimport { Swiper as SwiperCore, SwiperProps } from 'swiper/react';\nimport { SwiperModule, SwiperOptions } from 'swiper/types';\n\nimport { cn } from '@repo/ui/utils';\n\nimport 'swiper/css';\n\nimport { Spin } from '../../atoms';\n\n/**\n * Baseline Swiper options. `navigation` / `autoplay` are inert unless the\n * matching modules are passed through the `modules` prop — see the README next\n * to this file.\n */\nexport const initialOptions: SwiperOptions = {\n loop: false,\n spaceBetween: 8,\n slidesPerView: 'auto',\n navigation: false,\n autoplay: {\n delay: 2500,\n disableOnInteraction: false,\n },\n};\n\nconst initialStyle = { width: '100%', maxWidth: '100vw', overflow: 'hidden' };\n\ninterface Props<T> extends SwiperProps {\n loading?: boolean;\n loader?: React.ReactNode;\n loadingClassName?: string;\n options?: SwiperOptions;\n /**\n * Swiper feature modules to activate. Nothing is bundled by default — import\n * the modules you need from `swiper/modules` together with their stylesheets\n * (`swiper/css/<module>`) and pass them here.\n *\n * @example\n * import { Autoplay, Navigation } from 'swiper/modules';\n * import 'swiper/css/autoplay';\n * import 'swiper/css/navigation';\n *\n * <Swiper modules={[Autoplay, Navigation]} ... />\n *\n * @default []\n */\n modules?: SwiperModule[];\n data: T[];\n renderItem(item: T, key: number): React.ReactNode;\n}\n\nconst Swiper = <T,>({\n loading,\n loader,\n options = {},\n modules = [],\n data = [],\n style,\n renderItem,\n loadingClassName,\n ...props\n}: Props<T>) => {\n if (loading) {\n return (\n <div className={cn('h-32', loadingClassName)}>\n {loader || <Spin spinning />}\n </div>\n );\n }\n\n return (\n <SwiperCore\n modules={modules}\n {...initialOptions}\n {...options}\n style={{ ...initialStyle, ...style }}\n {...props}\n >\n {data.map((item: T, i) => renderItem(item, i))}\n </SwiperCore>\n );\n};\n\nexport default Swiper;\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAa,iBAAgC;CAC3C,MAAM;CACN,cAAc;CACd,eAAe;CACf,YAAY;CACZ,UAAU;EACR,OAAO;EACP,sBAAsB;EACvB;CACF;AAED,MAAM,eAAe;CAAE,OAAO;CAAQ,UAAU;CAAS,UAAU;CAAU;AA0B7E,MAAMA,YAAc,EAClB,SACA,QACA,UAAU,EAAE,EACZ,UAAU,EAAE,EACZ,OAAO,EAAE,EACT,OACA,YACA,kBACA,GAAG,YACW;AACd,KAAI,QACF,QACE,oBAAC;EAAI,WAAW,GAAG,QAAQ,iBAAiB;YACzC,UAAU,oBAAC,QAAK,iBAAW;GACxB;AAIV,QACE,oBAACC;EACU;EACT,GAAI;EACJ,GAAI;EACJ,OAAO;GAAE,GAAG;GAAc,GAAG;GAAO;EACpC,GAAI;YAEH,KAAK,KAAK,MAAS,MAAM,WAAW,MAAM,EAAE,CAAC;GACnC"}
|
package/dist/core/badge.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ declare namespace badge_d_exports {
|
|
|
8
8
|
export { Badge, Props, badgeVariants };
|
|
9
9
|
}
|
|
10
10
|
declare const badgeVariants: (props?: ({
|
|
11
|
-
variant?: "default" | "
|
|
11
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
type Props = React$1.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
14
14
|
asChild?: boolean;
|
package/dist/core/button.d.mts
CHANGED
|
@@ -8,8 +8,8 @@ declare namespace button_d_exports {
|
|
|
8
8
|
export { Button, Props, buttonVariants };
|
|
9
9
|
}
|
|
10
10
|
declare const buttonVariants: (props?: ({
|
|
11
|
-
variant?: "link" | "default" | "
|
|
12
|
-
size?: "
|
|
11
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
12
|
+
size?: "icon" | "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
13
13
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
14
14
|
type Props = React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
15
15
|
asChild?: boolean;
|
|
@@ -22,5 +22,5 @@ declare function Button({
|
|
|
22
22
|
...props
|
|
23
23
|
}: Props): react_jsx_runtime0.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
|
-
export { type Props, button_d_exports };
|
|
25
|
+
export { Button, type Props, button_d_exports };
|
|
26
26
|
//# sourceMappingURL=button.d.mts.map
|
package/dist/core/button.mjs
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Button } from "./button.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { DayButton, DayPicker } from "react-day-picker";
|
|
5
|
+
|
|
6
|
+
//#region src/core/calendar.d.ts
|
|
7
|
+
declare namespace calendar_d_exports {
|
|
8
|
+
export { Calendar, CalendarDayButton };
|
|
9
|
+
}
|
|
10
|
+
declare function Calendar({
|
|
11
|
+
className,
|
|
12
|
+
classNames,
|
|
13
|
+
showOutsideDays,
|
|
14
|
+
captionLayout,
|
|
15
|
+
buttonVariant,
|
|
16
|
+
formatters,
|
|
17
|
+
components,
|
|
18
|
+
...props
|
|
19
|
+
}: React$1.ComponentProps<typeof DayPicker> & {
|
|
20
|
+
buttonVariant?: React$1.ComponentProps<typeof Button>['variant'];
|
|
21
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
22
|
+
declare function CalendarDayButton({
|
|
23
|
+
className,
|
|
24
|
+
day,
|
|
25
|
+
modifiers,
|
|
26
|
+
...props
|
|
27
|
+
}: React$1.ComponentProps<typeof DayButton>): react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { calendar_d_exports };
|
|
30
|
+
//# sourceMappingURL=calendar.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.mts","names":[],"sources":["../../src/core/calendar.tsx"],"mappings":";;;;;;;;;iBAeS,QAAA,CAAA;EACP,SAAA;EACA,UAAA;EACA,eAAA;EACA,aAAA;EACA,aAAA;EACA,UAAA;EACA,UAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,SAAA;EAC7B,aAAA,GAAgB,OAAA,CAAM,cAAA,QAAsB,MAAA;AAAA,IAC7C,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAkKQ,iBAAA,CAAA;EACP,SAAA;EACA,GAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,OAAA,CAAM,cAAA,QAAsB,SAAA,IAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
4
|
+
import { cn } from "../utils.mjs";
|
|
5
|
+
import { Button, buttonVariants } from "./button.mjs";
|
|
6
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
10
|
+
|
|
11
|
+
//#region src/core/calendar.tsx
|
|
12
|
+
var calendar_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
+
Calendar: () => Calendar,
|
|
14
|
+
CalendarDayButton: () => CalendarDayButton
|
|
15
|
+
});
|
|
16
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
|
17
|
+
const defaultClassNames = getDefaultClassNames();
|
|
18
|
+
return /* @__PURE__ */ jsx(DayPicker, {
|
|
19
|
+
showOutsideDays,
|
|
20
|
+
className: cn(`bg-background group/calendar p-3 [--cell-size:2rem]
|
|
21
|
+
[[data-slot=card-content]_&]:bg-transparent
|
|
22
|
+
[[data-slot=popover-content]_&]:bg-transparent`, String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
23
|
+
captionLayout,
|
|
24
|
+
formatters: {
|
|
25
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
26
|
+
...formatters
|
|
27
|
+
},
|
|
28
|
+
classNames: {
|
|
29
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
30
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
31
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
32
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
33
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
34
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
35
|
+
month_caption: cn("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]", defaultClassNames.month_caption),
|
|
36
|
+
dropdowns: cn("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
37
|
+
dropdown_root: cn(`has-focus:border-ring border-input shadow-xs
|
|
38
|
+
has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md
|
|
39
|
+
border`, defaultClassNames.dropdown_root),
|
|
40
|
+
dropdown: cn("bg-popover absolute inset-0 opacity-0", defaultClassNames.dropdown),
|
|
41
|
+
caption_label: cn("select-none font-medium", captionLayout === "label" ? "text-sm" : `[&>svg]:text-muted-foreground flex h-8 items-center gap-1
|
|
42
|
+
rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5`, defaultClassNames.caption_label),
|
|
43
|
+
month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
|
|
44
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
45
|
+
weekday: cn("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal", defaultClassNames.weekday),
|
|
46
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
47
|
+
week_number_header: cn("w-[--cell-size] select-none", defaultClassNames.week_number_header),
|
|
48
|
+
week_number: cn("text-muted-foreground select-none text-[0.8rem]", defaultClassNames.week_number),
|
|
49
|
+
day: cn(`group/day relative aspect-square h-full w-full select-none p-0
|
|
50
|
+
text-center [&:first-child[data-selected=true]_button]:rounded-l-md
|
|
51
|
+
[&:last-child[data-selected=true]_button]:rounded-r-md`, defaultClassNames.day),
|
|
52
|
+
range_start: cn("bg-accent rounded-l-md", defaultClassNames.range_start),
|
|
53
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
54
|
+
range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
|
|
55
|
+
today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
56
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
57
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
58
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
59
|
+
...classNames
|
|
60
|
+
},
|
|
61
|
+
components: {
|
|
62
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
63
|
+
return /* @__PURE__ */ jsx("div", {
|
|
64
|
+
"data-slot": "calendar",
|
|
65
|
+
ref: rootRef,
|
|
66
|
+
className: cn(className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
71
|
+
if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
72
|
+
className: cn("size-4", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
76
|
+
className: cn("size-4", className),
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
80
|
+
className: cn("size-4", className),
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
DayButton: CalendarDayButton,
|
|
85
|
+
WeekNumber: ({ children, ...props }) => {
|
|
86
|
+
return /* @__PURE__ */ jsx("td", {
|
|
87
|
+
...props,
|
|
88
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
89
|
+
className: "flex size-[--cell-size] items-center justify-center\n text-center",
|
|
90
|
+
children
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
...components
|
|
95
|
+
},
|
|
96
|
+
...props
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
100
|
+
const defaultClassNames = getDefaultClassNames();
|
|
101
|
+
const ref = React$1.useRef(null);
|
|
102
|
+
React$1.useEffect(() => {
|
|
103
|
+
if (modifiers.focused) ref.current?.focus();
|
|
104
|
+
}, [modifiers.focused]);
|
|
105
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
106
|
+
ref,
|
|
107
|
+
variant: "ghost",
|
|
108
|
+
size: "icon",
|
|
109
|
+
"data-day": day.date.toLocaleDateString(),
|
|
110
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
111
|
+
"data-range-start": modifiers.range_start,
|
|
112
|
+
"data-range-end": modifiers.range_end,
|
|
113
|
+
"data-range-middle": modifiers.range_middle,
|
|
114
|
+
className: cn(`data-[selected-single=true]:bg-primary
|
|
115
|
+
data-[selected-single=true]:text-primary-foreground
|
|
116
|
+
data-[range-middle=true]:bg-accent
|
|
117
|
+
data-[range-middle=true]:text-accent-foreground
|
|
118
|
+
data-[range-start=true]:bg-primary
|
|
119
|
+
data-[range-start=true]:text-primary-foreground
|
|
120
|
+
data-[range-end=true]:bg-primary
|
|
121
|
+
data-[range-end=true]:text-primary-foreground
|
|
122
|
+
group-data-[focused=true]/day:border-ring
|
|
123
|
+
group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto
|
|
124
|
+
w-full min-w-[--cell-size] flex-col gap-1 leading-none font-normal
|
|
125
|
+
group-data-[focused=true]/day:relative
|
|
126
|
+
group-data-[focused=true]/day:z-10
|
|
127
|
+
group-data-[focused=true]/day:ring-[3px]
|
|
128
|
+
data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none
|
|
129
|
+
data-[range-start=true]:rounded-md [&>span]:text-xs [&>span]:opacity-70`, defaultClassNames.day, className),
|
|
130
|
+
...props
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
//#endregion
|
|
135
|
+
export { calendar_exports };
|
|
136
|
+
//# sourceMappingURL=calendar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.mjs","names":["React"],"sources":["../../src/core/calendar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n} from 'lucide-react';\n\nimport { cn } from '@repo/ui/utils';\n\nimport { Button, buttonVariants } from './button';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n `bg-background group/calendar p-3 [--cell-size:2rem]\n [[data-slot=card-content]_&]:bg-transparent\n [[data-slot=popover-content]_&]:bg-transparent`,\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: date =>\n date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn(\n 'relative flex flex-col gap-4 md:flex-row',\n defaultClassNames.months,\n ),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n `has-focus:border-ring border-input shadow-xs\n has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md\n border`,\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\n 'bg-popover absolute inset-0 opacity-0',\n defaultClassNames.dropdown,\n ),\n caption_label: cn(\n 'select-none font-medium',\n captionLayout === 'label'\n ? 'text-sm'\n : `[&>svg]:text-muted-foreground flex h-8 items-center gap-1\n rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5`,\n defaultClassNames.caption_label,\n ),\n month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn(\n 'w-[--cell-size] select-none',\n defaultClassNames.week_number_header,\n ),\n week_number: cn(\n 'text-muted-foreground select-none text-[0.8rem]',\n defaultClassNames.week_number,\n ),\n day: cn(\n `group/day relative aspect-square h-full w-full select-none p-0\n text-center [&:first-child[data-selected=true]_button]:rounded-l-md\n [&:last-child[data-selected=true]_button]:rounded-r-md`,\n defaultClassNames.day,\n ),\n range_start: cn(\n 'bg-accent rounded-l-md',\n defaultClassNames.range_start,\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('bg-accent rounded-r-md', defaultClassNames.range_end),\n today: cn(\n 'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',\n defaultClassNames.today,\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn(\n 'text-muted-foreground opacity-50',\n defaultClassNames.disabled,\n ),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n // eslint-disable-next-line react/prop-types -- typed via DayPicker's `components` prop, not local PropTypes\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n // eslint-disable-next-line react/prop-types -- typed via DayPicker's `components` prop, not local PropTypes\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return (\n <ChevronLeftIcon className={cn('size-4', className)} {...props} />\n );\n }\n\n if (orientation === 'right') {\n return (\n <ChevronRightIcon\n className={cn('size-4', className)}\n {...props}\n />\n );\n }\n\n return (\n <ChevronDownIcon className={cn('size-4', className)} {...props} />\n );\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div\n className=\"flex size-[--cell-size] items-center justify-center\n text-center\"\n >\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n `data-[selected-single=true]:bg-primary\n data-[selected-single=true]:text-primary-foreground\n data-[range-middle=true]:bg-accent\n data-[range-middle=true]:text-accent-foreground\n data-[range-start=true]:bg-primary\n data-[range-start=true]:text-primary-foreground\n data-[range-end=true]:bg-primary\n data-[range-end=true]:text-primary-foreground\n group-data-[focused=true]/day:border-ring\n group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto\n w-full min-w-[--cell-size] flex-col gap-1 leading-none font-normal\n group-data-[focused=true]/day:relative\n group-data-[focused=true]/day:z-10\n group-data-[focused=true]/day:ring-[3px]\n data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none\n data-[range-start=true]:rounded-md [&>span]:text-xs [&>span]:opacity-70`,\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":"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"}
|
package/dist/core.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { accordion_d_exports } from "./core/accordion.mjs";
|
|
2
2
|
import { badge_d_exports } from "./core/badge.mjs";
|
|
3
3
|
import { button_d_exports } from "./core/button.mjs";
|
|
4
|
+
import { calendar_d_exports } from "./core/calendar.mjs";
|
|
4
5
|
import { checkbox_d_exports } from "./core/checkbox.mjs";
|
|
5
6
|
import { dialog_d_exports } from "./core/dialog.mjs";
|
|
6
7
|
import { drawer_d_exports } from "./core/drawer.mjs";
|
|
@@ -16,4 +17,4 @@ import { separator_d_exports } from "./core/separator.mjs";
|
|
|
16
17
|
import { skeleton_d_exports } from "./core/skeleton.mjs";
|
|
17
18
|
import { switch_d_exports } from "./core/switch.mjs";
|
|
18
19
|
import { textarea_d_exports } from "./core/textarea.mjs";
|
|
19
|
-
export { accordion_d_exports as accordion, badge_d_exports as badge, button_d_exports as button, checkbox_d_exports as checkbox, dialog_d_exports as dialog, drawer_d_exports as drawer, field_d_exports as field, input_d_exports as input, label_d_exports as label, popover_d_exports as popover, progress_d_exports as progress, radio_group_d_exports as radio, resizable_d_exports as resizable, select_d_exports as select, separator_d_exports as separator, skeleton_d_exports as skeleton, switch_d_exports as switchComponent, textarea_d_exports as textarea };
|
|
20
|
+
export { accordion_d_exports as accordion, badge_d_exports as badge, button_d_exports as button, calendar_d_exports as calendar, checkbox_d_exports as checkbox, dialog_d_exports as dialog, drawer_d_exports as drawer, field_d_exports as field, input_d_exports as input, label_d_exports as label, popover_d_exports as popover, progress_d_exports as progress, radio_group_d_exports as radio, resizable_d_exports as resizable, select_d_exports as select, separator_d_exports as separator, skeleton_d_exports as skeleton, switch_d_exports as switchComponent, textarea_d_exports as textarea };
|
package/dist/core.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { accordion_exports } from "./core/accordion.mjs";
|
|
2
2
|
import { badge_exports } from "./core/badge.mjs";
|
|
3
3
|
import { button_exports } from "./core/button.mjs";
|
|
4
|
+
import { calendar_exports } from "./core/calendar.mjs";
|
|
4
5
|
import { checkbox_exports } from "./core/checkbox.mjs";
|
|
5
6
|
import { dialog_exports } from "./core/dialog.mjs";
|
|
6
7
|
import { drawer_exports } from "./core/drawer.mjs";
|
|
@@ -17,4 +18,4 @@ import { skeleton_exports } from "./core/skeleton.mjs";
|
|
|
17
18
|
import { switch_exports } from "./core/switch.mjs";
|
|
18
19
|
import { textarea_exports } from "./core/textarea.mjs";
|
|
19
20
|
|
|
20
|
-
export { accordion_exports as accordion, badge_exports as badge, button_exports as button, checkbox_exports as checkbox, dialog_exports as dialog, drawer_exports as drawer, field_exports as field, input_exports as input, label_exports as label, popover_exports as popover, progress_exports as progress, radio_group_exports as radio, resizable_exports as resizable, select_exports as select, separator_exports as separator, skeleton_exports as skeleton, switch_exports as switchComponent, textarea_exports as textarea };
|
|
21
|
+
export { accordion_exports as accordion, badge_exports as badge, button_exports as button, calendar_exports as calendar, checkbox_exports as checkbox, dialog_exports as dialog, drawer_exports as drawer, field_exports as field, input_exports as input, label_exports as label, popover_exports as popover, progress_exports as progress, radio_group_exports as radio, resizable_exports as resizable, select_exports as select, separator_exports as separator, skeleton_exports as skeleton, switch_exports as switchComponent, textarea_exports as textarea };
|
package/dist/index.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import Space from "./Space.mjs";
|
|
|
8
8
|
import Layout from "./Layout.mjs";
|
|
9
9
|
import { Checkbox } from "./components/atoms/checkbox/index.mjs";
|
|
10
10
|
import { ColorPicker } from "./components/atoms/color-picker.mjs";
|
|
11
|
+
import { DatePicker } from "./components/atoms/date-picker.mjs";
|
|
11
12
|
import { FloatButton } from "./components/atoms/float-button/index.mjs";
|
|
12
13
|
import { Input } from "./components/atoms/input/index.mjs";
|
|
13
14
|
import { Popover } from "./components/atoms/popover.mjs";
|
|
@@ -22,6 +23,7 @@ import { Collapse } from "./components/molecules/collapse.mjs";
|
|
|
22
23
|
import { Dropdown } from "./components/molecules/dropdown.mjs";
|
|
23
24
|
import { Marquees } from "./components/molecules/marquees/index.mjs";
|
|
24
25
|
import { Splitter } from "./components/molecules/splitter/index.mjs";
|
|
26
|
+
import { Upload, UploadFile } from "./components/molecules/upload.mjs";
|
|
25
27
|
import "./components/molecules/index.mjs";
|
|
26
28
|
import { Drawer, Props as Props$1 } from "./components/organisms/drawer.mjs";
|
|
27
29
|
import { List } from "./components/organisms/list/index.mjs";
|
|
@@ -33,4 +35,4 @@ import { ThemeConfig, ThemeToken } from "./providers/Config/types.mjs";
|
|
|
33
35
|
import { useConfig } from "./providers/Config/context.mjs";
|
|
34
36
|
import { Config, Props } from "./providers/Config/index.mjs";
|
|
35
37
|
import "./providers/index.mjs";
|
|
36
|
-
export { Button, Card, Checkbox, Collapse, ColorPicker, Config, Props as ConfigProps, Drawer, Props$1 as DrawerProps, Dropdown, FloatButton, Input, Layout, List, Marquees, Menu, Modal, Popover, Progress, Radio, Reveals, Select, Skeleton, Space, Spin, Splitter, Swiper, Switch, Tag, ThemeConfig, ThemeToken, Typography, useConfig };
|
|
38
|
+
export { Button, Card, Checkbox, Collapse, ColorPicker, Config, Props as ConfigProps, DatePicker, Drawer, Props$1 as DrawerProps, Dropdown, FloatButton, Input, Layout, List, Marquees, Menu, Modal, Popover, Progress, Radio, Reveals, Select, Skeleton, Space, Spin, Splitter, Swiper, Switch, Tag, ThemeConfig, ThemeToken, Typography, Upload, UploadFile, useConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import Checkbox from "./components/atoms/checkbox/index.mjs";
|
|
|
4
4
|
import Typography from "./Typography.mjs";
|
|
5
5
|
import Popover from "./components/atoms/popover.mjs";
|
|
6
6
|
import ColorPicker from "./components/atoms/color-picker.mjs";
|
|
7
|
+
import DatePicker from "./components/atoms/date-picker.mjs";
|
|
7
8
|
import FloatButton from "./components/atoms/float-button/index.mjs";
|
|
8
9
|
import Input from "./components/atoms/input/index.mjs";
|
|
9
10
|
import Progress from "./components/atoms/progress.mjs";
|
|
@@ -21,6 +22,7 @@ import Marquees from "./components/molecules/marquees/index.mjs";
|
|
|
21
22
|
import Reveals from "./Reveals.mjs";
|
|
22
23
|
import Splitter from "./components/molecules/splitter/index.mjs";
|
|
23
24
|
import Space from "./Space.mjs";
|
|
25
|
+
import Upload from "./components/molecules/upload.mjs";
|
|
24
26
|
import Drawer from "./components/organisms/drawer.mjs";
|
|
25
27
|
import List from "./components/organisms/list/index.mjs";
|
|
26
28
|
import Modal from "./components/organisms/modal.mjs";
|
|
@@ -29,4 +31,4 @@ import Layout from "./Layout.mjs";
|
|
|
29
31
|
import { useConfig } from "./providers/Config/context.mjs";
|
|
30
32
|
import Config from "./providers/Config/index.mjs";
|
|
31
33
|
|
|
32
|
-
export { Button, Card, Checkbox, Collapse, ColorPicker, Config, Drawer, Dropdown, FloatButton, Input, Layout, List, Marquees, Menu, Modal, Popover, Progress, Radio, Reveals, Select, Skeleton, Space, Spin, Splitter, Swiper, Switch, Tag, Typography, useConfig };
|
|
34
|
+
export { Button, Card, Checkbox, Collapse, ColorPicker, Config, DatePicker, Drawer, Dropdown, FloatButton, Input, Layout, List, Marquees, Menu, Modal, Popover, Progress, Radio, Reveals, Select, Skeleton, Space, Spin, Splitter, Swiper, Switch, Tag, Typography, Upload, useConfig };
|