@inzumer/ui-library 1.0.2 → 1.2.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.
Files changed (58) hide show
  1. package/dist/{chunk-HCLY7B4H.js → chunk-2YBZCUME.js} +39 -6
  2. package/dist/chunk-2YBZCUME.js.map +1 -0
  3. package/dist/{chunk-PVDRNAYK.js → chunk-3YRDRHO3.js} +33 -22
  4. package/dist/chunk-3YRDRHO3.js.map +1 -0
  5. package/dist/chunk-53YMHM24.js +20 -0
  6. package/dist/chunk-53YMHM24.js.map +1 -0
  7. package/dist/{chunk-LK2EJ4H6.js → chunk-A26UWAU4.js} +12 -6
  8. package/dist/chunk-A26UWAU4.js.map +1 -0
  9. package/dist/chunk-CX3GARWU.js +142 -0
  10. package/dist/chunk-CX3GARWU.js.map +1 -0
  11. package/dist/chunk-DP274HDM.js +34 -0
  12. package/dist/chunk-DP274HDM.js.map +1 -0
  13. package/dist/chunk-FFKHEBQ7.js +41 -0
  14. package/dist/chunk-FFKHEBQ7.js.map +1 -0
  15. package/dist/chunk-GQMA2AQI.js +3 -0
  16. package/dist/chunk-GQMA2AQI.js.map +1 -0
  17. package/dist/{chunk-KWSZ2S34.js → chunk-KL6I2JFC.js} +44 -13
  18. package/dist/chunk-KL6I2JFC.js.map +1 -0
  19. package/dist/chunk-QT62VC36.js +50 -0
  20. package/dist/chunk-QT62VC36.js.map +1 -0
  21. package/dist/{chunk-K35XIA25.js → chunk-RRIE5LFQ.js} +12 -6
  22. package/dist/chunk-RRIE5LFQ.js.map +1 -0
  23. package/dist/chunk-WUEVXL76.js +91 -0
  24. package/dist/chunk-WUEVXL76.js.map +1 -0
  25. package/dist/components/atoms/Button/index.d.ts +9 -1
  26. package/dist/components/atoms/Button/index.js +3 -1
  27. package/dist/components/atoms/Image/index.d.ts +2 -2
  28. package/dist/components/atoms/Input/index.d.ts +2 -2
  29. package/dist/components/atoms/Input/index.js +2 -1
  30. package/dist/components/atoms/RichText/index.d.ts +2 -2
  31. package/dist/components/atoms/Select/index.d.ts +29 -0
  32. package/dist/components/atoms/Select/index.js +6 -0
  33. package/dist/components/atoms/Select/index.js.map +1 -0
  34. package/dist/components/atoms/Switch/index.d.ts +1 -1
  35. package/dist/components/atoms/Textarea/index.d.ts +28 -0
  36. package/dist/components/atoms/Textarea/index.js +6 -0
  37. package/dist/components/atoms/Textarea/index.js.map +1 -0
  38. package/dist/components/molecules/BottomSheet/index.js +4 -2
  39. package/dist/components/molecules/Drawer/index.d.ts +44 -0
  40. package/dist/components/molecules/Drawer/index.js +11 -0
  41. package/dist/components/molecules/Drawer/index.js.map +1 -0
  42. package/dist/components/molecules/Language/index.d.ts +5 -0
  43. package/dist/components/molecules/Language/index.js +1 -1
  44. package/dist/components/molecules/Modal/index.js +4 -2
  45. package/dist/hooks/useFocusTrap/index.d.ts +9 -0
  46. package/dist/hooks/useFocusTrap/index.js +3 -0
  47. package/dist/hooks/useFocusTrap/index.js.map +1 -0
  48. package/dist/hooks/useScrollLock/index.d.ts +4 -0
  49. package/dist/hooks/useScrollLock/index.js +3 -0
  50. package/dist/hooks/useScrollLock/index.js.map +1 -0
  51. package/dist/index.d.ts +6 -1
  52. package/dist/index.js +16 -9
  53. package/package.json +23 -3
  54. package/dist/chunk-HCLY7B4H.js.map +0 -1
  55. package/dist/chunk-K35XIA25.js.map +0 -1
  56. package/dist/chunk-KWSZ2S34.js.map +0 -1
  57. package/dist/chunk-LK2EJ4H6.js.map +0 -1
  58. package/dist/chunk-PVDRNAYK.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/atoms/Button/Button.styles.ts","../src/components/atoms/Button/Slot.tsx","../src/components/atoms/Button/Button.tsx"],"names":["forwardRef"],"mappings":";;;;;;AAEO,IAAM,YAAA,GAAe,GAAA;AAAA,EAC1B;AAAA,IACE,+CAAA;AAAA,IACA,kCAAA;AAAA,IACA,YAAA;AAAA,IACA,4CAAA;AAAA,IACA,sHAAA;AAAA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GAAc,MAAA;AC9CZ,IAAM,MAAA,GAASA,UAAAA;AAAA,EACpB,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,IAAA,EAAM,SAAA,EAAW,OAAA,GAAU,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AAC3E,IAAA,MAAM,OAAA,GAAU,GAAG,YAAA,CAAa,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAA,EAAG,SAAS,CAAA;AAExE,IAAA,IAAI,OAAA,EAAS;AAEX,MAAA,MAAM,OAAA,GAAU,GAAA;AAChB,MAAA,2BAAQ,IAAA,EAAA,EAAK,GAAA,EAAK,SAAS,SAAA,EAAW,OAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAAA,IAC5D;AAEA,IAAA,2BAAQ,QAAA,EAAA,EAAO,GAAA,EAAU,SAAA,EAAW,OAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAAA,EAC1D;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"chunk-KL6I2JFC.js","sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const buttonStyles = cva(\n [\n 'inline-flex items-center justify-center gap-2',\n 'font-medium text-sm leading-none',\n 'rounded-md',\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-2',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'select-none',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'bg-[var(--btn-primary-bg)] text-[var(--btn-primary-text)]',\n 'border border-[var(--btn-primary-border)]',\n 'hover:bg-[var(--btn-primary-bg-hover)]',\n 'active:bg-[var(--btn-primary-bg-active)]',\n ],\n secondary: [\n 'bg-[var(--btn-secondary-bg)] text-[var(--btn-secondary-text)]',\n 'border border-[var(--btn-secondary-border)]',\n 'hover:bg-[var(--btn-secondary-bg-hover)]',\n 'active:bg-[var(--btn-secondary-bg-active)]',\n ],\n ghost: [\n 'bg-[var(--btn-ghost-bg)] text-[var(--btn-ghost-text)]',\n 'border border-[var(--btn-ghost-border)]',\n 'hover:bg-[var(--btn-ghost-bg-hover)]',\n 'active:bg-[var(--btn-ghost-bg-active)]',\n ],\n destructive: [\n 'bg-[var(--btn-destructive-bg)] text-[var(--btn-destructive-text)]',\n 'border border-[var(--btn-destructive-border)]',\n 'hover:bg-[var(--btn-destructive-bg-hover)]',\n 'active:bg-[var(--btn-destructive-bg-active)]',\n ],\n },\n size: {\n sm: 'h-8 px-3 text-xs',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n icon: 'h-10 w-10',\n },\n fullWidth: {\n true: 'w-full',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n);\n","import { useMergedRef } from '@hooks';\nimport { cn } from '@utils';\nimport {\n Children,\n cloneElement,\n forwardRef,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\n\ntype AnyProps = Record<string, unknown>;\n\nexport type SlotProps = HTMLAttributes<HTMLElement> & { children?: ReactNode };\n\nconst isHandler = (key: string, value: unknown): value is (...args: unknown[]) => void =>\n /^on[A-Z]/.test(key) && typeof value === 'function';\n\n/** Slot props first, child props override — except handlers (both run) and className/style (merged). */\nconst mergeProps = (slotProps: AnyProps, childProps: AnyProps): AnyProps => {\n const merged: AnyProps = { ...slotProps, ...childProps };\n for (const [key, slotValue] of Object.entries(slotProps)) {\n const childValue = childProps[key];\n if (isHandler(key, slotValue) && isHandler(key, childValue)) {\n merged[key] = (...args: unknown[]) => {\n childValue(...args);\n slotValue(...args);\n };\n }\n }\n merged['className'] = cn(slotProps['className'] as string, childProps['className'] as string);\n merged['style'] = {\n ...(slotProps['style'] as CSSProperties),\n ...(childProps['style'] as CSSProperties),\n };\n return merged;\n};\n\n/**\n * Renders its single child element instead of its own DOM node, merging its props into it\n * (Radix-style `asChild`). Used by `Button` so a link can look like a button and stay an `<a>`.\n */\nexport const Slot = forwardRef<HTMLElement, SlotProps>(\n ({ children, ...slotProps }, forwardedRef) => {\n // Text or several children can't receive props: render nothing rather than throwing.\n const child = Children.count(children) === 1 ? Children.toArray(children)[0] : null;\n const childProps = isValidElement<AnyProps>(child) ? child.props : {};\n // React 19 exposes `ref` as a prop; React 18 keeps it on the element.\n const childRef = (childProps['ref'] ??\n (child as unknown as { ref?: Ref<HTMLElement> } | null)?.ref) as Ref<HTMLElement> | undefined;\n const ref = useMergedRef(forwardedRef, childRef);\n\n if (!isValidElement<AnyProps>(child)) {\n return null;\n }\n return cloneElement(child, { ...mergeProps(slotProps as AnyProps, childProps), ref });\n },\n);\n\nSlot.displayName = 'Slot';\n","import { cn } from '@utils';\nimport type { VariantProps } from 'class-variance-authority';\nimport { forwardRef, type ButtonHTMLAttributes, type Ref } from 'react';\nimport { buttonStyles } from './Button.styles';\nimport { Slot } from './Slot';\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonStyles> & {\n /**\n * Render the single child element (e.g. an `<a>`) with the button styles and props instead of\n * a `<button>`. Use it for navigation that must look like a button.\n */\n asChild?: boolean;\n };\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, fullWidth, asChild = false, ...props }, ref) => {\n const classes = cn(buttonStyles({ variant, size, fullWidth }), className);\n\n if (asChild) {\n // The ref points at whatever element the child renders (usually an <a>), not a <button>.\n const slotRef = ref as unknown as Ref<HTMLElement>;\n return <Slot ref={slotRef} className={classes} {...props} />;\n }\n\n return <button ref={ref} className={classes} {...props} />;\n },\n);\n\nButton.displayName = 'Button';\n"]}
