@kismet-ux/constellation 1.14.0 → 1.15.1

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/README.md +227 -208
  2. package/dist/form/Checkbox/checkbox.js +4 -57
  3. package/dist/form/Checkbox/checkbox.js.map +1 -1
  4. package/dist/form/DatePicker/date-picker.d.ts +1 -1
  5. package/dist/form/DatePicker/date-picker.d.ts.map +1 -1
  6. package/dist/form/DatePicker/date-picker.js +7 -59
  7. package/dist/form/DatePicker/date-picker.js.map +1 -1
  8. package/dist/form/Input/input.css +42 -6
  9. package/dist/form/Input/input.d.ts +6 -0
  10. package/dist/form/Input/input.d.ts.map +1 -1
  11. package/dist/form/Input/input.js +3 -3
  12. package/dist/form/Input/input.js.map +1 -1
  13. package/dist/form/Input/input.module.scss.js +1 -1
  14. package/dist/form/Select/select.d.ts.map +1 -1
  15. package/dist/form/Select/select.js +5 -5
  16. package/dist/form/Select/select.js.map +1 -1
  17. package/dist/form.d.ts +2 -2
  18. package/dist/index-B0UMInYo.d.ts +647 -0
  19. package/dist/index-B828Nf0P.d.ts +200 -0
  20. package/dist/index-BPKtGvrM.d.ts +200 -0
  21. package/dist/index-BdpiAK5-.d.ts +354 -0
  22. package/dist/index-ByI9bvw8.d.ts +647 -0
  23. package/dist/index-C7SAfZfl.d.ts +647 -0
  24. package/dist/index-Cq8JgMRD.d.ts +354 -0
  25. package/dist/index-D8p7TX9C.d.ts +200 -0
  26. package/dist/index-DyDvelCa.d.ts +354 -0
  27. package/dist/index.d.ts +8 -8
  28. package/dist/index.js +29 -29
  29. package/dist/input-BHmlHvYR.d.ts +58 -0
  30. package/dist/layout/AppSidebarHeader/app-sidebar-header.js +1 -31
  31. package/dist/layout/AppSidebarHeader/app-sidebar-header.js.map +1 -1
  32. package/dist/layout.d.ts +3 -3
  33. package/dist/navigation/NavUser/nav-user.js +2 -2
  34. package/dist/navigation/Router/router-context.d.ts +13 -5
  35. package/dist/navigation/Router/router-context.d.ts.map +1 -1
  36. package/dist/navigation/Router/router-context.js +22 -5
  37. package/dist/navigation/Router/router-context.js.map +1 -1
  38. package/dist/navigation/Sheet/sheet.js +3 -30
  39. package/dist/navigation/Sheet/sheet.js.map +1 -1
  40. package/dist/navigation.d.ts +15 -7
  41. package/dist/settings/AppearanceTabs/appearance-tabs.js +1 -28
  42. package/dist/settings/AppearanceTabs/appearance-tabs.js.map +1 -1
  43. package/dist/tooltip-Cw8p0qeV.d.ts +46 -0
  44. package/dist/types/form/date-picker.d.ts +2 -0
  45. package/dist/types/form/date-picker.d.ts.map +1 -1
  46. package/dist/types/form/select.d.ts +2 -0
  47. package/dist/types/form/select.d.ts.map +1 -1
  48. package/dist/types/form/theme.d.ts +9 -0
  49. package/dist/types/form/theme.d.ts.map +1 -1
  50. package/dist/typography/Typography/typography.css +21 -1
  51. package/dist/ui/Button/button-variants.d.ts +1 -1
  52. package/dist/ui/Button/button.css +1 -1
  53. package/dist/ui/Icon/icon-variants.d.ts +1 -1
  54. package/dist/ui/SwipeRow/swipe-row-variants.js.map +1 -1
  55. package/dist/ui/SwipeRow/swipe-row.js.map +1 -1
  56. package/dist/ui/Toggle/toggle-variants.d.ts +1 -1
  57. package/dist/ui.d.ts +2 -2
  58. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { SidebarMenuButton } from '../../layout/Sidebar/sidebar.js';
3
3
  import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } from '../DropdownMenu/dropdown-menu.js';
4
- import { UserInfo } from '../../user/UserInfo/user-info.js';
5
- import { UserMenuContent } from '../../user/UserMenuContent/user-menu-content.js';
6
4
  import { ChevronsUpDownIcon } from 'lucide-react';
7
5
  import s from './nav-user.module.scss.js';
6
+ import { UserInfo } from '../../user/UserInfo/user-info.js';
7
+ import { UserMenuContent } from '../../user/UserMenuContent/user-menu-content.js';
8
8
 
9
9
  /** Sidebar footer control: the signed-in user plus their account menu. */
10
10
  function NavUser({ user, ...menuProps }) {
@@ -10,6 +10,16 @@ export interface RouterAdapter {
10
10
  replace?: boolean;
11
11
  }) => void;
12
12
  }
13
+ export interface RouterProviderProps extends Partial<RouterAdapter> {
14
+ /**
15
+ * Name of the prop `linkComponent` reads its destination from. Constellation
16
+ * always speaks `href`; routers whose link takes `to` (React Router, TanStack
17
+ * Router) need `linkProp={'to'}` so the destination is handed over under that
18
+ * name instead. Defaults to `'href'` (Next.js, Inertia, plain anchors).
19
+ */
20
+ linkProp?: 'href' | 'to';
21
+ children: React.ReactNode;
22
+ }
13
23
  /**
14
24
  * Teaches Constellation how *your* app navigates.
15
25
  *
@@ -18,12 +28,12 @@ export interface RouterAdapter {
18
28
  * SPA-fast) everywhere. Wrap your app once to upgrade every Constellation link,
19
29
  * breadcrumb, sidebar item, and menu action to your router at the same time.
20
30
  *
21
- * @example React Router
31
+ * @example React Router (its `Link` takes `to`, so name the prop)
22
32
  * ```tsx
23
33
  * import { Link, useNavigate } from 'react-router-dom';
24
34
  *
25
35
  * const navigate = useNavigate();
26
- * <RouterProvider linkComponent={Link} navigate={navigate}>…</RouterProvider>
36
+ * <RouterProvider linkComponent={Link} linkProp={'to'} navigate={navigate}>…</RouterProvider>
27
37
  * ```
28
38
  *
29
39
  * @example Next.js
@@ -31,8 +41,6 @@ export interface RouterAdapter {
31
41
  * <RouterProvider linkComponent={NextLink} navigate={router.push}>…</RouterProvider>
32
42
  * ```
33
43
  */
34
- export declare function RouterProvider({ linkComponent, navigate, children, }: Partial<RouterAdapter> & {
35
- children: React.ReactNode;
36
- }): React.JSX.Element;
44
+ export declare function RouterProvider({ linkComponent, linkProp, navigate, children, }: RouterProviderProps): React.JSX.Element;
37
45
  export declare function useRouterAdapter(): RouterAdapter;
38
46
  //# sourceMappingURL=router-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../../src/navigation/Router/router-context.tsx"],"names":[],"mappings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-13,6 +13,16 @@ const defaultAdapter = {
13
13
  },
14
14
  };
15
15
  const RouterContext = React.createContext(defaultAdapter);
