@inzumer/ui-library 1.1.0 → 1.3.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/{chunk-PVDRNAYK.js → chunk-3YRDRHO3.js} +33 -22
- package/dist/chunk-3YRDRHO3.js.map +1 -0
- package/dist/chunk-53YMHM24.js +20 -0
- package/dist/chunk-53YMHM24.js.map +1 -0
- package/dist/chunk-DP274HDM.js +34 -0
- package/dist/chunk-DP274HDM.js.map +1 -0
- package/dist/chunk-FFKHEBQ7.js +41 -0
- package/dist/chunk-FFKHEBQ7.js.map +1 -0
- package/dist/chunk-GQMA2AQI.js +3 -0
- package/dist/chunk-GQMA2AQI.js.map +1 -0
- package/dist/{chunk-DXJQNQ5K.js → chunk-KL6I2JFC.js} +3 -3
- package/dist/{chunk-DXJQNQ5K.js.map → chunk-KL6I2JFC.js.map} +1 -1
- package/dist/chunk-NKNSSH2Q.js +142 -0
- package/dist/chunk-NKNSSH2Q.js.map +1 -0
- package/dist/{chunk-ZEGQFAYE.js → chunk-PF5PSCG4.js} +12 -6
- package/dist/chunk-PF5PSCG4.js.map +1 -0
- package/dist/chunk-QT62VC36.js +50 -0
- package/dist/chunk-QT62VC36.js.map +1 -0
- package/dist/{chunk-CJ4LRU6X.js → chunk-SMKLV4ET.js} +12 -6
- package/dist/chunk-SMKLV4ET.js.map +1 -0
- package/dist/chunk-V3YXRI7M.js +41 -0
- package/dist/chunk-V3YXRI7M.js.map +1 -0
- package/dist/chunk-WUEVXL76.js +91 -0
- package/dist/chunk-WUEVXL76.js.map +1 -0
- package/dist/chunk-XCUA543I.js +59 -0
- package/dist/chunk-XCUA543I.js.map +1 -0
- package/dist/components/atoms/Button/index.js +2 -1
- package/dist/components/atoms/Input/index.js +2 -1
- package/dist/components/atoms/Select/index.d.ts +29 -0
- package/dist/components/atoms/Select/index.js +6 -0
- package/dist/components/atoms/Select/index.js.map +1 -0
- package/dist/components/atoms/Textarea/index.d.ts +28 -0
- package/dist/components/atoms/Textarea/index.js +6 -0
- package/dist/components/atoms/Textarea/index.js.map +1 -0
- package/dist/components/molecules/Accordion/index.d.ts +26 -0
- package/dist/components/molecules/Accordion/index.js +4 -0
- package/dist/components/molecules/Accordion/index.js.map +1 -0
- package/dist/components/molecules/BottomSheet/index.js +4 -2
- package/dist/components/molecules/Drawer/index.d.ts +44 -0
- package/dist/components/molecules/Drawer/index.js +11 -0
- package/dist/components/molecules/Drawer/index.js.map +1 -0
- package/dist/components/molecules/Modal/index.js +4 -2
- package/dist/components/molecules/Table/index.d.ts +39 -0
- package/dist/components/molecules/Table/index.js +4 -0
- package/dist/components/molecules/Table/index.js.map +1 -0
- package/dist/hooks/useFocusTrap/index.d.ts +9 -0
- package/dist/hooks/useFocusTrap/index.js +3 -0
- package/dist/hooks/useFocusTrap/index.js.map +1 -0
- package/dist/hooks/useScrollLock/index.d.ts +4 -0
- package/dist/hooks/useScrollLock/index.js +3 -0
- package/dist/hooks/useScrollLock/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +18 -9
- package/package.json +29 -1
- package/dist/chunk-CJ4LRU6X.js.map +0 -1
- package/dist/chunk-PVDRNAYK.js.map +0 -1
- package/dist/chunk-ZEGQFAYE.js.map +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useScrollLock } from './chunk-53YMHM24.js';
|
|
2
2
|
import { useDelayedUnmount } from './chunk-BNEEI7S5.js';
|
|
3
|
+
import { useDismissableLayer } from './chunk-JCJP427C.js';
|
|
4
|
+
import { useFocusTrap } from './chunk-QT62VC36.js';
|
|
3
5
|
import { useMergedRef } from './chunk-P4Z7HH66.js';
|
|
4
6
|
import { RichText } from './chunk-P4CV2EPR.js';
|
|
5
7
|
import { cn } from './chunk-6LLGTBM6.js';
|
|
6
|
-
import { forwardRef, useRef } from 'react';
|
|
8
|
+
import { forwardRef, useRef, useId } from 'react';
|
|
7
9
|
import { cva } from 'class-variance-authority';
|
|
8
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
11
|
|
|
@@ -48,8 +50,11 @@ var Modal = forwardRef(
|
|
|
48
50
|
({ open, onClose, title, footer, closeOnBackdropClick = true, className, children, ...props }, ref) => {
|
|
49
51
|
const panelRef = useRef(null);
|
|
50
52
|
const setPanelRef = useMergedRef(ref, panelRef);
|
|
53
|
+
const titleId = useId();
|
|
51
54
|
const { mounted, visible } = useDelayedUnmount(open, EXIT_DURATION_MS);
|
|
52
55
|
useDismissableLayer(open, onClose, panelRef, closeOnBackdropClick);
|
|
56
|
+
useFocusTrap(open && mounted, panelRef);
|
|
57
|
+
useScrollLock(open);
|
|
53
58
|
if (!mounted) {
|
|
54
59
|
return null;
|
|
55
60
|
}
|
|
@@ -59,11 +64,12 @@ var Modal = forwardRef(
|
|
|
59
64
|
ref: setPanelRef,
|
|
60
65
|
role: "dialog",
|
|
61
66
|
"aria-modal": "true",
|
|
62
|
-
"aria-labelledby": title ?
|
|
67
|
+
"aria-labelledby": title ? titleId : void 0,
|
|
68
|
+
tabIndex: -1,
|
|
63
69
|
className: cn(modalPanelStyles({ visible }), className),
|
|
64
70
|
...props,
|
|
65
71
|
children: [
|
|
66
|
-
title && /* @__PURE__ */ jsx(RichText, { as: "h2", id:
|
|
72
|
+
title && /* @__PURE__ */ jsx(RichText, { as: "h2", id: titleId, variant: "s1", className: modalTitleStyles, children: title }),
|
|
67
73
|
children,
|
|
68
74
|
footer && /* @__PURE__ */ jsx("div", { className: modalFooterStyles, children: footer })
|
|
69
75
|
]
|
|
@@ -74,5 +80,5 @@ var Modal = forwardRef(
|
|
|
74
80
|
Modal.displayName = "Modal";
|
|
75
81
|
|
|
76
82
|
export { Modal };
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-SMKLV4ET.js.map
|
|
84
|
+
//# sourceMappingURL=chunk-SMKLV4ET.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/molecules/Modal/Modal.styles.ts","../src/components/molecules/Modal/Modal.tsx"],"names":[],"mappings":";;;;;;;;;;;AAEO,IAAM,kBAAA,GAAqB,GAAA;AAAA,EAChC;AAAA,IACE,qFAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,aAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEO,IAAM,gBAAA,GAAmB,GAAA;AAAA,EAC9B;AAAA,IACE,8GAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,uBAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEO,IAAM,gBAAA,GAAmB,uDAAA;AAEzB,IAAM,iBAAA,GAAoB,0CAAA;ACvBjC,IAAM,gBAAA,GAAmB,GAAA;AAUlB,IAAM,KAAA,GAAQ,UAAA;AAAA,EACnB,CACE,EAAE,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,MAAA,EAAQ,oBAAA,GAAuB,IAAA,EAAM,SAAA,EAAW,QAAA,EAAU,GAAG,KAAA,IACrF,GAAA,KACG;AACH,IAAA,MAAM,QAAA,GAAW,OAA8B,IAAI,CAAA;AACnD,IAAA,MAAM,WAAA,GAAc,YAAA,CAAa,GAAA,EAAK,QAAQ,CAAA;AAC9C,IAAA,MAAM,UAAU,KAAA,EAAM;AACtB,IAAA,MAAM,EAAE,OAAA,EAAS,OAAA,EAAQ,GAAI,iBAAA,CAAkB,MAAM,gBAAgB,CAAA;AAErE,IAAA,mBAAA,CAAoB,IAAA,EAAM,OAAA,EAAS,QAAA,EAAU,oBAAoB,CAAA;AAEjE,IAAA,YAAA,CAAa,IAAA,IAAQ,SAAS,QAAQ,CAAA;AACtC,IAAA,aAAA,CAAc,IAAI,CAAA;AAElB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,mBAAmB,EAAE,OAAA,EAAS,CAAA,EAC5C,QAAA,kBAAA,IAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,WAAA;AAAA,QACL,IAAA,EAAK,QAAA;AAAA,QACL,YAAA,EAAW,MAAA;AAAA,QACX,iBAAA,EAAiB,QAAQ,OAAA,GAAU,MAAA;AAAA,QACnC,QAAA,EAAU,EAAA;AAAA,QACV,WAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,OAAA,EAAS,GAAG,SAAS,CAAA;AAAA,QACrD,GAAG,KAAA;AAAA,QAEH,QAAA,EAAA;AAAA,UAAA,KAAA,oBACC,GAAA,CAAC,QAAA,EAAA,EAAS,EAAA,EAAG,IAAA,EAAK,EAAA,EAAI,SAAS,OAAA,EAAQ,IAAA,EAAK,SAAA,EAAW,gBAAA,EACpD,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,UAED,QAAA;AAAA,UACA,MAAA,oBAAU,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,mBAAoB,QAAA,EAAA,MAAA,EAAO;AAAA;AAAA;AAAA,KACxD,EACF,CAAA;AAAA,EAEJ;AACF;AAEA,KAAA,CAAM,WAAA,GAAc,OAAA","file":"chunk-SMKLV4ET.js","sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const modalOverlayStyles = cva(\n [\n 'fixed inset-0 z-50 flex items-center justify-center bg-[var(--surface-overlay)] p-4',\n 'transition-opacity duration-200 ease-out',\n ],\n {\n variants: {\n visible: {\n true: 'opacity-100',\n false: 'opacity-0',\n },\n },\n defaultVariants: {\n visible: false,\n },\n },\n);\n\nexport const modalPanelStyles = cva(\n [\n 'w-full max-w-md rounded-xl border border-[var(--border-default)] bg-[var(--surface-secondary)] p-6 shadow-lg',\n 'transition-all duration-200 ease-out',\n ],\n {\n variants: {\n visible: {\n true: 'scale-100 opacity-100',\n false: 'scale-95 opacity-0',\n },\n },\n defaultVariants: {\n visible: false,\n },\n },\n);\n\nexport const modalTitleStyles = 'mb-4 text-lg font-semibold text-[var(--text-primary)]';\n\nexport const modalFooterStyles = 'mt-6 flex items-center justify-end gap-2';\n","import { forwardRef, useId, useRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { RichText } from '@components';\nimport {\n useDelayedUnmount,\n useDismissableLayer,\n useFocusTrap,\n useMergedRef,\n useScrollLock,\n} from '@hooks';\nimport { cn } from '@utils';\nimport {\n modalFooterStyles,\n modalOverlayStyles,\n modalPanelStyles,\n modalTitleStyles,\n} from './Modal.styles';\n\nconst EXIT_DURATION_MS = 200;\n\nexport type ModalProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & {\n open: boolean;\n onClose: () => void;\n title?: ReactNode;\n footer?: ReactNode;\n closeOnBackdropClick?: boolean;\n};\n\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(\n (\n { open, onClose, title, footer, closeOnBackdropClick = true, className, children, ...props },\n ref,\n ) => {\n const panelRef = useRef<HTMLDivElement | null>(null);\n const setPanelRef = useMergedRef(ref, panelRef);\n const titleId = useId();\n const { mounted, visible } = useDelayedUnmount(open, EXIT_DURATION_MS);\n\n useDismissableLayer(open, onClose, panelRef, closeOnBackdropClick);\n // The panel mounts one render after `open` flips, so the trap starts once it exists.\n useFocusTrap(open && mounted, panelRef);\n useScrollLock(open);\n\n if (!mounted) {\n return null;\n }\n\n return (\n <div className={modalOverlayStyles({ visible })}>\n <div\n ref={setPanelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n tabIndex={-1}\n className={cn(modalPanelStyles({ visible }), className)}\n {...props}\n >\n {title && (\n <RichText as=\"h2\" id={titleId} variant=\"s1\" className={modalTitleStyles}>\n {title}\n </RichText>\n )}\n {children}\n {footer && <div className={modalFooterStyles}>{footer}</div>}\n </div>\n </div>\n );\n },\n);\n\nModal.displayName = 'Modal';\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from './chunk-6LLGTBM6.js';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/components/molecules/Accordion/Accordion.styles.ts
|
|
6
|
+
var accordionStyles = "group";
|
|
7
|
+
var accordionSummaryStyles = [
|
|
8
|
+
"flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 rounded-lg px-3",
|
|
9
|
+
"font-semibold text-[var(--text-primary)] transition-colors hover:bg-[var(--surface-secondary)]",
|
|
10
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--border-focus)]",
|
|
11
|
+
"[&::-webkit-details-marker]:hidden"
|
|
12
|
+
].join(" ");
|
|
13
|
+
var accordionChevronStyles = "size-4 shrink-0 text-[var(--text-secondary)] transition-transform duration-150 group-open:rotate-180";
|
|
14
|
+
var accordionContentStyles = "mt-1 px-3";
|
|
15
|
+
var Accordion = forwardRef(
|
|
16
|
+
({ summary, summaryClassName, contentClassName, className, children, ...props }, ref) => /* @__PURE__ */ jsxs("details", { ref, className: cn(accordionStyles, className), ...props, children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("summary", { className: cn(accordionSummaryStyles, summaryClassName), children: [
|
|
18
|
+
summary,
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"svg",
|
|
21
|
+
{
|
|
22
|
+
"aria-hidden": true,
|
|
23
|
+
viewBox: "0 0 24 24",
|
|
24
|
+
fill: "none",
|
|
25
|
+
stroke: "currentColor",
|
|
26
|
+
strokeWidth: 2,
|
|
27
|
+
strokeLinecap: "round",
|
|
28
|
+
strokeLinejoin: "round",
|
|
29
|
+
className: accordionChevronStyles,
|
|
30
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }),
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: cn(accordionContentStyles, contentClassName), children })
|
|
35
|
+
] })
|
|
36
|
+
);
|
|
37
|
+
Accordion.displayName = "Accordion";
|
|
38
|
+
|
|
39
|
+
export { Accordion };
|
|
40
|
+
//# sourceMappingURL=chunk-V3YXRI7M.js.map
|
|
41
|
+
//# sourceMappingURL=chunk-V3YXRI7M.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/molecules/Accordion/Accordion.styles.ts","../src/components/molecules/Accordion/Accordion.tsx"],"names":[],"mappings":";;;;;AAAO,IAAM,eAAA,GAAkB,OAAA;AAExB,IAAM,sBAAA,GAAyB;AAAA,EACpC,2FAAA;AAAA,EACA,gGAAA;AAAA,EACA,0FAAA;AAAA,EACA;AACF,CAAA,CAAE,KAAK,GAAG,CAAA;AAEH,IAAM,sBAAA,GACX,sGAAA;AAEK,IAAM,sBAAA,GAAyB,WAAA;ACW/B,IAAM,SAAA,GAAY,UAAA;AAAA,EACvB,CAAC,EAAE,OAAA,EAAS,gBAAA,EAAkB,kBAAkB,SAAA,EAAW,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,wBAC/E,IAAA,CAAC,SAAA,EAAA,EAAQ,KAAU,SAAA,EAAW,EAAA,CAAG,iBAAiB,SAAS,CAAA,EAAI,GAAG,KAAA,EAChE,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,SAAA,EAAA,EAAQ,SAAA,EAAW,EAAA,CAAG,sBAAA,EAAwB,gBAAgB,CAAA,EAC5D,QAAA,EAAA;AAAA,MAAA,OAAA;AAAA,sBACD,GAAA;AAAA,QAAC,KAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAW,IAAA;AAAA,UACX,OAAA,EAAQ,WAAA;AAAA,UACR,IAAA,EAAK,MAAA;AAAA,UACL,MAAA,EAAO,cAAA;AAAA,UACP,WAAA,EAAa,CAAA;AAAA,UACb,aAAA,EAAc,OAAA;AAAA,UACd,cAAA,EAAe,OAAA;AAAA,UACf,SAAA,EAAW,sBAAA;AAAA,UAEX,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAE,cAAA,EAAe;AAAA;AAAA;AACzB,KAAA,EACF,CAAA;AAAA,wBACC,KAAA,EAAA,EAAI,SAAA,EAAW,GAAG,sBAAA,EAAwB,gBAAgB,GAAI,QAAA,EAAS;AAAA,GAAA,EAC1E;AAEJ;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA","file":"chunk-V3YXRI7M.js","sourcesContent":["export const accordionStyles = 'group';\n\nexport const accordionSummaryStyles = [\n 'flex min-h-11 cursor-pointer list-none items-center justify-between gap-3 rounded-lg px-3',\n 'font-semibold text-[var(--text-primary)] transition-colors hover:bg-[var(--surface-secondary)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--border-focus)]',\n '[&::-webkit-details-marker]:hidden',\n].join(' ');\n\nexport const accordionChevronStyles =\n 'size-4 shrink-0 text-[var(--text-secondary)] transition-transform duration-150 group-open:rotate-180';\n\nexport const accordionContentStyles = 'mt-1 px-3';\n","import { cn } from '@utils';\nimport { forwardRef, type DetailsHTMLAttributes, type ReactNode } from 'react';\nimport {\n accordionChevronStyles,\n accordionContentStyles,\n accordionStyles,\n accordionSummaryStyles,\n} from './Accordion.styles';\n\nexport type AccordionProps = Omit<DetailsHTMLAttributes<HTMLDetailsElement>, 'title'> & {\n /** Always-visible header that toggles the content. */\n summary: ReactNode;\n /** Extra classes for the summary row (e.g. to match a navigation link). */\n summaryClassName?: string;\n /** Extra classes for the content wrapper. */\n contentClassName?: string;\n};\n\n/**\n * A collapsible section built on native `<details>`/`<summary>`: keyboard and screen reader support,\n * find-in-page and no JavaScript needed to toggle. Stack several for an accordion list; pass\n * `open` to start expanded (e.g. the section that contains the current page).\n */\nexport const Accordion = forwardRef<HTMLDetailsElement, AccordionProps>(\n ({ summary, summaryClassName, contentClassName, className, children, ...props }, ref) => (\n <details ref={ref} className={cn(accordionStyles, className)} {...props}>\n <summary className={cn(accordionSummaryStyles, summaryClassName)}>\n {summary}\n <svg\n aria-hidden\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={accordionChevronStyles}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </summary>\n <div className={cn(accordionContentStyles, contentClassName)}>{children}</div>\n </details>\n ),\n);\n\nAccordion.displayName = 'Accordion';\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { inputLabelStyles, inputErrorStyles, inputHintStyles } from './chunk-FFKHEBQ7.js';
|
|
2
|
+
import { RichText } from './chunk-P4CV2EPR.js';
|
|
3
|
+
import { cn } from './chunk-6LLGTBM6.js';
|
|
4
|
+
import { forwardRef, useId } from 'react';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var selectStyles = cva(
|
|
9
|
+
[
|
|
10
|
+
"flex w-full appearance-none rounded-md bg-no-repeat pr-10",
|
|
11
|
+
"text-[var(--input-text)] bg-[var(--input-bg)]",
|
|
12
|
+
"border border-[var(--input-border)]",
|
|
13
|
+
"transition-colors duration-150 ease-in-out",
|
|
14
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--border-focus)] focus-visible:ring-offset-0",
|
|
15
|
+
"focus-visible:border-[var(--input-border-focus)]",
|
|
16
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
state: {
|
|
21
|
+
default: "",
|
|
22
|
+
error: "border-[var(--input-border-error)] focus-visible:ring-[var(--border-error)]"
|
|
23
|
+
},
|
|
24
|
+
inputSize: {
|
|
25
|
+
sm: "h-8 px-2 text-xs",
|
|
26
|
+
md: "h-10 px-3 text-sm",
|
|
27
|
+
lg: "h-12 px-4 text-base"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
state: "default",
|
|
32
|
+
inputSize: "md"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
var selectChevronStyles = "pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-[var(--text-secondary)]";
|
|
37
|
+
var Select = forwardRef(
|
|
38
|
+
({ className, state, inputSize, label, hint, error, id: idProp, children, ...props }, ref) => {
|
|
39
|
+
const generatedId = useId();
|
|
40
|
+
const id = idProp ?? generatedId;
|
|
41
|
+
const resolvedState = error ? "error" : state;
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
43
|
+
label && /* @__PURE__ */ jsx("label", { htmlFor: id, children: /* @__PURE__ */ jsx(RichText, { as: "span", variant: "p3", className: inputLabelStyles, children: label }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
"select",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
id,
|
|
50
|
+
"aria-describedby": error ? `${id}-error` : hint ? `${id}-hint` : void 0,
|
|
51
|
+
"aria-invalid": error ? "true" : void 0,
|
|
52
|
+
className: cn(selectStyles({ state: resolvedState, inputSize }), className),
|
|
53
|
+
...props,
|
|
54
|
+
children
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
"svg",
|
|
59
|
+
{
|
|
60
|
+
"aria-hidden": true,
|
|
61
|
+
viewBox: "0 0 24 24",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeWidth: 2,
|
|
65
|
+
strokeLinecap: "round",
|
|
66
|
+
strokeLinejoin: "round",
|
|
67
|
+
className: selectChevronStyles,
|
|
68
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
error && /* @__PURE__ */ jsx(
|
|
73
|
+
RichText,
|
|
74
|
+
{
|
|
75
|
+
as: "p",
|
|
76
|
+
id: `${id}-error`,
|
|
77
|
+
role: "alert",
|
|
78
|
+
variant: "p4",
|
|
79
|
+
className: inputErrorStyles,
|
|
80
|
+
children: error
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
!error && hint && /* @__PURE__ */ jsx(RichText, { as: "p", id: `${id}-hint`, variant: "p4", className: inputHintStyles, children: hint })
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
Select.displayName = "Select";
|
|
88
|
+
|
|
89
|
+
export { Select };
|
|
90
|
+
//# sourceMappingURL=chunk-WUEVXL76.js.map
|
|
91
|
+
//# sourceMappingURL=chunk-WUEVXL76.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/atoms/Select/Select.styles.ts","../src/components/atoms/Select/Select.tsx"],"names":[],"mappings":"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","file":"chunk-WUEVXL76.js","sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const selectStyles = cva(\n [\n 'flex w-full appearance-none rounded-md bg-no-repeat pr-10',\n 'text-[var(--input-text)] bg-[var(--input-bg)]',\n 'border border-[var(--input-border)]',\n 'transition-colors duration-150 ease-in-out',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--border-focus)] focus-visible:ring-offset-0',\n 'focus-visible:border-[var(--input-border-focus)]',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n ],\n {\n variants: {\n state: {\n default: '',\n error: 'border-[var(--input-border-error)] focus-visible:ring-[var(--border-error)]',\n },\n inputSize: {\n sm: 'h-8 px-2 text-xs',\n md: 'h-10 px-3 text-sm',\n lg: 'h-12 px-4 text-base',\n },\n },\n defaultVariants: {\n state: 'default',\n inputSize: 'md',\n },\n },\n);\n\n/** Chevron drawn with `currentColor`, positioned over the right padding of the select. */\nexport const selectChevronStyles =\n 'pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-[var(--text-secondary)]';\n","import { RichText } from '@components';\nimport { cn } from '@utils';\nimport type { VariantProps } from 'class-variance-authority';\nimport { forwardRef, useId, type SelectHTMLAttributes } from 'react';\nimport {\n inputErrorStyles,\n inputHintStyles,\n inputLabelStyles,\n} from '@components/atoms/Input/Input.styles';\nimport { selectChevronStyles, selectStyles } from './Select.styles';\n\nexport type SelectProps = SelectHTMLAttributes<HTMLSelectElement> &\n VariantProps<typeof selectStyles> & {\n label?: string;\n hint?: string;\n error?: string;\n };\n\n/**\n * A native `<select>` with the same label / hint / error contract and look as `Input`. Native on\n * purpose: it gets the platform picker on mobile, typeahead and full screen reader support for free.\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n ({ className, state, inputSize, label, hint, error, id: idProp, children, ...props }, ref) => {\n const generatedId = useId();\n const id = idProp ?? generatedId;\n const resolvedState = error ? 'error' : state;\n\n return (\n <div className=\"flex flex-col gap-1.5\">\n {label && (\n <label htmlFor={id}>\n <RichText as=\"span\" variant=\"p3\" className={inputLabelStyles}>\n {label}\n </RichText>\n </label>\n )}\n <div className=\"relative\">\n <select\n ref={ref}\n id={id}\n aria-describedby={error ? `${id}-error` : hint ? `${id}-hint` : undefined}\n aria-invalid={error ? 'true' : undefined}\n className={cn(selectStyles({ state: resolvedState, inputSize }), className)}\n {...props}\n >\n {children}\n </select>\n <svg\n aria-hidden\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={selectChevronStyles}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </div>\n {error && (\n <RichText\n as=\"p\"\n id={`${id}-error`}\n role=\"alert\"\n variant=\"p4\"\n className={inputErrorStyles}\n >\n {error}\n </RichText>\n )}\n {!error && hint && (\n <RichText as=\"p\" id={`${id}-hint`} variant=\"p4\" className={inputHintStyles}>\n {hint}\n </RichText>\n )}\n </div>\n );\n },\n);\n\nSelect.displayName = 'Select';\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cn } from './chunk-6LLGTBM6.js';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var tableContainerStyles = "overflow-x-auto rounded-lg border border-[var(--border-default)] bg-[var(--surface-primary)]";
|
|
7
|
+
var tableStyles = "w-full min-w-80 text-left tabular-nums";
|
|
8
|
+
var tableCaptionStyles = cva("p-3 text-left text-sm text-[var(--text-secondary)]", {
|
|
9
|
+
variants: {
|
|
10
|
+
hidden: {
|
|
11
|
+
true: "sr-only",
|
|
12
|
+
false: ""
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
hidden: false
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var tableHeadStyles = "border-b border-[var(--border-default)] text-sm text-[var(--text-secondary)]";
|
|
20
|
+
var tableRowStyles = "border-b border-[var(--border-muted)] last:border-0";
|
|
21
|
+
var tableCellStyles = cva("p-3", {
|
|
22
|
+
variants: {
|
|
23
|
+
align: {
|
|
24
|
+
start: "text-left",
|
|
25
|
+
end: "text-right",
|
|
26
|
+
center: "text-center"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
align: "start"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var Table = forwardRef(
|
|
34
|
+
({ caption, captionHidden = false, containerClassName, className, children, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn(tableContainerStyles, containerClassName), children: /* @__PURE__ */ jsxs("table", { ref, className: cn(tableStyles, className), ...props, children: [
|
|
35
|
+
caption && /* @__PURE__ */ jsx("caption", { className: tableCaptionStyles({ hidden: captionHidden }), children: caption }),
|
|
36
|
+
children
|
|
37
|
+
] }) })
|
|
38
|
+
);
|
|
39
|
+
Table.displayName = "Table";
|
|
40
|
+
var TableHead = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn(tableHeadStyles, className), ...props }));
|
|
41
|
+
TableHead.displayName = "TableHead";
|
|
42
|
+
var TableBody = forwardRef((props, ref) => /* @__PURE__ */ jsx("tbody", { ref, ...props }));
|
|
43
|
+
TableBody.displayName = "TableBody";
|
|
44
|
+
var TableRow = forwardRef(
|
|
45
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: cn(tableRowStyles, className), ...props })
|
|
46
|
+
);
|
|
47
|
+
TableRow.displayName = "TableRow";
|
|
48
|
+
var TableHeaderCell = forwardRef(
|
|
49
|
+
({ align, scope = "col", className, ...props }, ref) => /* @__PURE__ */ jsx("th", { ref, scope, className: cn(tableCellStyles({ align }), className), ...props })
|
|
50
|
+
);
|
|
51
|
+
TableHeaderCell.displayName = "TableHeaderCell";
|
|
52
|
+
var TableCell = forwardRef(
|
|
53
|
+
({ align, className, ...props }, ref) => /* @__PURE__ */ jsx("td", { ref, className: cn(tableCellStyles({ align }), className), ...props })
|
|
54
|
+
);
|
|
55
|
+
TableCell.displayName = "TableCell";
|
|
56
|
+
|
|
57
|
+
export { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow };
|
|
58
|
+
//# sourceMappingURL=chunk-XCUA543I.js.map
|
|
59
|
+
//# sourceMappingURL=chunk-XCUA543I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/molecules/Table/Table.styles.ts","../src/components/molecules/Table/Table.tsx"],"names":[],"mappings":"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","file":"chunk-XCUA543I.js","sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const tableContainerStyles =\n 'overflow-x-auto rounded-lg border border-[var(--border-default)] bg-[var(--surface-primary)]';\n\nexport const tableStyles = 'w-full min-w-80 text-left tabular-nums';\n\nexport const tableCaptionStyles = cva('p-3 text-left text-sm text-[var(--text-secondary)]', {\n variants: {\n hidden: {\n true: 'sr-only',\n false: '',\n },\n },\n defaultVariants: {\n hidden: false,\n },\n});\n\nexport const tableHeadStyles =\n 'border-b border-[var(--border-default)] text-sm text-[var(--text-secondary)]';\n\nexport const tableRowStyles = 'border-b border-[var(--border-muted)] last:border-0';\n\nexport const tableCellStyles = cva('p-3', {\n variants: {\n align: {\n start: 'text-left',\n end: 'text-right',\n center: 'text-center',\n },\n },\n defaultVariants: {\n align: 'start',\n },\n});\n","import { cn } from '@utils';\nimport type { VariantProps } from 'class-variance-authority';\nimport {\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n type TableHTMLAttributes,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from 'react';\nimport {\n tableCaptionStyles,\n tableCellStyles,\n tableContainerStyles,\n tableHeadStyles,\n tableRowStyles,\n tableStyles,\n} from './Table.styles';\n\nexport type TableProps = TableHTMLAttributes<HTMLTableElement> & {\n /** Describes the table for everyone (or only for screen readers with `captionHidden`). */\n caption?: ReactNode;\n captionHidden?: boolean;\n /** Extra classes for the scroll container. */\n containerClassName?: string;\n};\n\n/**\n * A data table that scrolls horizontally inside its own bordered container on small screens,\n * instead of pushing the page wider. Compose it with the `Table*` parts below.\n */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(\n ({ caption, captionHidden = false, containerClassName, className, children, ...props }, ref) => (\n <div className={cn(tableContainerStyles, containerClassName)}>\n <table ref={ref} className={cn(tableStyles, className)} {...props}>\n {caption && (\n <caption className={tableCaptionStyles({ hidden: captionHidden })}>{caption}</caption>\n )}\n {children}\n </table>\n </div>\n ),\n);\nTable.displayName = 'Table';\n\nexport const TableHead = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(tableHeadStyles, className)} {...props} />\n));\nTableHead.displayName = 'TableHead';\n\nexport const TableBody = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>((props, ref) => <tbody ref={ref} {...props} />);\nTableBody.displayName = 'TableBody';\n\nexport const TableRow = forwardRef<HTMLTableRowElement, HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr ref={ref} className={cn(tableRowStyles, className)} {...props} />\n ),\n);\nTableRow.displayName = 'TableRow';\n\ntype CellAlign = VariantProps<typeof tableCellStyles>;\n\n// The native (deprecated) `align` attribute is replaced by the `align` variant.\nexport type TableHeaderCellProps = Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> &\n CellAlign;\n\n/** Header cell: `scope=\"col\"` by default; pass `scope=\"row\"` for the first cell of a body row. */\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n ({ align, scope = 'col', className, ...props }, ref) => (\n <th ref={ref} scope={scope} className={cn(tableCellStyles({ align }), className)} {...props} />\n ),\n);\nTableHeaderCell.displayName = 'TableHeaderCell';\n\nexport type TableCellProps = Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> & CellAlign;\n\n/** Data cell; use `align=\"end\"` for numbers so they line up. */\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ align, className, ...props }, ref) => (\n <td ref={ref} className={cn(tableCellStyles({ align }), className)} {...props} />\n ),\n);\nTableCell.displayName = 'TableCell';\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import '../../../chunk-GQMA2AQI.js';
|
|
2
|
+
export { Button, buttonStyles } from '../../../chunk-KL6I2JFC.js';
|
|
2
3
|
import '../../../chunk-P4Z7HH66.js';
|
|
3
4
|
import '../../../chunk-6LLGTBM6.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { SelectHTMLAttributes } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const selectStyles: (props?: ({
|
|
7
|
+
state?: "error" | "default" | null | undefined;
|
|
8
|
+
inputSize?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
|
|
11
|
+
type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & VariantProps<typeof selectStyles> & {
|
|
12
|
+
label?: string;
|
|
13
|
+
hint?: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A native `<select>` with the same label / hint / error contract and look as `Input`. Native on
|
|
18
|
+
* purpose: it gets the platform picker on mobile, typeahead and full screen reader support for free.
|
|
19
|
+
*/
|
|
20
|
+
declare const Select: react.ForwardRefExoticComponent<SelectHTMLAttributes<HTMLSelectElement> & VariantProps<(props?: ({
|
|
21
|
+
state?: "error" | "default" | null | undefined;
|
|
22
|
+
inputSize?: "sm" | "md" | "lg" | null | undefined;
|
|
23
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
24
|
+
label?: string;
|
|
25
|
+
hint?: string;
|
|
26
|
+
error?: string;
|
|
27
|
+
} & react.RefAttributes<HTMLSelectElement>>;
|
|
28
|
+
|
|
29
|
+
export { Select, type SelectProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const textareaStyles: (props?: ({
|
|
7
|
+
state?: "error" | "default" | null | undefined;
|
|
8
|
+
inputSize?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
resize?: "none" | "vertical" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
|
|
12
|
+
type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement> & VariantProps<typeof textareaStyles> & {
|
|
13
|
+
label?: string;
|
|
14
|
+
hint?: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Multi-line text entry with the same label / hint / error contract and look as `Input`. */
|
|
18
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaHTMLAttributes<HTMLTextAreaElement> & VariantProps<(props?: ({
|
|
19
|
+
state?: "error" | "default" | null | undefined;
|
|
20
|
+
inputSize?: "sm" | "md" | "lg" | null | undefined;
|
|
21
|
+
resize?: "none" | "vertical" | null | undefined;
|
|
22
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string> & {
|
|
23
|
+
label?: string;
|
|
24
|
+
hint?: string;
|
|
25
|
+
error?: string;
|
|
26
|
+
} & react.RefAttributes<HTMLTextAreaElement>>;
|
|
27
|
+
|
|
28
|
+
export { Textarea, type TextareaProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { DetailsHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type AccordionProps = Omit<DetailsHTMLAttributes<HTMLDetailsElement>, 'title'> & {
|
|
5
|
+
/** Always-visible header that toggles the content. */
|
|
6
|
+
summary: ReactNode;
|
|
7
|
+
/** Extra classes for the summary row (e.g. to match a navigation link). */
|
|
8
|
+
summaryClassName?: string;
|
|
9
|
+
/** Extra classes for the content wrapper. */
|
|
10
|
+
contentClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A collapsible section built on native `<details>`/`<summary>`: keyboard and screen reader support,
|
|
14
|
+
* find-in-page and no JavaScript needed to toggle. Stack several for an accordion list; pass
|
|
15
|
+
* `open` to start expanded (e.g. the section that contains the current page).
|
|
16
|
+
*/
|
|
17
|
+
declare const Accordion: react.ForwardRefExoticComponent<Omit<DetailsHTMLAttributes<HTMLDetailsElement>, "title"> & {
|
|
18
|
+
/** Always-visible header that toggles the content. */
|
|
19
|
+
summary: ReactNode;
|
|
20
|
+
/** Extra classes for the summary row (e.g. to match a navigation link). */
|
|
21
|
+
summaryClassName?: string;
|
|
22
|
+
/** Extra classes for the content wrapper. */
|
|
23
|
+
contentClassName?: string;
|
|
24
|
+
} & react.RefAttributes<HTMLDetailsElement>>;
|
|
25
|
+
|
|
26
|
+
export { Accordion, type AccordionProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { BottomSheet } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { BottomSheet } from '../../../chunk-PF5PSCG4.js';
|
|
2
|
+
import '../../../chunk-53YMHM24.js';
|
|
3
3
|
import '../../../chunk-BNEEI7S5.js';
|
|
4
|
+
import '../../../chunk-JCJP427C.js';
|
|
5
|
+
import '../../../chunk-QT62VC36.js';
|
|
4
6
|
import '../../../chunk-P4Z7HH66.js';
|
|
5
7
|
import '../../../chunk-P4CV2EPR.js';
|
|
6
8
|
import '../../../chunk-6LLGTBM6.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const drawerPanelStyles: (props?: ({
|
|
7
|
+
side?: "left" | "right" | null | undefined;
|
|
8
|
+
visible?: boolean | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
|
|
11
|
+
type DrawerProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & Pick<VariantProps<typeof drawerPanelStyles>, 'side'> & {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
/** Extra classes for the title (e.g. a display font). */
|
|
16
|
+
titleClassName?: string;
|
|
17
|
+
/** Accessible name of the close button; the button is only rendered when this is set. */
|
|
18
|
+
closeLabel?: string;
|
|
19
|
+
/** Pinned to the bottom of the panel (preferences, actions). */
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
closeOnBackdropClick?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A side panel (navigation menus, filters, settings) that slides in from the left or right.
|
|
25
|
+
* Modal dialog semantics: focus moves inside and is trapped, Escape and backdrop clicks close it,
|
|
26
|
+
* the page behind doesn't scroll, and focus returns to the trigger when it closes.
|
|
27
|
+
*/
|
|
28
|
+
declare const Drawer: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & Pick<VariantProps<(props?: ({
|
|
29
|
+
side?: "left" | "right" | null | undefined;
|
|
30
|
+
visible?: boolean | null | undefined;
|
|
31
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string>, "side"> & {
|
|
32
|
+
open: boolean;
|
|
33
|
+
onClose: () => void;
|
|
34
|
+
title?: ReactNode;
|
|
35
|
+
/** Extra classes for the title (e.g. a display font). */
|
|
36
|
+
titleClassName?: string;
|
|
37
|
+
/** Accessible name of the close button; the button is only rendered when this is set. */
|
|
38
|
+
closeLabel?: string;
|
|
39
|
+
/** Pinned to the bottom of the panel (preferences, actions). */
|
|
40
|
+
footer?: ReactNode;
|
|
41
|
+
closeOnBackdropClick?: boolean;
|
|
42
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
|
|
44
|
+
export { Drawer, type DrawerProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Drawer } from '../../../chunk-NKNSSH2Q.js';
|
|
2
|
+
import '../../../chunk-53YMHM24.js';
|
|
3
|
+
import '../../../chunk-BNEEI7S5.js';
|
|
4
|
+
import '../../../chunk-JCJP427C.js';
|
|
5
|
+
import '../../../chunk-QT62VC36.js';
|
|
6
|
+
import '../../../chunk-KL6I2JFC.js';
|
|
7
|
+
import '../../../chunk-P4Z7HH66.js';
|
|
8
|
+
import '../../../chunk-P4CV2EPR.js';
|
|
9
|
+
import '../../../chunk-6LLGTBM6.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { Modal } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
1
|
+
export { Modal } from '../../../chunk-SMKLV4ET.js';
|
|
2
|
+
import '../../../chunk-53YMHM24.js';
|
|
3
3
|
import '../../../chunk-BNEEI7S5.js';
|
|
4
|
+
import '../../../chunk-JCJP427C.js';
|
|
5
|
+
import '../../../chunk-QT62VC36.js';
|
|
4
6
|
import '../../../chunk-P4Z7HH66.js';
|
|
5
7
|
import '../../../chunk-P4CV2EPR.js';
|
|
6
8
|
import '../../../chunk-6LLGTBM6.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { TableHTMLAttributes, ReactNode, HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
|
|
6
|
+
declare const tableCellStyles: (props?: ({
|
|
7
|
+
align?: "center" | "end" | "start" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
|
|
10
|
+
type TableProps = TableHTMLAttributes<HTMLTableElement> & {
|
|
11
|
+
/** Describes the table for everyone (or only for screen readers with `captionHidden`). */
|
|
12
|
+
caption?: ReactNode;
|
|
13
|
+
captionHidden?: boolean;
|
|
14
|
+
/** Extra classes for the scroll container. */
|
|
15
|
+
containerClassName?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A data table that scrolls horizontally inside its own bordered container on small screens,
|
|
19
|
+
* instead of pushing the page wider. Compose it with the `Table*` parts below.
|
|
20
|
+
*/
|
|
21
|
+
declare const Table: react.ForwardRefExoticComponent<TableHTMLAttributes<HTMLTableElement> & {
|
|
22
|
+
/** Describes the table for everyone (or only for screen readers with `captionHidden`). */
|
|
23
|
+
caption?: ReactNode;
|
|
24
|
+
captionHidden?: boolean;
|
|
25
|
+
/** Extra classes for the scroll container. */
|
|
26
|
+
containerClassName?: string;
|
|
27
|
+
} & react.RefAttributes<HTMLTableElement>>;
|
|
28
|
+
declare const TableHead: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
29
|
+
declare const TableBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & react.RefAttributes<HTMLTableSectionElement>>;
|
|
30
|
+
declare const TableRow: react.ForwardRefExoticComponent<HTMLAttributes<HTMLTableRowElement> & react.RefAttributes<HTMLTableRowElement>>;
|
|
31
|
+
type CellAlign = VariantProps<typeof tableCellStyles>;
|
|
32
|
+
type TableHeaderCellProps = Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> & CellAlign;
|
|
33
|
+
/** Header cell: `scope="col"` by default; pass `scope="row"` for the first cell of a body row. */
|
|
34
|
+
declare const TableHeaderCell: react.ForwardRefExoticComponent<Omit<ThHTMLAttributes<HTMLTableCellElement>, "align"> & CellAlign & react.RefAttributes<HTMLTableCellElement>>;
|
|
35
|
+
type TableCellProps = Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> & CellAlign;
|
|
36
|
+
/** Data cell; use `align="end"` for numbers so they line up. */
|
|
37
|
+
declare const TableCell: react.ForwardRefExoticComponent<Omit<TdHTMLAttributes<HTMLTableCellElement>, "align"> & CellAlign & react.RefAttributes<HTMLTableCellElement>>;
|
|
38
|
+
|
|
39
|
+
export { Table, TableBody, TableCell, type TableCellProps, TableHead, TableHeaderCell, type TableHeaderCellProps, type TableProps, TableRow };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* While `active`, keeps Tab / Shift+Tab inside `containerRef`, moves focus into it, and returns
|
|
5
|
+
* focus to the previously focused element when it deactivates (WCAG dialog pattern).
|
|
6
|
+
*/
|
|
7
|
+
declare const useFocusTrap: (active: boolean, containerRef: RefObject<HTMLElement | null>) => void;
|
|
8
|
+
|
|
9
|
+
export { useFocusTrap };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|