@@ -0,0 +1,50 @@
1
+ import { useEffect } from 'react';
2
+
3
+ // src/hooks/useFocusTrap/useFocusTrap.ts
4
+ var FOCUSABLE = [
5
+ "a[href]",
6
+ "button:not([disabled])",
7
+ "input:not([disabled])",
8
+ "select:not([disabled])",
9
+ "textarea:not([disabled])",
10
+ '[tabindex]:not([tabindex="-1"])'
11
+ ].join(",");
12
+ var getFocusable = (container) => Array.from(container.querySelectorAll(FOCUSABLE));
13
+ var useFocusTrap = (active, containerRef) => {
14
+ useEffect(() => {
15
+ const container = containerRef.current;
16
+ if (!active || !container) {
17
+ return;
18
+ }
19
+ const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
20
+ (getFocusable(container)[0] ?? container).focus();
21
+ const handleKeyDown = (event) => {
22
+ if (event.key !== "Tab") {
23
+ return;
24
+ }
25
+ const focusable = getFocusable(container);
26
+ const first = focusable[0];
27
+ const last = focusable.at(-1);
28
+ if (!first || !last) {
29
+ event.preventDefault();
30
+ return;
31
+ }
32
+ if (event.shiftKey && document.activeElement === first) {
33
+ event.preventDefault();
34
+ last.focus();
35
+ } else if (!event.shiftKey && document.activeElement === last) {
36
+ event.preventDefault();
37
+ first.focus();
38
+ }
39
+ };
40
+ container.addEventListener("keydown", handleKeyDown);
41
+ return () => {
42
+ container.removeEventListener("keydown", handleKeyDown);
43
+ previouslyFocused?.focus();
44
+ };
45
+ }, [active, containerRef]);
46
+ };
47
+
48
+ export { useFocusTrap };
49
+ //# sourceMappingURL=chunk-QT62VC36.js.map
50
+ //# sourceMappingURL=chunk-QT62VC36.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useFocusTrap/useFocusTrap.ts"],"names":[],"mappings":";;;AAEA,IAAM,SAAA,GAAY;AAAA,EAChB,SAAA;AAAA,EACA,wBAAA;AAAA,EACA,uBAAA;AAAA,EACA,wBAAA;AAAA,EACA,0BAAA;AAAA,EACA;AACF,CAAA,CAAE,KAAK,GAAG,CAAA;AAEV,IAAM,YAAA,GAAe,CAAC,SAAA,KACpB,KAAA,CAAM,KAAK,SAAA,CAAU,gBAAA,CAA8B,SAAS,CAAC,CAAA;AAMxD,IAAM,YAAA,GAAe,CAC1B,MAAA,EACA,YAAA,KACS;AACT,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,YAAY,YAAA,CAAa,OAAA;AAC/B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AAC3B","file":"chunk-QT62VC36.js","sourcesContent":["import { useEffect, type RefObject } from 'react';\n\nconst FOCUSABLE = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nconst getFocusable = (container: HTMLElement): HTMLElement[] =>\n Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE));\n\n/**\n * While `active`, keeps Tab / Shift+Tab inside `containerRef`, moves focus into it, and returns\n * focus to the previously focused element when it deactivates (WCAG dialog pattern).\n */\nexport const useFocusTrap = (\n active: boolean,\n containerRef: RefObject<HTMLElement | null>,\n): void => {\n useEffect(() => {\n const container = containerRef.current;\n if (!active || !container) {\n return;\n }\n\n const previouslyFocused =\n document.activeElement instanceof HTMLElement ? document.activeElement : null;\n (getFocusable(container)[0] ?? container).focus();\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Tab') {\n return;\n }\n const focusable = getFocusable(container);\n const first = focusable[0];\n const last = focusable.at(-1);\n if (!first || !last) {\n event.preventDefault();\n return;\n }\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n container.addEventListener('keydown', handleKeyDown);\n return () => {\n container.removeEventListener('keydown', handleKeyDown);\n previouslyFocused?.focus();\n };\n }, [active, containerRef]);\n};\n"]}
@@ -1,9 +1,11 @@
1
+ import { useDelayedUnmount } from './chunk-BNEEI7S5.js';
1
2
  import { useDismissableLayer } from './chunk-JCJP427C.js';