16
+ /**
17
+ * Wraps a router link that reads `to` so it accepts `href` like every other
18
+ * Constellation link target. `href` is consumed here and never reaches the DOM
19
+ * through the router's own prop spreading.
20
+ */
21
+ function adaptLinkProp(Component, linkProp) {
22
+ const Adapted = React.forwardRef(({ href, ...rest }, ref) => jsx(Component, { ref: ref, [linkProp]: href, ...rest }));
23
+ Adapted.displayName = 'RouterLink';
24
+ return Adapted;
25
+ }
16
26
  /**
17
27
  * Teaches Constellation how *your* app navigates.
18
28
  *
@@ -21,12 +31,12 @@ const RouterContext = React.createContext(defaultAdapter);
21
31
  * SPA-fast) everywhere. Wrap your app once to upgrade every Constellation link,
22
32
  * breadcrumb, sidebar item, and menu action to your router at the same time.
23
33
  *
24
- * @example React Router
34
+ * @example React Router (its `Link` takes `to`, so name the prop)
25
35
  * ```tsx
26
36
  * import { Link, useNavigate } from 'react-router-dom';
27
37
  *
28
38
  * const navigate = useNavigate();
29
- * <RouterProvider linkComponent={Link} navigate={navigate}>…</RouterProvider>
39
+ * <RouterProvider linkComponent={Link} linkProp={'to'} navigate={navigate}>…</RouterProvider>
30
40
  * ```
31
41
  *
32
42
  * @example Next.js
@@ -34,11 +44,18 @@ const RouterContext = React.createContext(defaultAdapter);
34
44
  * <RouterProvider linkComponent={NextLink} navigate={router.push}>…</RouterProvider>
35
45
  * ```
36
46
  */
37
- function RouterProvider({ linkComponent, navigate, children, }) {
47
+ function RouterProvider({ linkComponent, linkProp = 'href', navigate, children, }) {
48
+ // Memoised on the component itself: a new wrapper identity would remount
49
+ // every link in the app.
50
+ const resolvedLink = React.useMemo(() => {
51
+ if (!linkComponent)
52
+ return defaultAdapter.linkComponent;
53
+ return linkProp === 'href' ? linkComponent : adaptLinkProp(linkComponent, linkProp);
54
+ }, [linkComponent, linkProp]);
38
55
  const value = React.useMemo(() => ({
39
- linkComponent: linkComponent ?? defaultAdapter.linkComponent,
56
+ linkComponent: resolvedLink,
40
57
  navigate: navigate ?? defaultAdapter.navigate,
41
- }), [linkComponent, navigate]);
58
+ }), [resolvedLink, navigate]);
42
59
  return jsx(RouterContext.Provider, { value: value, children: children });
43
60
  }