3
+ import { useFocusTrap } from './chunk-QT62VC36.js';
4
+ import { useScrollLock } from './chunk-53YMHM24.js';
2
5
  import { useMergedRef } from './chunk-P4Z7HH66.js';
3
- import { useDelayedUnmount } from './chunk-BNEEI7S5.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
 
@@ -50,8 +52,11 @@ var BottomSheet = forwardRef(
50
52
  ({ open, onClose, title, footer, closeOnBackdropClick = true, className, children, ...props }, ref) => {
51
53
  const panelRef = useRef(null);
52
54
  const setPanelRef = useMergedRef(ref, panelRef);
55
+ const titleId = useId();
53
56
  const { mounted, visible } = useDelayedUnmount(open, EXIT_DURATION_MS);
54
57
  useDismissableLayer(open, onClose, panelRef, closeOnBackdropClick);
58
+ useFocusTrap(open && mounted, panelRef);
59
+ useScrollLock(open);
55
60
  if (!mounted) {
56
61
  return null;
57
62
  }
@@ -61,12 +66,13 @@ var BottomSheet = forwardRef(
61
66
  ref: setPanelRef,
62
67
  role: "dialog",
63
68
  "aria-modal": "true",
64
- "aria-labelledby": title ? "bottom-sheet-title" : void 0,
69
+ "aria-labelledby": title ? titleId : void 0,
70
+ tabIndex: -1,
65
71
  className: cn(bottomSheetPanelStyles({ visible }), className),
66
72
  ...props,
67
73
  children: [
68
74
  /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: bottomSheetHandleStyles }),
69
- title && /* @__PURE__ */ jsx(RichText, { as: "h2", id: "bottom-sheet-title", variant: "s1", className: bottomSheetTitleStyles, children: title }),
75
+ title && /* @__PURE__ */ jsx(RichText, { as: "h2", id: titleId, variant: "s1", className: bottomSheetTitleStyles, children: title }),
70
76
  children,
71
77
  footer && /* @__PURE__ */ jsx("div", { className: bottomSheetFooterStyles, children: footer })
72
78
  ]
@@ -77,5 +83,5 @@ var BottomSheet = forwardRef(
77
83
  BottomSheet.displayName = "BottomSheet";
78
84
 
79
85
  export { BottomSheet };
80
- //# sourceMappingURL=chunk-K35XIA25.js.map
81
- //# sourceMappingURL=chunk-K35XIA25.js.map
86
+ //# sourceMappingURL=chunk-RRIE5LFQ.js.map
87
+ //# sourceMappingURL=chunk-RRIE5LFQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/molecules/BottomSheet/BottomSheet.styles.ts","../src/components/molecules/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;;;;;;AAEO,IAAM,wBAAA,GAA2B,GAAA;AAAA,EACtC;AAAA,IACE,8EAAA;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,sBAAA,GAAyB,GAAA;AAAA,EACpC;AAAA,IACE,+EAAA;AAAA,IACA,6CAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,eAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEO,IAAM,uBAAA,GACX,gEAAA;AAEK,IAAM,sBAAA,GAAyB,uDAAA;AAE/B,IAAM,uBAAA,GAA0B,0CAAA;AC1BvC,IAAM,gBAAA,GAAmB,GAAA;AAUlB,IAAM,WAAA,GAAc,UAAA;AAAA,EACzB,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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esContent":["import { cva } from 'class-variance-authority';\n\nexport const bottomSheetOverlayStyles = cva(\n [\n 'fixed inset-0 z-50 flex items-end justify-center bg-[var(--surface-overlay)]',\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 bottomSheetPanelStyles = cva(\n [\n 'w-full max-w-md rounded-t-xl border border-b-0 border-[var(--border-default)]',\n 'bg-[var(--surface-secondary)] p-6 shadow-lg',\n 'transition-transform duration-200 ease-out',\n ],\n {\n variants: {\n visible: {\n true: 'translate-y-0',\n false: 'translate-y-full',\n },\n },\n defaultVariants: {\n visible: false,\n },\n },\n);\n\nexport const bottomSheetHandleStyles =\n 'mx-auto mb-4 h-1.5 w-10 rounded-full bg-[var(--border-strong)]';\n\nexport const bottomSheetTitleStyles = 'mb-4 text-lg font-semibold text-[var(--text-primary)]';\n\nexport const bottomSheetFooterStyles = '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 bottomSheetFooterStyles,\n bottomSheetHandleStyles,\n bottomSheetOverlayStyles,\n bottomSheetPanelStyles,\n bottomSheetTitleStyles,\n} from './BottomSheet.styles';\n\nconst EXIT_DURATION_MS = 200;\n\nexport type BottomSheetProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & {\n open: boolean;\n onClose: () => void;\n title?: ReactNode;\n footer?: ReactNode;\n closeOnBackdropClick?: boolean;\n};\n\nexport const BottomSheet = forwardRef<HTMLDivElement, BottomSheetProps>(\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={bottomSheetOverlayStyles({ 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(bottomSheetPanelStyles({ visible }), className)}\n {...props}\n >\n <div aria-hidden className={bottomSheetHandleStyles} />\n {title && (\n <RichText as=\"h2\" id={titleId} variant=\"s1\" className={bottomSheetTitleStyles}>\n {title}\n </RichText>\n )}\n {children}\n {footer && <div className={bottomSheetFooterStyles}>{footer}</div>}\n </div>\n </div>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\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":";;;;;;;AAEO,IAAM,YAAA,GAAe,GAAA;AAAA,EAC1B;AAAA,IACE,2DAAA;AAAA,IACA,+CAAA;AAAA,IACA,qCAAA;AAAA,IACA,4CAAA;AAAA,IACA,sHAAA;AAAA,IACA,kDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,EAAA;AAAA,QACT,KAAA,EAAO;AAAA,OACT;AAAA,MACA,SAAA,EAAW;AAAA,QACT,EAAA,EAAI,kBAAA;AAAA,QACJ,EAAA,EAAI,mBAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,KAAA,EAAO,SAAA;AAAA,MACP,SAAA,EAAW;AAAA;AACb;AAEJ,CAAA;AAGO,IAAM,mBAAA,GACX,mGAAA;ACXK,IAAM,MAAA,GAAS,UAAA;AAAA,EACpB,CAAC,EAAE,SAAA,EAAW,KAAA,EAAO,WAAW,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,EAAA,EAAI,MAAA,EAAQ,QAAA,EAAU,GAAG,KAAA,IAAS,GAAA,KAAQ;AAC5F,IAAA,MAAM,cAAc,KAAA,EAAM;AAC1B,IAAA,MAAM,KAAK,MAAA,IAAU,WAAA;AACrB,IAAA,MAAM,aAAA,GAAgB,QAAQ,OAAA,GAAU,KAAA;AAExC,IAAA,uBACE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uBAAA,EACZ,QAAA,EAA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A,CAAA;AAAA,UACT,IAAA,EAAK,OAAA;AAAA,UACL,OAAA,EAAQ,IAAA;AAAA,UACR,SAAA,EAAW,gBAAA;AAAA,UAEV,QAAA,EAAA;AAAA;AAAA,OACH;AAAA,MAED,CAAC,KAAA,IAAS,IAAA,oBACT,GAAA,CAAC,YAAS,EAAA,EAAG,GAAA,EAAI,EAAA,EAAI,CAAA,EAAG,EAAE,CAAA,KAAA,CAAA,EAAS,OAAA,EAAQ,IAAA,EAAK,SAAA,EAAW,iBACxD,QAAA,EAAA,IAAA,EACH;AAAA,KAAA,EAEJ,CAAA;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","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"]}
@@ -10,6 +10,10 @@ declare const buttonStyles: (props?: ({
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
 
12
12
  type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonStyles> & {
13
+ /**
14
+ * Render the single child element (e.g. an `<a>`) with the button styles and props instead of
15
+ * a `<button>`. Use it for navigation that must look like a button.
16
+ */
13
17
  asChild?: boolean;
14
18
  };
15
19
  declare const Button: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
@@ -17,7 +21,11 @@ declare const Button: react.ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLB
17
21
  size?: "sm" | "md" | "lg" | "icon" | null | undefined;
18
22
  fullWidth?: boolean | null | undefined;
19
23
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
24
+ /**
25
+ * Render the single child element (e.g. an `<a>`) with the button styles and props instead of
26
+ * a `<button>`. Use it for navigation that must look like a button.
27
+ */
20
28
  asChild?: boolean;
21
29
  } & react.RefAttributes<HTMLButtonElement>>;
22
30
 
23
- export { Button, type ButtonProps };
31
+ export { Button, type ButtonProps, buttonStyles };
@@ -1,4 +1,6 @@
1
- export { Button } from '../../../chunk-KWSZ2S34.js';
1
+ import '../../../chunk-GQMA2AQI.js';
2
+ export { Button, buttonStyles } from '../../../chunk-KL6I2JFC.js';
3
+ import '../../../chunk-P4Z7HH66.js';
2
4
  import '../../../chunk-6LLGTBM6.js';
3
5
  //# sourceMappingURL=index.js.map
4
6
  //# sourceMappingURL=index.js.map
@@ -4,7 +4,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const imageStyles: (props?: ({
7
- fit?: "fill" | "cover" | "contain" | null | undefined;
7
+ fit?: "contain" | "cover" | "fill" | null | undefined;
8
8
  rounded?: "md" | "none" | "full" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
 
@@ -13,7 +13,7 @@ type ImageProps = Omit<ImgHTMLAttributes<HTMLImageElement>, 'alt'> & VariantProp
13
13
  lazy?: boolean;
14
14
  };
15
15
  declare const Image: react.ForwardRefExoticComponent<Omit<ImgHTMLAttributes<HTMLImageElement>, "alt"> & VariantProps<(props?: ({
16
- fit?: "fill" | "cover" | "contain" | null | undefined;
16
+ fit?: "contain" | "cover" | "fill" | null | undefined;
17
17
  rounded?: "md" | "none" | "full" | null | undefined;
18
18
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
19
19
  alt: string;
@@ -4,7 +4,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const inputStyles: (props?: ({
7
- state?: "default" | "error" | null | undefined;
7
+ state?: "error" | "default" | null | undefined;
8
8
  inputSize?: "sm" | "md" | "lg" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
 
@@ -14,7 +14,7 @@ type InputProps = InputHTMLAttributes<HTMLInputElement> & VariantProps<typeof in
14
14
  error?: string;
15
15
  };
16
16
  declare const Input: react.ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & VariantProps<(props?: ({
17
- state?: "default" | "error" | null | undefined;
17
+ state?: "error" | "default" | null | undefined;
18
18
  inputSize?: "sm" | "md" | "lg" | null | undefined;
19
19
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
20
20
  label?: string;
@@ -1,4 +1,5 @@
1
- export { Input } from '../../../chunk-PVDRNAYK.js';
1
+ export { Input } from '../../../chunk-DP274HDM.js';
2
+ import '../../../chunk-FFKHEBQ7.js';
2
3
  import '../../../chunk-P4CV2EPR.js';
3
4
  import '../../../chunk-6LLGTBM6.js';
4
5
  //# sourceMappingURL=index.js.map
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const richTextStyles: (props?: ({
7
7
  variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "s1" | "s2" | "s3" | "s4" | "p1" | "p2" | "p3" | "p4" | null | undefined;
8
- weight?: "bold" | "light" | "normal" | null | undefined;
8
+ weight?: "normal" | "light" | "bold" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
 
11
11
  type RichTextVariant = NonNullable<VariantProps<typeof richTextStyles>['variant']>;
@@ -16,7 +16,7 @@ type RichTextProps = HTMLAttributes<HTMLElement> & VariantProps<typeof richTextS
16
16
  };
17
17
  declare const RichText: react.ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & VariantProps<(props?: ({
18
18
  variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "s1" | "s2" | "s3" | "s4" | "p1" | "p2" | "p3" | "p4" | null | undefined;
19
- weight?: "bold" | "light" | "normal" | null | undefined;
19
+ weight?: "normal" | "light" | "bold" | null | undefined;
20
20
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
21
21
  as?: ElementType;
22
22
  bold?: boolean;
@@ -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,6 @@
1
+ export { Select } from '../../../chunk-WUEVXL76.js';
2
+ import '../../../chunk-FFKHEBQ7.js';
3
+ import '../../../chunk-P4CV2EPR.js';
4
+ import '../../../chunk-6LLGTBM6.js';
5
+ //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -6,7 +6,7 @@ type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size' |
6
6
  onCheckedChange: (checked: boolean) => void;
7
7
  label?: string;
8
8
  };
9
- declare const Switch: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "onChange" | "checked"> & {
9
+ declare const Switch: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "type" | "checked"> & {
10
10
  checked: boolean;
11
11
  onCheckedChange: (checked: boolean) => void;
12
12
  label?: string;
@@ -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,6 @@
1
+ export { Textarea } from '../../../chunk-3YRDRHO3.js';
2
+ import '../../../chunk-FFKHEBQ7.js';
3
+ import '../../../chunk-P4CV2EPR.js';
4
+ import '../../../chunk-6LLGTBM6.js';
5
+ //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,7 +1,9 @@
1
- export { BottomSheet } from '../../../chunk-K35XIA25.js';
1
+ export { BottomSheet } from '../../../chunk-RRIE5LFQ.js';
2
+ import '../../../chunk-BNEEI7S5.js';
2
3
  import '../../../chunk-JCJP427C.js';
4
+ import '../../../chunk-QT62VC36.js';
5
+ import '../../../chunk-53YMHM24.js';
3
6
  import '../../../chunk-P4Z7HH66.js';
4
- import '../../../chunk-BNEEI7S5.js';
5
7
  import '../../../chunk-P4CV2EPR.js';
6
8
  import '../../../chunk-6LLGTBM6.js';
7
9
  //# sourceMappingURL=index.js.map
@@ -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-CX3GARWU.js';
2
+ import '../../../chunk-BNEEI7S5.js';
3
+ import '../../../chunk-JCJP427C.js';
4
+ import '../../../chunk-QT62VC36.js';
5
+ import '../../../chunk-53YMHM24.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"}
@@ -10,6 +10,11 @@ type LanguageProps = Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> & {
10
10
  value: string;
11
11
  onChange: (value: string) => void;
12
12
  };
13
+ /**
14
+ * Single-choice segmented switch, following the WAI-ARIA radio group pattern: one Tab stop,
15
+ * arrow keys (and Home/End) move the selection. Name it with `aria-label` (defaults to
16
+ * "Language selector") or `aria-labelledby`.
17
+ */
13
18
  declare const Language: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
14
19
  options: LanguageOption[];
15
20
  value: string;
@@ -1,4 +1,4 @@
1
- export { Language } from '../../../chunk-HCLY7B4H.js';
1
+ export { Language } from '../../../chunk-2YBZCUME.js';
2
2
  import '../../../chunk-6LLGTBM6.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,9 @@
1
- export { Modal } from '../../../chunk-LK2EJ4H6.js';
1
+ export { Modal } from '../../../chunk-A26UWAU4.js';
2
+ import '../../../chunk-BNEEI7S5.js';
2
3
  import '../../../chunk-JCJP427C.js';
4
+ import '../../../chunk-QT62VC36.js';
5
+ import '../../../chunk-53YMHM24.js';
3
6
  import '../../../chunk-P4Z7HH66.js';
4
- import '../../../chunk-BNEEI7S5.js';
5
7
  import '../../../chunk-P4CV2EPR.js';
6
8
  import '../../../chunk-6LLGTBM6.js';
7
9
  //# sourceMappingURL=index.js.map
@@ -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,3 @@
1
+ export { useFocusTrap } from '../../chunk-QT62VC36.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ /** Prevents the page behind an open overlay from scrolling; restores the previous value on release. */
2
+ declare const useScrollLock: (active: boolean) => void;
3
+
4
+ export { useScrollLock };
@@ -0,0 +1,3 @@
1
+ export { useScrollLock } from '../../chunk-53YMHM24.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/index.d.ts CHANGED
@@ -1,21 +1,26 @@
1
- export { Button, ButtonProps } from './components/atoms/Button/index.js';
1
+ export { Button, ButtonProps, buttonStyles } from './components/atoms/Button/index.js';
2
2
  export { Icon, IconProps } from './components/atoms/Icon/index.js';
3
3
  export { Image, ImageProps } from './components/atoms/Image/index.js';
4
4
  export { Input, InputProps } from './components/atoms/Input/index.js';
5
5
  export { Link, LinkProps } from './components/atoms/Link/index.js';
6
6
  export { RichText, RichTextProps, RichTextVariant, elementByVariant } from './components/atoms/RichText/index.js';
7
+ export { Select, SelectProps } from './components/atoms/Select/index.js';
7
8
  export { Switch, SwitchProps } from './components/atoms/Switch/index.js';
9
+ export { Textarea, TextareaProps } from './components/atoms/Textarea/index.js';
8
10
  export { BottomSheet, BottomSheetProps } from './components/molecules/BottomSheet/index.js';
9
11
  export { BreadcrumbItem, Breadcrumbs, BreadcrumbsProps } from './components/molecules/Breadcrumbs/index.js';
10
12
  export { Card, CardContent, CardContentProps, CardDescription, CardDescriptionProps, CardFooter, CardFooterProps, CardHeader, CardHeaderProps, CardProps, CardTitle, CardTitleProps } from './components/molecules/Card/index.js';
13
+ export { Drawer, DrawerProps } from './components/molecules/Drawer/index.js';
11
14
  export { Language, LanguageOption, LanguageProps } from './components/molecules/Language/index.js';
12
15
  export { Modal, ModalProps } from './components/molecules/Modal/index.js';
13
16
  export { Snackbar, SnackbarProps } from './components/molecules/Snackbar/index.js';
14
17
  export { Timeline, TimelineItem, TimelineProps } from './components/molecules/Timeline/index.js';
15
18
  export { useDelayedUnmount } from './hooks/useDelayedUnmount/index.js';
16
19
  export { useDismissableLayer } from './hooks/useDismissableLayer/index.js';
20
+ export { useFocusTrap } from './hooks/useFocusTrap/index.js';
17
21
  export { useMediaQuery } from './hooks/useMediaQuery/index.js';
18
22
  export { useMergedRef } from './hooks/useMergedRef/index.js';
23
+ export { useScrollLock } from './hooks/useScrollLock/index.js';
19
24
  export { cn } from './utils/cn/index.js';
20
25
  import 'react';
21
26
  import 'class-variance-authority/types';