44
61
  function useRouterAdapter() {
@@ -1 +1 @@
1
- {"version":3,"file":"router-context.js","sources":["../../../src/navigation/Router/router-context.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface RouterAdapter {\n /**\n * Component used to render in-app links. Receives `href` plus any props\n * passed through `Link`. Defaults to a plain `<a>`.\n */\n linkComponent: React.ElementType;\n /** Programmatic navigation. Defaults to a full page load. */\n navigate: (href: string, options?: { replace?: boolean }) => void;\n}\n\nconst defaultAdapter: RouterAdapter = {\n linkComponent: 'a',\n navigate: (href, options) => {\n if (typeof window === 'undefined') return;\n if (options?.replace) window.location.replace(href);\n else window.location.assign(href);\n },\n};\n\nconst RouterContext = React.createContext<RouterAdapter>(defaultAdapter);\n\n/**\n * Teaches Constellation how *your* app navigates.\n *\n * The library ships router-agnostic: without a provider, links are plain\n * anchors and navigation is a full page load, which is correct (if not\n * SPA-fast) everywhere. Wrap your app once to upgrade every Constellation link,\n * breadcrumb, sidebar item, and menu action to your router at the same time.\n *\n * @example React Router\n * ```tsx\n * import { Link, useNavigate } from 'react-router-dom';\n *\n * const navigate = useNavigate();\n * <RouterProvider linkComponent={Link} navigate={navigate}>…</RouterProvider>\n * ```\n *\n * @example Next.js\n * ```tsx\n * <RouterProvider linkComponent={NextLink} navigate={router.push}>…</RouterProvider>\n * ```\n */\nexport function RouterProvider({\n linkComponent,\n navigate,\n children,\n}: Partial<RouterAdapter> & { children: React.ReactNode }) {\n const value = React.useMemo<RouterAdapter>(\n () => ({\n linkComponent: linkComponent ?? defaultAdapter.linkComponent,\n navigate: navigate ?? defaultAdapter.navigate,\n }),\n [linkComponent, navigate],\n );\n\n return <RouterContext.Provider value={value}>{children}</RouterContext.Provider>;\n}\n\nexport function useRouterAdapter(): RouterAdapter {\n return React.useContext(RouterContext);\n}\n"],"names":["_jsx"],"mappings":";;;AAYA,MAAM,cAAc,GAAkB;AACpC,IAAA,aAAa,EAAE,GAAG;AAClB,IAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAI;QAC1B,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE;QACnC,IAAI,OAAO,EAAE,OAAO;AAAE,YAAA,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;;AAC9C,YAAA,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,CAAC;CACF;AAED,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAgB,cAAc,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,cAAc,CAAC,EAC7B,aAAa,EACb,QAAQ,EACR,QAAQ,GAC+C,EAAA;IACvD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACzB,OAAO;AACL,QAAA,aAAa,EAAE,aAAa,IAAI,cAAc,CAAC,aAAa;AAC5D,QAAA,QAAQ,EAAE,QAAQ,IAAI,cAAc,CAAC,QAAQ;AAC9C,KAAA,CAAC,EACF,CAAC,aAAa,EAAE,QAAQ,CAAC,CAC1B;IAED,OAAOA,GAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EAAG,QAAQ,EAAA,CAA0B;AAClF;SAEgB,gBAAgB,GAAA;AAC9B,IAAA,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC;AACxC;;"}
1
+ {"version":3,"file":"router-context.js","sources":["../../../src/navigation/Router/router-context.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface RouterAdapter {\n /**\n * Component used to render in-app links. Receives `href` plus any props\n * passed through `Link`. Defaults to a plain `<a>`.\n */\n linkComponent: React.ElementType;\n /** Programmatic navigation. Defaults to a full page load. */\n navigate: (href: string, options?: { replace?: boolean }) => void;\n}\n\nconst defaultAdapter: RouterAdapter = {\n linkComponent: 'a',\n navigate: (href, options) => {\n if (typeof window === 'undefined') return;\n if (options?.replace) window.location.replace(href);\n else window.location.assign(href);\n },\n};\n\nconst RouterContext = React.createContext<RouterAdapter>(defaultAdapter);\n\nexport interface RouterProviderProps extends Partial<RouterAdapter> {\n /**\n * Name of the prop `linkComponent` reads its destination from. Constellation\n * always speaks `href`; routers whose link takes `to` (React Router, TanStack\n * Router) need `linkProp={'to'}` so the destination is handed over under that\n * name instead. Defaults to `'href'` (Next.js, Inertia, plain anchors).\n */\n linkProp?: 'href' | 'to';\n children: React.ReactNode;\n}\n\n/**\n * Wraps a router link that reads `to` so it accepts `href` like every other\n * Constellation link target. `href` is consumed here and never reaches the DOM\n * through the router's own prop spreading.\n */\nfunction adaptLinkProp(Component: React.ElementType, linkProp: 'to'): React.ElementType {\n const Adapted = React.forwardRef<HTMLAnchorElement, { href: string }>(\n ({ href, ...rest }, ref) => <Component ref={ref} {...{ [linkProp]: href }} {...rest} />,\n );\n Adapted.displayName = 'RouterLink';\n return Adapted;\n}\n\n/**\n * Teaches Constellation how *your* app navigates.\n *\n * The library ships router-agnostic: without a provider, links are plain\n * anchors and navigation is a full page load, which is correct (if not\n * SPA-fast) everywhere. Wrap your app once to upgrade every Constellation link,\n * breadcrumb, sidebar item, and menu action to your router at the same time.\n *\n * @example React Router (its `Link` takes `to`, so name the prop)\n * ```tsx\n * import { Link, useNavigate } from 'react-router-dom';\n *\n * const navigate = useNavigate();\n * <RouterProvider linkComponent={Link} linkProp={'to'} navigate={navigate}>…</RouterProvider>\n * ```\n *\n * @example Next.js\n * ```tsx\n * <RouterProvider linkComponent={NextLink} navigate={router.push}>…</RouterProvider>\n * ```\n */\nexport function RouterProvider({\n linkComponent,\n linkProp = 'href',\n navigate,\n children,\n}: RouterProviderProps) {\n // Memoised on the component itself: a new wrapper identity would remount\n // every link in the app.\n const resolvedLink = React.useMemo<React.ElementType>(() => {\n if (!linkComponent) return defaultAdapter.linkComponent;\n return linkProp === 'href' ? linkComponent : adaptLinkProp(linkComponent, linkProp);\n }, [linkComponent, linkProp]);\n\n const value = React.useMemo<RouterAdapter>(\n () => ({\n linkComponent: resolvedLink,\n navigate: navigate ?? defaultAdapter.navigate,\n }),\n [resolvedLink, navigate],\n );\n\n return <RouterContext.Provider value={value}>{children}</RouterContext.Provider>;\n}\n\nexport function useRouterAdapter(): RouterAdapter {\n return React.useContext(RouterContext);\n}\n"],"names":["_jsx"],"mappings":";;;AAYA,MAAM,cAAc,GAAkB;AACpC,IAAA,aAAa,EAAE,GAAG;AAClB,IAAA,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAI;QAC1B,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE;QACnC,IAAI,OAAO,EAAE,OAAO;AAAE,YAAA,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;;AAC9C,YAAA,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IACnC,CAAC;CACF;AAED,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAgB,cAAc,CAAC;AAaxE;;;;AAIG;AACH,SAAS,aAAa,CAAC,SAA4B,EAAE,QAAc,EAAA;AACjE,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAC9B,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,KAAKA,GAAA,CAAC,SAAS,EAAA,EAAC,GAAG,EAAE,GAAG,EAAQ,CAAC,QAAQ,GAAG,IAAI,EAAA,GAAQ,IAAI,EAAA,CAAI,CACxF;AACD,IAAA,OAAO,CAAC,WAAW,GAAG,YAAY;AAClC,IAAA,OAAO,OAAO;AAChB;AAEA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAU,cAAc,CAAC,EAC7B,aAAa,EACb,QAAQ,GAAG,MAAM,EACjB,QAAQ,EACR,QAAQ,GACY,EAAA;;;AAGpB,IAAA,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAoB,MAAK;AACzD,QAAA,IAAI,CAAC,aAAa;YAAE,OAAO,cAAc,CAAC,aAAa;AACvD,QAAA,OAAO,QAAQ,KAAK,MAAM,GAAG,aAAa,GAAG,aAAa,CAAC,aAAa,EAAE,QAAQ,CAAC;AACrF,IAAA,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAE7B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACzB,OAAO;AACL,QAAA,aAAa,EAAE,YAAY;AAC3B,QAAA,QAAQ,EAAE,QAAQ,IAAI,cAAc,CAAC,QAAQ;AAC9C,KAAA,CAAC,EACF,CAAC,YAAY,EAAE,QAAQ,CAAC,CACzB;IAED,OAAOA,GAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EAAG,QAAQ,EAAA,CAA0B;AAClF;SAEgB,gBAAgB,GAAA;AAC9B,IAAA,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC;AACxC;;"}
@@ -1,41 +1,14 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import '../../ui/Alert/alert.js';
3
- import * as React from 'react';
4
- import { createPortal } from 'react-dom';
5
- import '../../ui/Alert/alert-context.js';
6
- import '../../ui/Alert/alert.css';
7
- import '../../ui/Avatar/avatar.js';
8
- import { Button } from '../../ui/Button/button.js';
9
- import '../../ui/Chip/chip.js';
10
- import '../../ui/ChipSelect/chip-select.js';
11
- import '../../ui/CodeBlock/code-block.js';
12
2
  import cn from 'clsx';
13
- import '../../ui/DevIndicator/dev-indicator.css';
14
- import '../../ui/Dialog/dialog.js';
15
- import '../../ui/EmptyState/empty-state.js';
16
- import '../../ui/Icon/icon.js';
17
- import '../../ui/List/list.js';
18
- import '../../ui/Pagination/pagination.js';
19
- import '../../ui/ProgressBar/progress-bar.js';
20
- import '../../ui/Separator/separator.js';
21
- import '../../ui/StatCard/stat-card.js';
22
- import '../../ui/StatusDot/status-dot.js';
23
- import '../../ui/StatusDot/status-dot-variants.js';
24
- import '../../ui/StepProgress/step-progress.js';
25
- import '../../ui/SwipeRow/swipe-row.js';
26
- import '../../ui/Switch/switch.js';
27
- import '../../ui/Table/table.js';
28
- import '../../ui/TableActionCell/table-action-cell.js';
29
- import '../../ui/TableToolbar/table-toolbar.js';
30
- import '../../ui/Toggle/toggle.js';
31
- import '../../ui/ToggleGroup/toggle-group.js';
32
- import '../../ui/Tooltip/tooltip.js';
33
3
  import { XIcon } from 'lucide-react';
4
+ import * as React from 'react';
5
+ import { createPortal } from 'react-dom';
34
6
  import { Slot } from '../../internal/slot.js';
35
7
  import { useAnimationState } from '../../internal/use-animation-state.js';
36
8
  import { useFocusTrap } from '../../internal/use-focus-trap.js';
37
9
  import { useScrollLock } from '../../internal/use-scroll-lock.js';
38
10
  import s from './sheet.module.scss.js';
11
+ import { Button } from '../../ui/Button/button.js';
39
12
 
40
13
  const SheetContext = React.createContext(null);
41
14
  function useSheet() {
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","sources":["../../../src/navigation/Sheet/sheet.tsx"],"sourcesContent":["import { Button } from '@constellation/ui';\nimport cn from 'clsx';\nimport { XIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { Slot } from '../../internal/slot';\nimport { useAnimationState } from '../../internal/use-animation-state';\nimport { useFocusTrap } from '../../internal/use-focus-trap';\nimport { useScrollLock } from '../../internal/use-scroll-lock';\nimport s from './sheet.module.scss';\n\n// ── Context ──────────────────────────────────────────────\n\ntype SheetContextValue = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n titleId: string;\n descriptionId: string;\n};\n\nconst SheetContext = React.createContext<SheetContextValue | null>(null);\n\nfunction useSheet() {\n const ctx = React.useContext(SheetContext);\n if (!ctx) throw new Error('Sheet compound components must be used within <Sheet>');\n return ctx;\n}\n\n// ── Root ─────────────────────────────────────────────────\n\nexport interface SheetProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: React.ReactNode;\n}\n\nfunction Sheet({ open: controlledOpen, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n const titleId = React.useId();\n const descriptionId = React.useId();\n\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n return (\n <SheetContext.Provider value={{ open, onOpenChange: handleOpenChange, titleId, descriptionId }}>\n {children}\n </SheetContext.Provider>\n );\n}\n\n// ── Trigger ──────────────────────────────────────────────\n\nexport interface SheetTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n}\n\nconst SheetTrigger = React.forwardRef<HTMLButtonElement, SheetTriggerProps>(\n ({ asChild, onClick, children, ...props }, ref) => {\n const { onOpenChange } = useSheet();\n const Comp = asChild ? Slot : 'button';\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n onOpenChange(true);\n };\n\n return (\n <Comp ref={ref} data-slot={'sheet-trigger'} onClick={handleClick} {...props}>\n {children}\n </Comp>\n );\n },\n);\nSheetTrigger.displayName = 'SheetTrigger';\n\n// ── Close ────────────────────────────────────────────────\n\nexport interface SheetCloseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n}\n\nconst SheetClose = React.forwardRef<HTMLButtonElement, SheetCloseProps>(\n ({ asChild, onClick, children, ...props }, ref) => {\n const { onOpenChange } = useSheet();\n const Comp = asChild ? Slot : 'button';\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n onOpenChange(false);\n };\n\n return (\n <Comp ref={ref} data-slot={'sheet-close'} onClick={handleClick} {...props}>\n {children}\n </Comp>\n );\n },\n);\nSheetClose.displayName = 'SheetClose';\n\n// ── Content ──────────────────────────────────────────────\n\nconst sideClassMap = {\n right: s['content-right'],\n left: s['content-left'],\n top: s['content-top'],\n bottom: s['content-bottom'],\n} as const;\n\ntype SheetSide = keyof typeof sideClassMap;\n\nexport type SheetContentProps = React.HTMLAttributes<HTMLDivElement> & {\n side?: SheetSide;\n /**\n * How much room the panel gets. `sm` suits a confirm or a short form; `lg`\n * is for a working surface — a queue of editable cards needs the width or\n * its own content starts scrolling sideways.\n */\n size?: 'sm' | 'md' | 'lg';\n /**\n * Float the panel off the viewport edge instead of sitting flush to it.\n * Reads as a card over the page rather than a second wall of it.\n */\n inset?: boolean;\n};\n\nconst SheetContent = React.forwardRef<HTMLDivElement, SheetContentProps>(\n ({ className, children, side = 'right', size = 'md', inset = false, ...props }, ref) => {\n const { open, onOpenChange, titleId, descriptionId } = useSheet();\n const { mounted, state } = useAnimationState(open, 250);\n const focusTrapRef = useFocusTrap(open);\n useScrollLock(mounted);\n\n React.useEffect(() => {\n if (!open) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n // A nested layer (an open Select, DatePicker or menu) marks Escape as\n // handled with preventDefault. Escape should dismiss the topmost layer\n // only, so the modal ignores an event something inside it already took.\n if (e.key === 'Escape' && !e.defaultPrevented) {\n onOpenChange(false);\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [open, onOpenChange]);\n\n if (!mounted || state === 'idle') return null;\n\n return createPortal(\n <div data-constellation-portal={''} ref={focusTrapRef}>\n <div\n data-slot={'sheet-overlay'}\n data-state={state}\n className={s.overlay}\n onClick={() => onOpenChange(false)}\n aria-hidden={'true'}\n />\n <div\n ref={ref}\n data-slot={'sheet-content'}\n data-state={state}\n role={'dialog'}\n aria-modal={'true'}\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className={cn(\n s['sheet-content'],\n sideClassMap[side],\n s[`size-${size}`],\n inset && s['content-inset'],\n className,\n )}\n onClick={e => e.stopPropagation()}\n {...props}\n >\n {children}\n <SheetClose className={s['close-button']} asChild>\n <Button variant={'ghost'} theme={'inherit'} iconOnly size={'sm'}>\n <XIcon />\n <span className={'srOnly'}>Close</span>\n </Button>\n </SheetClose>\n </div>\n </div>,\n document.body,\n );\n },\n);\nSheetContent.displayName = 'SheetContent';\n\n// ── Semantic sub-components ──────────────────────────────\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot={'sheet-header'} className={cn(s.header, className)} {...props} />;\n}\n\nfunction SheetBody({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot={'sheet-body'} className={cn(s.body, className)} {...props} />;\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot={'sheet-footer'} className={cn(s.footer, className)} {...props} />;\n}\n\nfunction SheetTitle({ className, ...props }: React.ComponentProps<'h2'>) {\n const { titleId } = useSheet();\n\n return (\n <h2 id={titleId} data-slot={'sheet-title'} className={cn(s.title, className)} {...props} />\n );\n}\n\nfunction SheetDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { descriptionId } = useSheet();\n\n return (\n <p\n id={descriptionId}\n data-slot={'sheet-description'}\n className={cn(s.description, className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetBody,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAA2B,IAAI,CAAC;AAExE,SAAS,QAAQ,GAAA;IACf,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;AAC1C,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC;AAClF,IAAA,OAAO,GAAG;AACZ;AAWA,SAAS,KAAK,CAAC,EAAE,IAAI,EAAE,cAA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AAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACvE,IAAA,OAAOA,0BAAgB,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,GAAI;AAC1F;AAEA,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B,EAAA;AACrE,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE;IAE9B,QACEA,YAAI,EAAE,EAAE,OAAO,EAAA,WAAA,EAAa,aAAa,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,CAAI;AAE/F;AAEA,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA6B,EAAA;AAC1E,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,EAAE;IAEpC,QACEA,WACE,EAAE,EAAE,aAAa,EAAA,WAAA,EACN,mBAAmB,EAC9B,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,GACnC,KAAK,EAAA,CACT;AAEN;;"}
1
+ {"version":3,"file":"sheet.js","sources":["../../../src/navigation/Sheet/sheet.tsx"],"sourcesContent":["import { Button } from '@constellation/ui';\nimport cn from 'clsx';\nimport { XIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { Slot } from '../../internal/slot';\nimport { useAnimationState } from '../../internal/use-animation-state';\nimport { useFocusTrap } from '../../internal/use-focus-trap';\nimport { useScrollLock } from '../../internal/use-scroll-lock';\nimport s from './sheet.module.scss';\n\n// ── Context ──────────────────────────────────────────────\n\ntype SheetContextValue = {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n titleId: string;\n descriptionId: string;\n};\n\nconst SheetContext = React.createContext<SheetContextValue | null>(null);\n\nfunction useSheet() {\n const ctx = React.useContext(SheetContext);\n if (!ctx) throw new Error('Sheet compound components must be used within <Sheet>');\n return ctx;\n}\n\n// ── Root ─────────────────────────────────────────────────\n\nexport interface SheetProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: React.ReactNode;\n}\n\nfunction Sheet({ open: controlledOpen, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n const titleId = React.useId();\n const descriptionId = React.useId();\n\n const handleOpenChange = React.useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n return (\n <SheetContext.Provider value={{ open, onOpenChange: handleOpenChange, titleId, descriptionId }}>\n {children}\n </SheetContext.Provider>\n );\n}\n\n// ── Trigger ──────────────────────────────────────────────\n\nexport interface SheetTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n}\n\nconst SheetTrigger = React.forwardRef<HTMLButtonElement, SheetTriggerProps>(\n ({ asChild, onClick, children, ...props }, ref) => {\n const { onOpenChange } = useSheet();\n const Comp = asChild ? Slot : 'button';\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n onOpenChange(true);\n };\n\n return (\n <Comp ref={ref} data-slot={'sheet-trigger'} onClick={handleClick} {...props}>\n {children}\n </Comp>\n );\n },\n);\nSheetTrigger.displayName = 'SheetTrigger';\n\n// ── Close ────────────────────────────────────────────────\n\nexport interface SheetCloseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n}\n\nconst SheetClose = React.forwardRef<HTMLButtonElement, SheetCloseProps>(\n ({ asChild, onClick, children, ...props }, ref) => {\n const { onOpenChange } = useSheet();\n const Comp = asChild ? Slot : 'button';\n\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n onOpenChange(false);\n };\n\n return (\n <Comp ref={ref} data-slot={'sheet-close'} onClick={handleClick} {...props}>\n {children}\n </Comp>\n );\n },\n);\nSheetClose.displayName = 'SheetClose';\n\n// ── Content ──────────────────────────────────────────────\n\nconst sideClassMap = {\n right: s['content-right'],\n left: s['content-left'],\n top: s['content-top'],\n bottom: s['content-bottom'],\n} as const;\n\ntype SheetSide = keyof typeof sideClassMap;\n\nexport type SheetContentProps = React.HTMLAttributes<HTMLDivElement> & {\n side?: SheetSide;\n /**\n * How much room the panel gets. `sm` suits a confirm or a short form; `lg`\n * is for a working surface — a queue of editable cards needs the width or\n * its own content starts scrolling sideways.\n */\n size?: 'sm' | 'md' | 'lg';\n /**\n * Float the panel off the viewport edge instead of sitting flush to it.\n * Reads as a card over the page rather than a second wall of it.\n */\n inset?: boolean;\n};\n\nconst SheetContent = React.forwardRef<HTMLDivElement, SheetContentProps>(\n ({ className, children, side = 'right', size = 'md', inset = false, ...props }, ref) => {\n const { open, onOpenChange, titleId, descriptionId } = useSheet();\n const { mounted, state } = useAnimationState(open, 250);\n const focusTrapRef = useFocusTrap(open);\n useScrollLock(mounted);\n\n React.useEffect(() => {\n if (!open) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n // A nested layer (an open Select, DatePicker or menu) marks Escape as\n // handled with preventDefault. Escape should dismiss the topmost layer\n // only, so the modal ignores an event something inside it already took.\n if (e.key === 'Escape' && !e.defaultPrevented) {\n onOpenChange(false);\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [open, onOpenChange]);\n\n if (!mounted || state === 'idle') return null;\n\n return createPortal(\n <div data-constellation-portal={''} ref={focusTrapRef}>\n <div\n data-slot={'sheet-overlay'}\n data-state={state}\n className={s.overlay}\n onClick={() => onOpenChange(false)}\n aria-hidden={'true'}\n />\n <div\n ref={ref}\n data-slot={'sheet-content'}\n data-state={state}\n role={'dialog'}\n aria-modal={'true'}\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className={cn(\n s['sheet-content'],\n sideClassMap[side],\n s[`size-${size}`],\n inset && s['content-inset'],\n className,\n )}\n onClick={e => e.stopPropagation()}\n {...props}\n >\n {children}\n <SheetClose className={s['close-button']} asChild>\n <Button variant={'ghost'} theme={'inherit'} iconOnly size={'sm'}>\n <XIcon />\n <span className={'srOnly'}>Close</span>\n </Button>\n </SheetClose>\n </div>\n </div>,\n document.body,\n );\n },\n);\nSheetContent.displayName = 'SheetContent';\n\n// ── Semantic sub-components ──────────────────────────────\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot={'sheet-header'} className={cn(s.header, className)} {...props} />;\n}\n\nfunction SheetBody({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot={'sheet-body'} className={cn(s.body, className)} {...props} />;\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot={'sheet-footer'} className={cn(s.footer, className)} {...props} />;\n}\n\nfunction SheetTitle({ className, ...props }: React.ComponentProps<'h2'>) {\n const { titleId } = useSheet();\n\n return (\n <h2 id={titleId} data-slot={'sheet-title'} className={cn(s.title, className)} {...props} />\n );\n}\n\nfunction SheetDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { descriptionId } = useSheet();\n\n return (\n <p\n id={descriptionId}\n data-slot={'sheet-description'}\n className={cn(s.description, className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetBody,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAA2B,IAAI,CAAC;AAExE,SAAS,QAAQ,GAAA;IACf,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC;AAC1C,IAAA,IAAI,CAAC,GAAG;AAAE,QAAA,MAAM,IAAI,KAA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,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,GAAI;AACtF;AAEA,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACvE,IAAA,OAAOA,0BAAgB,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,GAAI;AAC1F;AAEA,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B,EAAA;AACrE,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE;IAE9B,QACEA,YAAI,EAAE,EAAE,OAAO,EAAA,WAAA,EAAa,aAAa,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,CAAI;AAE/F;AAEA,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA6B,EAAA;AAC1E,IAAA,MAAM,EAAE,aAAa,EAAE,GAAG,QAAQ,EAAE;IAEpC,QACEA,WACE,EAAE,EAAE,aAAa,EAAA,WAAA,EACN,mBAAmB,EAC9B,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,GACnC,KAAK,EAAA,CACT;AAEN;;"}
@@ -62,7 +62,7 @@ declare function DropdownMenuSubContent({ className, ...props }: React.HTMLAttri
62
62
  declare const linkVariants: (props?: ({
63
63
  underline?: boolean | null | undefined;
64
64
  hover?: "default" | "none" | null | undefined;
65
- theme?: "primary" | "secondary" | "destructive" | "success" | "warning" | "info" | "slate" | "inherit" | null | undefined;
65
+ theme?: "inherit" | "primary" | "secondary" | "success" | "destructive" | "warning" | "info" | "slate" | null | undefined;
66
66
  } & class_variance_authority_types.ClassProp) | undefined) => string;
67
67
 
68
68
  interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'onClick'>, VariantProps<typeof linkVariants> {
@@ -96,6 +96,16 @@ interface RouterAdapter {
96
96
  replace?: boolean;
97
97
  }) => void;
98
98
  }
99
+ interface RouterProviderProps extends Partial<RouterAdapter> {
100
+ /**
101
+ * Name of the prop `linkComponent` reads its destination from. Constellation
102
+ * always speaks `href`; routers whose link takes `to` (React Router, TanStack
103
+ * Router) need `linkProp={'to'}` so the destination is handed over under that
104
+ * name instead. Defaults to `'href'` (Next.js, Inertia, plain anchors).
105
+ */
106
+ linkProp?: 'href' | 'to';
107
+ children: React.ReactNode;
108
+ }
99
109
  /**
100
110
  * Teaches Constellation how *your* app navigates.
101
111
  *
@@ -104,12 +114,12 @@ interface RouterAdapter {
104
114
  * SPA-fast) everywhere. Wrap your app once to upgrade every Constellation link,
105
115
  * breadcrumb, sidebar item, and menu action to your router at the same time.
106
116
  *
107
- * @example React Router
117
+ * @example React Router (its `Link` takes `to`, so name the prop)
108
118
  * ```tsx
109
119
  * import { Link, useNavigate } from 'react-router-dom';
110
120
  *
111
121
  * const navigate = useNavigate();
112
- * <RouterProvider linkComponent={Link} navigate={navigate}>…</RouterProvider>
122
+ * <RouterProvider linkComponent={Link} linkProp={'to'} navigate={navigate}>…</RouterProvider>
113
123
  * ```
114
124
  *
115
125
  * @example Next.js
@@ -117,9 +127,7 @@ interface RouterAdapter {
117
127
  * <RouterProvider linkComponent={NextLink} navigate={router.push}>…</RouterProvider>
118
128
  * ```
119
129
  */
120
- declare function RouterProvider({ linkComponent, navigate, children, }: Partial<RouterAdapter> & {
121
- children: React.ReactNode;
122
- }): React.JSX.Element;
130
+ declare function RouterProvider({ linkComponent, linkProp, navigate, children, }: RouterProviderProps): React.JSX.Element;
123
131
  declare function useRouterAdapter(): RouterAdapter;
124
132
 
125
133
  interface SheetProps {
@@ -179,4 +187,4 @@ declare function SheetTitle({ className, ...props }: React.ComponentProps<'h2'>)
179
187
  declare function SheetDescription({ className, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
180
188
 
181
189
  export { Breadcrumbs, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Link, RouterProvider, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, useRouterAdapter };
182
- export type { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuProps, DropdownMenuTriggerProps, LinkProps, RouterAdapter, SheetCloseProps, SheetContentProps, SheetProps, SheetTriggerProps };
190
+ export type { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuProps, DropdownMenuTriggerProps, LinkProps, RouterAdapter, RouterProviderProps, SheetCloseProps, SheetContentProps, SheetProps, SheetTriggerProps };
@@ -4,37 +4,10 @@ import '../../layout/Sidebar/sidebar-context.js';
4
4
  import '../../ui/Alert/alert-context.js';
5
5
  import '../../ui/Table/table-sort-context.js';
6
6
  import { useAppearance } from '../../hooks/use-appearance.js';
7
- import '../../ui/Alert/alert.js';
8
- import 'react-dom';
9
- import '../../ui/Alert/alert.css';
10
- import '../../ui/Avatar/avatar.js';
11
- import { Button } from '../../ui/Button/button.js';
12
- import '../../ui/Chip/chip.js';
13
- import '../../ui/ChipSelect/chip-select.js';
14
- import '../../ui/CodeBlock/code-block.js';
15
7
  import cn from 'clsx';
16
- import '../../ui/DevIndicator/dev-indicator.css';
17
- import '../../ui/Dialog/dialog.js';
18
- import '../../ui/EmptyState/empty-state.js';
19
- import '../../ui/Icon/icon.js';
20
- import '../../ui/List/list.js';
21
- import '../../ui/Pagination/pagination.js';
22
- import '../../ui/ProgressBar/progress-bar.js';
23
- import '../../ui/Separator/separator.js';
24
- import '../../ui/StatCard/stat-card.js';
25
- import '../../ui/StatusDot/status-dot.js';
26
- import '../../ui/StatusDot/status-dot-variants.js';
27
- import '../../ui/StepProgress/step-progress.js';
28
- import '../../ui/SwipeRow/swipe-row.js';
29
- import '../../ui/Switch/switch.js';
30
- import '../../ui/Table/table.js';
31
- import '../../ui/TableActionCell/table-action-cell.js';
32
- import '../../ui/TableToolbar/table-toolbar.js';
33
- import '../../ui/Toggle/toggle.js';
34
- import '../../ui/ToggleGroup/toggle-group.js';
35
- import '../../ui/Tooltip/tooltip.js';
36
8
  import { SunIcon, MoonIcon, MonitorIcon } from 'lucide-react';
37
9
  import s from './appearance-tabs.module.scss.js';
10
+ import { Button } from '../../ui/Button/button.js';
38
11
 
39
12
  function AppearanceTabs({ className = '', iconOnly = false, ...props }) {
40
13
  const { appearance, updateAppearance } = useAppearance();
@@ -1 +1 @@
1
- {"version":3,"file":"appearance-tabs.js","sources":["../../../src/settings/AppearanceTabs/appearance-tabs.tsx"],"sourcesContent":["import { type Appearance, useAppearance } from '@constellation/hooks';\nimport { Button } from '@constellation/ui';\nimport cn from 'clsx';\nimport { type LucideIcon, MonitorIcon, MoonIcon, SunIcon } from 'lucide-react';\nimport * as React from 'react';\nimport s from './appearance-tabs.module.scss';\n\ntype AppearanceTabsProps = React.HTMLAttributes<HTMLDivElement> & {\n iconOnly?: boolean;\n};\n\nexport function AppearanceTabs({\n className = '',\n iconOnly = false,\n ...props\n}: AppearanceTabsProps) {\n const { appearance, updateAppearance } = useAppearance();\n\n const tabs: { value: Appearance; icon: LucideIcon; label: string }[] = [\n { value: 'light', icon: SunIcon, label: 'Light' },\n { value: 'dark', icon: MoonIcon, label: 'Dark' },\n { value: 'system', icon: MonitorIcon, label: 'System' },\n ];\n\n return (\n <div data-slot={'appearance-tabs'} className={cn(s['tabs-root'], className)} {...props}>\n {tabs.map(({ value, icon: Icon, label }) => (\n <Button\n key={value}\n variant={'ghost'}\n theme={'inherit'}\n rounded\n onClick={() => updateAppearance(value)}\n aria-label={label}\n iconOnly={iconOnly}\n aria-pressed={appearance === value}\n className={cn(s['tab-button'], appearance === value && s['tab-button-active'])}\n title={iconOnly ? label : undefined}\n >\n <Icon />\n {!iconOnly && <span>{label}</span>}\n </Button>\n ))}\n </div>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWM,SAAU,cAAc,CAAC,EAC7B,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,KAAK,EAChB,GAAG,KAAK,EACY,EAAA;IACpB,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,aAAa,EAAE;AAExD,IAAA,MAAM,IAAI,GAA6D;QACrE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QACjD,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE;QAChD,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;KACxD;IAED,QACEA,GAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EAAgB,iBAAiB,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,QAAA,EACnF,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MACrCC,IAAA,CAAC,MAAM,EAAA,EAEL,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,SAAS,EAChB,OAAO,EAAA,IAAA,EACP,OAAO,EAAE,MAAM,gBAAgB,CAAC,KAAK,CAAC,gBAC1B,KAAK,EACjB,QAAQ,EAAE,QAAQ,EAAA,cAAA,EACJ,UAAU,KAAK,KAAK,EAClC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,UAAU,KAAK,KAAK,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC,EAC9E,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,SAAS,EAAA,QAAA,EAAA,CAEnCD,GAAA,CAAC,IAAI,EAAA,EAAA,CAAG,EACP,CAAC,QAAQ,IAAIA,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,KAAK,EAAA,CAAQ,CAAA,EAAA,EAZ7B,KAAK,CAaH,CACV,CAAC,EAAA,CACE;AAEV;;"}
1
+ {"version":3,"file":"appearance-tabs.js","sources":["../../../src/settings/AppearanceTabs/appearance-tabs.tsx"],"sourcesContent":["import { type Appearance, useAppearance } from '@constellation/hooks';\nimport { Button } from '@constellation/ui';\nimport cn from 'clsx';\nimport { type LucideIcon, MonitorIcon, MoonIcon, SunIcon } from 'lucide-react';\nimport * as React from 'react';\nimport s from './appearance-tabs.module.scss';\n\ntype AppearanceTabsProps = React.HTMLAttributes<HTMLDivElement> & {\n iconOnly?: boolean;\n};\n\nexport function AppearanceTabs({\n className = '',\n iconOnly = false,\n ...props\n}: AppearanceTabsProps) {\n const { appearance, updateAppearance } = useAppearance();\n\n const tabs: { value: Appearance; icon: LucideIcon; label: string }[] = [\n { value: 'light', icon: SunIcon, label: 'Light' },\n { value: 'dark', icon: MoonIcon, label: 'Dark' },\n { value: 'system', icon: MonitorIcon, label: 'System' },\n ];\n\n return (\n <div data-slot={'appearance-tabs'} className={cn(s['tabs-root'], className)} {...props}>\n {tabs.map(({ value, icon: Icon, label }) => (\n <Button\n key={value}\n variant={'ghost'}\n theme={'inherit'}\n rounded\n onClick={() => updateAppearance(value)}\n aria-label={label}\n iconOnly={iconOnly}\n aria-pressed={appearance === value}\n className={cn(s['tab-button'], appearance === value && s['tab-button-active'])}\n title={iconOnly ? label : undefined}\n >\n <Icon />\n {!iconOnly && <span>{label}</span>}\n </Button>\n ))}\n </div>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAWM,SAAU,cAAc,CAAC,EAC7B,SAAS,GAAG,EAAE,EACd,QAAQ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,CACV,CAAC,EAAA,CACE;AAEV;;"}
@@ -0,0 +1,46 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+
5
+ declare const buttonVariants: (props?: ({
6
+ variant?: "contained" | "outlined" | "ghost" | null | undefined;
7
+ theme?: "primary" | "secondary" | "destructive" | "success" | "warning" | "info" | "slate" | "inherit" | null | undefined;
8
+ size?: "sm" | "md" | "lg" | "xs" | null | undefined;
9
+ iconOnly?: boolean | null | undefined;
10
+ fullWidth?: boolean | null | undefined;
11
+ rounded?: boolean | "extra" | null | undefined;
12
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
13
+
14
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
15
+ /** A colour outside the theme scale; overrides the theme's colour roles. */
16
+ color?: string;
17
+ /** Ink for `contained` when `color` is set and the default contrast is wrong. */
18
+ onColor?: string;
19
+ asChild?: boolean;
20
+ }
21
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
22
+
23
+ declare function TooltipProvider({ children, delayDuration, }: {
24
+ children?: React.ReactNode;
25
+ delayDuration?: number;
26
+ }): React.JSX.Element;
27
+ interface TooltipProps {
28
+ children?: React.ReactNode;
29
+ open?: boolean;
30
+ defaultOpen?: boolean;
31
+ onOpenChange?: (open: boolean) => void;
32
+ delayDuration?: number;
33
+ }
34
+ declare function Tooltip({ children, open: controlledOpen, defaultOpen, onOpenChange, delayDuration, }: TooltipProps): React.JSX.Element;
35
+ interface TooltipTriggerProps extends React.HTMLAttributes<HTMLElement> {
36
+ asChild?: boolean;
37
+ }
38
+ declare function TooltipTrigger({ asChild, children, onMouseEnter, onMouseLeave, onFocus, onBlur, ...props }: TooltipTriggerProps): React.JSX.Element;
39
+ interface TooltipContentProps extends React.HTMLAttributes<HTMLDivElement> {
40
+ side?: 'top' | 'right' | 'bottom' | 'left';
41
+ sideOffset?: number;
42
+ }
43
+ declare function TooltipContent({ className, children, side, sideOffset, ...props }: TooltipContentProps): React.ReactPortal | null;
44
+
45
+ export { Button as B, Tooltip as T, TooltipContent as b, TooltipProvider as e, TooltipTrigger as f };
46
+ export type { ButtonProps as a, TooltipContentProps as c, TooltipProps as d, TooltipTriggerProps as g };
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { FieldAppearance } from './theme';
2
3
  export type DatePickerProps = {
3
4
  value?: string;
4
5
  defaultValue?: string;
@@ -6,6 +7,7 @@ export type DatePickerProps = {
6
7
  label?: React.ReactNode;
7
8
  helperText?: React.ReactNode;
8
9
  error?: boolean;
10
+ appearance?: FieldAppearance;
9
11
  disabled?: boolean;
10
12
  sizeVariant?: 'sm' | 'md';
11
13
  placeholder?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/types/form/date-picker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/types/form/date-picker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { FieldAppearance } from './theme';
2
3
  export type SelectAlign = 'start' | 'center' | 'end';
3
4
  export type SelectSide = 'top' | 'bottom' | 'left' | 'right';
4
5
  export type SelectPosition = 'item-aligned' | 'popper';
@@ -27,6 +28,7 @@ type SelectFieldBaseProps = Omit<SelectProps, 'value' | 'defaultValue' | 'onValu
27
28
  label?: React.ReactNode;
28
29
  helperText?: React.ReactNode;
29
30
  error?: boolean;
31
+ appearance?: FieldAppearance;
30
32
  placeholder?: string;
31
33
  fieldClassName?: string;
32
34
  contentProps?: SelectFieldContentProps;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/types/form/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACtE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,uBAAuB,GAAG,IAAI,CACjC,kBAAkB,EAClB,OAAO,G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AAc,GAAG,eAAe,CAAC,GAAG;IAC1F,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,uBAAuB,CAAC;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,KAAK,sBAAsB,GAAG,oBAAoB,GAAG;IACnD,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,KAAK,qBAAqB,GAAG,oBAAoB,GAAG;IAClD,QAAQ,EAAE,IAAI,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC"}
@@ -1,2 +1,11 @@
1
+ /**
2
+ * How a field draws its box.
3
+ *
4
+ * `outlined` is the library's own look: a hairline box the label notches into.
5
+ * `filled` drops the border for a quiet opaque ground; `underline` keeps only
6
+ * the bottom edge. Set it per field, or once for a whole tree with
7
+ * `data-field-appearance` on an ancestor — a field's own prop still wins.
8
+ */
9
+ export type FieldAppearance = 'outlined' | 'filled' | 'underline';
1
10
  export type FormTheme = 'inherit' | 'primary' | 'secondary' | 'destructive' | 'warning' | 'success' | 'info' | 'slate';
2
11
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/types/form/theme.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACnB,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/types/form/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAElE,MAAM,MAAM,SAAS,GACnB,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC"}
@@ -1,4 +1,13 @@
1
1
  @charset "UTF-8";
2
+ /*
3
+ * Headings read the brand's display face when there is one.
4
+ *
5
+ * `--font-display` and `--font-display-weight` are unset by default, so every
6
+ * heading falls back to `--font-sans` at the weight it always had. They are
7
+ * read here rather than declared on `:root` because a `:root` declaration
8
+ * would resolve `var(--font-sans)` once, at the root, and a subtree that
9
+ * re-points `--font-sans` would keep the old face in its headings.
10
+ */
2
11
  .typography-module_typography__FAx__ {
3
12
  /*
4
13
  * ONE FACE FOR EVERYTHING, and it is sans.
@@ -27,6 +36,8 @@
27
36
  padding: 0;
28
37
  }
29
38
  .typography-module_typography__FAx__.typography-module_h1__Chrx6 {
39
+ --typography-font: var(--font-display, var(--font-sans));
40
+ font-weight: var(--font-display-weight, 400);
30
41
  color: var(--text-heading);
31
42
  --typography-font-size: var(--font-size-h1);
32
43
  line-height: 1.25;
@@ -37,6 +48,8 @@
37
48
  }
38
49
  }
39
50
  .typography-module_typography__FAx__.typography-module_h2__6Qpwf {
51
+ --typography-font: var(--font-display, var(--font-sans));
52
+ font-weight: var(--font-display-weight, 400);
40
53
  color: var(--text-heading);
41
54
  --typography-font-size: var(--font-size-h2);
42
55
  line-height: 1.25;
@@ -47,6 +60,8 @@
47
60
  }
48
61
  }
49
62
  .typography-module_typography__FAx__.typography-module_h3__1eGbP {
63
+ --typography-font: var(--font-display, var(--font-sans));
64
+ font-weight: var(--font-display-weight, 400);
50
65
  color: var(--text-heading);
51
66
  --typography-font-size: 2rem;
52
67
  line-height: 1.25;
@@ -57,6 +72,8 @@
57
72
  }
58
73
  }
59
74
  .typography-module_typography__FAx__.typography-module_h4__TEi6l {
75
+ --typography-font: var(--font-display, var(--font-sans));
76
+ font-weight: var(--font-display-weight, 400);
60
77
  color: var(--text-heading);
61
78
  --typography-font-size: var(--font-size-h3);
62
79
  line-height: 1.25;
@@ -67,9 +84,10 @@
67
84
  }
68
85
  }
69
86
  .typography-module_typography__FAx__.typography-module_h5__pY2ZF {
87
+ --typography-font: var(--font-display, var(--font-sans));
88
+ font-weight: var(--font-display-weight, 500);
70
89
  color: var(--text-heading);
71
90
  --typography-font-size: var(--font-size-h4);
72
- font-weight: 500;
73
91
  line-height: 1.25;
74
92
  }
75
93
  @media (max-width: 768px) {
@@ -78,6 +96,8 @@
78
96
  }
79
97
  }
80
98
  .typography-module_typography__FAx__.typography-module_h6__jzeAZ {
99
+ --typography-font: var(--font-display, var(--font-sans));
100
+ font-weight: var(--font-display-weight, 400);
81
101
  color: var(--text-heading);
82
102
  --typography-font-size: var(--font-size-h5);
83
103
  line-height: 1.25;
@@ -1,5 +1,5 @@
1
1
  export declare const buttonVariants: (props?: ({
2
- variant?: "ghost" | "contained" | "outlined" | null | undefined;
2
+ variant?: "outlined" | "ghost" | "contained" | null | undefined;
3
3
  theme?: "inherit" | "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | null | undefined;
4
4
  size?: "sm" | "md" | "lg" | "xs" | null | undefined;
5
5
  iconOnly?: boolean | null | undefined;
@@ -76,7 +76,7 @@
76
76
  border-radius: var(--size-1);
77
77
  }
78
78
  .button-module_button--extra-rounded__B9xBI {
79
- border-radius: var(--size-5);
79
+ border-radius: var(--button-radius, var(--size-5));
80
80
  }
81
81
  .button-module_button--contained__YQQ33.button-module_button--primary__BO20b {
82
82
  --button-ripple-color: var(--button-color, var(--primary-light));
@@ -1,5 +1,5 @@
1
1
  export declare const iconVariants: (props?: ({
2
- variant?: "ghost" | "contained" | "outlined" | "plain" | null | undefined;
2
+ variant?: "outlined" | "ghost" | "contained" | "plain" | null | undefined;
3
3
  theme?: "inherit" | "primary" | "secondary" | "destructive" | "warning" | "success" | "info" | "slate" | null | undefined;
4
4
  size?: "sm" | "md" | "lg" | "xs" | null | undefined;
5
5
  rounded?: boolean | "extra" | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"swipe-row-variants.js","sources":["../../../src/ui/SwipeRow/swipe-row-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\r\nimport s from './swipe-row.module.scss';\r\n\r\nexport const swipeRowVariants = cva(s['swipe-row'], {\r\n variants: {\r\n theme: {\r\n primary: s['swipe-row--primary'],\r\n secondary: s['swipe-row--secondary'],\r\n destructive: s['swipe-row--destructive'],\r\n warning: s['swipe-row--warning'],\r\n success: s['swipe-row--success'],\r\n info: s['swipe-row--info'],\r\n slate: s['swipe-row--slate'],\r\n },\r\n },\r\n defaultVariants: {\r\n theme: 'destructive',\r\n },\r\n});\r\n"],"names":[],"mappings":";;;AAGO,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE;AAClD,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC;AAChC,YAAA,SAAS,EAAE,CAAC,CAAC,sBAAsB,CAAC;AACpC,YAAA,WAAW,EAAE,CAAC,CAAC,wBAAwB,CAAC;AACxC,YAAA,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC;AAChC,YAAA,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC;AAChC,YAAA,IAAI,EAAE,CAAC,CAAC,iBAAiB,CAAC;AAC1B,YAAA,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC;AAC7B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,aAAa;AACrB,KAAA;AACF,CAAA;;"}
1
+ {"version":3,"file":"swipe-row-variants.js","sources":["../../../src/ui/SwipeRow/swipe-row-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport s from './swipe-row.module.scss';\n\nexport const swipeRowVariants = cva(s['swipe-row'], {\n variants: {\n theme: {\n primary: s['swipe-row--primary'],\n secondary: s['swipe-row--secondary'],\n destructive: s['swipe-row--destructive'],\n warning: s['swipe-row--warning'],\n success: s['swipe-row--success'],\n info: s['swipe-row--info'],\n slate: s['swipe-row--slate'],\n },\n },\n defaultVariants: {\n theme: 'destructive',\n },\n});\n"],"names":[],"mappings":";;;AAGO,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE;AAClD,IAAA,QAAQ,EAAE;AACR,QAAA,KAAK,EAAE;AACL,YAAA,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC;AAChC,YAAA,SAAS,EAAE,CAAC,CAAC,sBAAsB,CAAC;AACpC,YAAA,WAAW,EAAE,CAAC,CAAC,wBAAwB,CAAC;AACxC,YAAA,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC;AAChC,YAAA,OAAO,EAAE,CAAC,CAAC,oBAAoB,CAAC;AAChC,YAAA,IAAI,EAAE,CAAC,CAAC,iBAAiB,CAAC;AAC1B,YAAA,KAAK,EAAE,CAAC,CAAC,kBAAkB,CAAC;AAC7B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,KAAK,EAAE,aAAa;AACrB,KAAA;AACF,CAAA;;"}