@kismet-ux/constellation 1.12.0 → 1.13.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 (49) hide show
  1. package/dist/form/Checkbox/checkbox.js +1 -0
  2. package/dist/form/Checkbox/checkbox.js.map +1 -1
  3. package/dist/form/DatePicker/date-picker.js +1 -0
  4. package/dist/form/DatePicker/date-picker.js.map +1 -1
  5. package/dist/form.d.ts +1 -1
  6. package/dist/index-BaTZEId2.d.ts +354 -0
  7. package/dist/index-BgAs5Dmg.d.ts +354 -0
  8. package/dist/index-BhyLuP25.d.ts +354 -0
  9. package/dist/index-BnhsWXrb.d.ts +354 -0
  10. package/dist/index-CcD4F6q1.d.ts +633 -0
  11. package/dist/index-ClPGArR0.d.ts +633 -0
  12. package/dist/index-D2L-7_nr.d.ts +354 -0
  13. package/dist/index-DHbG5cYq.d.ts +633 -0
  14. package/dist/index-DxbOGj5Y.d.ts +354 -0
  15. package/dist/index-bK5ZOxgI.d.ts +633 -0
  16. package/dist/index-p7kVnzRy.d.ts +633 -0
  17. package/dist/index-xQq5cJnf.d.ts +633 -0
  18. package/dist/index.css +88 -0
  19. package/dist/index.d.ts +6 -6
  20. package/dist/index.js +1 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/layout/AppSidebarHeader/app-sidebar-header.js +1 -0
  23. package/dist/layout/AppSidebarHeader/app-sidebar-header.js.map +1 -1
  24. package/dist/layout.d.ts +2 -2
  25. package/dist/navigation/Sheet/sheet.js +1 -0
  26. package/dist/navigation/Sheet/sheet.js.map +1 -1
  27. package/dist/navigation.d.ts +1 -1
  28. package/dist/settings/AppearanceTabs/appearance-tabs.js +1 -0
  29. package/dist/settings/AppearanceTabs/appearance-tabs.js.map +1 -1
  30. package/dist/tokens.css +30 -0
  31. package/dist/tooltip-CZ7BC0g3.d.ts +46 -0
  32. package/dist/tooltip-Cf_wdeef.d.ts +46 -0
  33. package/dist/tooltip-D1Wex2bz.d.ts +46 -0
  34. package/dist/typography/Typography/typography.css +14 -14
  35. package/dist/ui/ChipSelect/chip-select.css +63 -0
  36. package/dist/ui/ChipSelect/chip-select.d.ts +69 -0
  37. package/dist/ui/ChipSelect/chip-select.d.ts.map +1 -0
  38. package/dist/ui/ChipSelect/chip-select.js +209 -0
  39. package/dist/ui/ChipSelect/chip-select.js.map +1 -0
  40. package/dist/ui/ChipSelect/chip-select.module.scss.js +6 -0
  41. package/dist/ui/ChipSelect/chip-select.module.scss.js.map +1 -0
  42. package/dist/ui/ChipSelect/index.d.ts +3 -0
  43. package/dist/ui/ChipSelect/index.d.ts.map +1 -0
  44. package/dist/ui/index.d.ts +1 -0
  45. package/dist/ui/index.d.ts.map +1 -1
  46. package/dist/ui.d.ts +2 -2
  47. package/dist/ui.js +1 -0
  48. package/dist/ui.js.map +1 -1
  49. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -428,6 +428,36 @@ svg {
428
428
  */
429
429
  --size-0-5: 0.25rem;
430
430
  --size-1-5: 0.75rem;
431
+ /*
432
+ * ── Type steps ─────────────────────────────────────────────────────────
433
+ *
434
+ * The sizes `Typography` sets per variant, exposed so an app can align its
435
+ * OWN rules to the same scale instead of copying the numbers into a
436
+ * stylesheet where they immediately start to drift.
437
+ *
438
+ * A component should still reach for the variant — `<Typography
439
+ * variant={'caption'}>` says what the text IS, where a raw size only says
440
+ * how big. These are for the CSS an app cannot express as a component:
441
+ * a badge's label, a table cell, a chip's count.
442
+ *
443
+ * ⚠️ `caption` is the FLOOR, and deliberately: 12px is about as small as
444
+ * sustained UI text can be and still be read at arm's length on a phone.
445
+ * The scale does not offer anything below it, and an app that wants
446
+ * something smaller is telling you its density is wrong.
447
+ *
448
+ * Headings keep their responsive overrides in the component — those are a
449
+ * breakpoint's business rather than the scale's.
450
+ */
451
+ --font-size-caption: 0.75rem;
452
+ --font-size-body2: 0.875rem;
453
+ --font-size-body1: 1rem;
454
+ --font-size-subtitle1: 1.0625rem;
455
+ --font-size-h6: 1.35rem;
456
+ --font-size-h5: 1.5rem;
457
+ --font-size-h4: 1.65rem;
458
+ --font-size-h3: 1.85rem;
459
+ --font-size-h2: 2.25rem;
460
+ --font-size-h1: 2.75rem;
431
461
  /*
432
462
  * ── Measure ────────────────────────────────────────────────────────────
433
463
  *
@@ -705,6 +735,27 @@ main.no-padding {
705
735
  padding: 0;
706
736
  }
707
737
 
738
+ /*
739
+ * ── Text and flex helpers ─────────────────────────────────────────────────
740
+ *
741
+ * The two that consumers kept writing for themselves. `--font-mono` is a token
742
+ * this library owns, so the utility that applies it belongs here rather than
743
+ * in every app that wants a figure to line up in a column; `Typography` still
744
+ * takes `mono` as a prop, and that is the better answer wherever the element
745
+ * is already a `Typography`. This is for the spans and cells that are not.
746
+ *
747
+ * `.grow` is `flex: 1` — the other half of `Column`'s `flex` prop, for a child
748
+ * that is not one of the layout primitives (a `Button` sharing a row, say).
749
+ */
750
+ .mono {
751
+ font-family: var(--font-mono);
752
+ font-variant-numeric: tabular-nums;
753
+ }
754
+
755
+ .grow {
756
+ flex: 1;
757
+ }
758
+
708
759
  .srOnly {
709
760
  border: 0;
710
761
  clip: rect(0, 0, 0, 0);
@@ -900,6 +951,43 @@ img {
900
951
  animation: pulse 1.5s ease-in-out infinite;
901
952
  }
902
953
 
954
+ /*
955
+ * Two more of the arrive family, both lifted out of an app that had written
956
+ * them itself. They differ from `fade-in` only in axis and distance, which is
957
+ * the whole vocabulary: a row slides in from the lead edge, a flash drops in.
958
+ *
959
+ * ⚠️ Shorter than `fade-in` on purpose. These play on things that arrive in
960
+ * NUMBERS — a list re-ordering, a count changing — where 280ms each reads as
961
+ * the page lurching rather than as a row appearing.
962
+ */
963
+ .row-in {
964
+ animation: row-in 180ms var(--easing-default) both;
965
+ }
966
+
967
+ @keyframes row-in {
968
+ from {
969
+ opacity: 0;
970
+ transform: translateX(-4px);
971
+ }
972
+ to {
973
+ opacity: 1;
974
+ transform: none;
975
+ }
976
+ }
977
+ .pulse-in {
978
+ animation: pulse-in 220ms var(--easing-default);
979
+ }
980
+
981
+ @keyframes pulse-in {
982
+ from {
983
+ opacity: 0;
984
+ transform: translateY(-3px);
985
+ }
986
+ to {
987
+ opacity: 1;
988
+ transform: none;
989
+ }
990
+ }
903
991
  /**
904
992
  * Chrome has a bug with transitions on load since 2012!
905
993
  *
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { Logo, LogoProps } from './brand.js';
2
- export { C as Checkbox, a as CheckboxProps, b as Combobox, c as ComboboxOption, d as ComboboxProps, D as DatePicker, e as DatePickerProps, F as FormTheme, L as Label, f as LabelProps, S as Select, g as SelectAlign, h as SelectContent, i as SelectContentProps, j as SelectField, k as SelectFieldProps, l as SelectGroup, m as SelectItem, n as SelectPosition, o as SelectProps, p as SelectSeparator, q as SelectSide, r as SelectTrigger, s as SelectValue, t as __Surface } from './index-CywSNvOU.js';
2
+ export { C as Checkbox, a as CheckboxProps, b as Combobox, c as ComboboxOption, d as ComboboxProps, D as DatePicker, e as DatePickerProps, F as FormTheme, L as Label, f as LabelProps, S as Select, g as SelectAlign, h as SelectContent, i as SelectContentProps, j as SelectField, k as SelectFieldProps, l as SelectGroup, m as SelectItem, n as SelectPosition, o as SelectProps, p as SelectSeparator, q as SelectSide, r as SelectTrigger, s as SelectValue, t as __Surface } from './index-DhS2nQjt.js';
3
3
  export { I as Input, a as InputBaseProps } from './input-Cp5LET5i.js';
4
4
  import * as React from 'react';
5
- import { S as SidebarContextValue } from './index-DOKRFZ3I.js';
6
- export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, q as ContainerProps, G as Grid, r as GridColumns, s as GridProps, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, U as SidebarVariant, V as Skeleton } from './index-DOKRFZ3I.js';
7
- import { A as AlertContextValue, S as SortState } from './index-D81GIX01.js';
8
- export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, e as AlertMessage, f as AlertProps, g as AlertProvider, h as AlertTheme, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as CodeBlock, r as CodeBlockProps, D as DevIndicator, s as DevIndicatorProps, t as Dialog, u as DialogClose, v as DialogCloseProps, w as DialogContent, x as DialogContentProps, y as DialogDescription, z as DialogFooter, B as DialogHeader, E as DialogOverlay, F as DialogPortal, G as DialogProps, H as DialogTitle, I as DialogTrigger, J as DialogTriggerProps, K as EmptyState, L as EmptyStateProps, M as Icon, N as IconProps, O as List, P as ListItem, Q as ListItemProps, R as ListProps, T as Pagination, U as PaginationProps, V as ProgressBar, W as ProgressBarProps, X as PushAlertInput, Y as Separator, Z as SeparatorProps, _ as SortContextValue, $ as SortDirection, a0 as StatCard, a1 as StatCardDirection, a2 as StatCardProps, a3 as StatCardSize, a4 as StatCardTheme, a5 as StatCardVariant, a6 as StatusDot, a7 as StatusDotProps, a8 as Step, a9 as StepProgress, aa as StepProgressProps, ab as Switch, ac as SwitchProps, ad as Table, ae as TableActionCell, af as TableActionCellProps, ag as TableActionItem, ah as TableBody, ai as TableBodyProps, aj as TableCard, ak as TableCell, al as TableFooter, am as TableHead, an as TableHeader, ao as TableRow, ap as TableSortableHeader, aq as TableSortableHeaderProps, ar as TableToolbar, as as TableToolbarProps, at as Toggle, au as ToggleGroup, av as ToggleGroupProps, aw as ToggleProps, ax as TrendDirection, ay as persistAlert, az as statusDotVariants } from './index-D81GIX01.js';
5
+ import { S as SidebarContextValue } from './index-DxbOGj5Y.js';
6
+ export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, q as ContainerProps, G as Grid, r as GridColumns, s as GridProps, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, U as SidebarVariant, V as Skeleton } from './index-DxbOGj5Y.js';
7
+ import { A as AlertContextValue, S as SortState } from './index-p7kVnzRy.js';
8
+ export { a as Alert, b as AlertBanner, c as AlertBannerProps, d as AlertDescription, e as AlertMessage, f as AlertProps, g as AlertProvider, h as AlertTheme, i as AlertTitle, j as Avatar, k as AvatarFallback, l as AvatarFallbackProps, m as AvatarImage, n as AvatarImageProps, o as AvatarProps, C as Chip, p as ChipProps, q as ChipSelect, r as ChipSelectOption, s as ChipSelectProps, t as CodeBlock, u as CodeBlockProps, D as DevIndicator, v as DevIndicatorProps, w as Dialog, x as DialogClose, y as DialogCloseProps, z as DialogContent, B as DialogContentProps, E as DialogDescription, F as DialogFooter, G as DialogHeader, H as DialogOverlay, I as DialogPortal, J as DialogProps, K as DialogTitle, L as DialogTrigger, M as DialogTriggerProps, N as EmptyState, O as EmptyStateProps, P as Icon, Q as IconProps, R as List, T as ListItem, U as ListItemProps, V as ListProps, W as Pagination, X as PaginationProps, Y as ProgressBar, Z as ProgressBarProps, _ as PushAlertInput, $ as Separator, a0 as SeparatorProps, a1 as SortContextValue, a2 as SortDirection, a3 as StatCard, a4 as StatCardDirection, a5 as StatCardProps, a6 as StatCardSize, a7 as StatCardTheme, a8 as StatCardVariant, a9 as StatusDot, aa as StatusDotProps, ab as Step, ac as StepProgress, ad as StepProgressProps, ae as Switch, af as SwitchProps, ag as Table, ah as TableActionCell, ai as TableActionCellProps, aj as TableActionItem, ak as TableBody, al as TableBodyProps, am as TableCard, an as TableCell, ao as TableFooter, ap as TableHead, aq as TableHeader, ar as TableRow, as as TableSortableHeader, at as TableSortableHeaderProps, au as TableToolbar, av as TableToolbarProps, aw as Toggle, ax as ToggleGroup, ay as ToggleGroupProps, az as ToggleProps, aA as TrendDirection, aB as persistAlert, aC as statusDotVariants } from './index-p7kVnzRy.js';
9
9
  export { R as RowProps } from './row-CuhTBQhK.js';
10
10
  export { Breadcrumbs, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DropdownMenuTriggerProps, Link, LinkProps, RouterAdapter, RouterProvider, Sheet, SheetBody, SheetClose, SheetCloseProps, SheetContent, SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetProps, SheetTitle, SheetTrigger, SheetTriggerProps, useRouterAdapter } from './navigation.js';
11
11
  export { B as BreadcrumbItemData, N as NavGroup, a as NavItem, b as NavUser, c as NavUserProps, S as SidebarNavItem, d as SidebarSection } from './nav-user-CilmWvtr.js';
@@ -13,7 +13,7 @@ export { AppearanceTabs, AppearanceToggleDropdown } from './settings.js';
13
13
  export { a as User, b as UserMenuContent, U as UserMenuContentProps, c as UserMenuItem } from './user-menu-content-D0Ldzigm.js';
14
14
  export { Heading, TruncatedText, TruncatedTextProps } from './typography.js';
15
15
  export { T as Typography, a as TypographyAlign, b as TypographyProps, c as TypographySize, d as TypographyTheme, e as TypographyTransform, f as TypographyVariant, g as TypographyWeight } from './typography-CTGVc_Gg.js';
16
- export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-540OmbEG.js';
16
+ export { B as Button, a as ButtonProps, T as Tooltip, b as TooltipContent, c as TooltipContentProps, d as TooltipProps, e as TooltipProvider, f as TooltipTrigger, g as TooltipTriggerProps } from './tooltip-DXoSckt9.js';
17
17
  export { UserInfo } from './user.js';
18
18
  export { CONSTELLATION_PORTAL_SELECTOR, getCsrfToken, isInConstellationPortal } from './utils.js';
19
19
  import 'class-variance-authority';
package/dist/index.js CHANGED
@@ -46,6 +46,7 @@ export { AlertProvider } from './ui/Alert/alert-provider.js';
46
46
  export { Avatar, AvatarFallback, AvatarImage } from './ui/Avatar/avatar.js';
47
47
  export { Button } from './ui/Button/button.js';
48
48
  export { Chip } from './ui/Chip/chip.js';
49
+ export { ChipSelect } from './ui/ChipSelect/chip-select.js';
49
50
  export { CodeBlock } from './ui/CodeBlock/code-block.js';
50
51
  export { DevIndicator } from './ui/DevIndicator/dev-indicator.js';
51
52
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './ui/Dialog/dialog.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -14,6 +14,7 @@ import '../../ui/Alert/alert.css';
14
14
  import '../../ui/Avatar/avatar.js';
15
15
  import '../../ui/Button/button.js';
16
16
  import '../../ui/Chip/chip.js';
17
+ import '../../ui/ChipSelect/chip-select.js';
17
18
  import '../../ui/CodeBlock/code-block.js';
18
19
  import cn from 'clsx';
19
20
  import '../../ui/DevIndicator/dev-indicator.css';
@@ -1 +1 @@
1
- {"version":3,"file":"app-sidebar-header.js","sources":["../../../src/layout/AppSidebarHeader/app-sidebar-header.tsx"],"sourcesContent":["import { useSidebar } from '@constellation/hooks';\nimport { Row } from '@constellation/layout/Row';\nimport { SidebarTrigger } from '@constellation/layout/Sidebar';\nimport { Breadcrumbs } from '@constellation/navigation/Breadcrumbs';\nimport { NavUser, type NavUserProps } from '@constellation/navigation/NavUser';\nimport { AppearanceToggleDropdown } from '@constellation/settings';\nimport { type BreadcrumbItemData } from '@constellation/types';\nimport cn from 'clsx';\nimport * as React from 'react';\nimport s from './app-sidebar-header.module.scss';\n\nexport interface AppSidebarHeaderProps extends React.HTMLAttributes<HTMLElement> {\n breadcrumbs?: BreadcrumbItemData[];\n /** Omit to hide the account menu (e.g. on signed-out chrome). */\n user?: NavUserProps['user'];\n userMenu?: Omit<NavUserProps, 'user'>;\n /** Extra controls between the appearance toggle and the account menu. */\n actions?: React.ReactNode;\n}\n\n/**\n * The header band of a content area.\n *\n * `className` and any other DOM props reach the `header` element. They used to\n * be dropped on the floor — the component took four named props and spread\n * nothing — so a caller passing `className` got no error and no class, and\n * spent the difference looking at its own stylesheet.\n */\nexport function AppSidebarHeader({\n breadcrumbs = [],\n user,\n userMenu,\n actions,\n className,\n ...props\n}: AppSidebarHeaderProps) {\n const { state } = useSidebar();\n\n return (\n <Row\n data-slot={'app-sidebar-header'}\n el={'header'}\n align={'center'}\n gap={1}\n justify={'space-between'}\n className={cn(\n s['app-sidebar-header'],\n state === 'collapsed' && s['sidebar-header-collapsed'],\n className,\n )}\n {...props}\n >\n <Row gap={1}>\n <SidebarTrigger />\n <Breadcrumbs breadcrumbs={breadcrumbs} />\n </Row>\n <Row gap={1} align={'center'}>\n {actions}\n <AppearanceToggleDropdown />\n {user && <NavUser user={user} {...userMenu} />}\n </Row>\n </Row>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;AAOG;SACa,gBAAgB,CAAC,EAC/B,WAAW,GAAG,EAAE,EAChB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACc,EAAA;AACtB,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE;IAE9B,QACEA,KAAC,GAAG,EAAA,EAAA,WAAA,EACS,oBAAoB,EAC/B,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,QAAQ,EACf,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,EAAE,CACX,CAAC,CAAC,oBAAoB,CAAC,EACvB,KAAK,KAAK,WAAW,IAAI,CAAC,CAAC,0BAA0B,CAAC,EACtD,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAAA,CAETA,IAAA,CAAC,GAAG,EAAA,EAAC,GAAG,EAAE,CAAC,aACTC,GAAA,CAAC,cAAc,KAAG,EAClBA,GAAA,CAAC,WAAW,EAAA,EAAC,WAAW,EAAE,WAAW,EAAA,CAAI,IACrC,EACND,IAAA,CAAC,GAAG,EAAA,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAA,QAAA,EAAA,CACzB,OAAO,EACRC,GAAA,CAAC,wBAAwB,EAAA,EAAA,CAAG,EAC3B,IAAI,IAAIA,GAAA,CAAC,OAAO,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA,GAAM,QAAQ,EAAA,CAAI,CAAA,EAAA,CAC1C,CAAA,EAAA,CACF;AAEV;;"}
1
+ {"version":3,"file":"app-sidebar-header.js","sources":["../../../src/layout/AppSidebarHeader/app-sidebar-header.tsx"],"sourcesContent":["import { useSidebar } from '@constellation/hooks';\nimport { Row } from '@constellation/layout/Row';\nimport { SidebarTrigger } from '@constellation/layout/Sidebar';\nimport { Breadcrumbs } from '@constellation/navigation/Breadcrumbs';\nimport { NavUser, type NavUserProps } from '@constellation/navigation/NavUser';\nimport { AppearanceToggleDropdown } from '@constellation/settings';\nimport { type BreadcrumbItemData } from '@constellation/types';\nimport cn from 'clsx';\nimport * as React from 'react';\nimport s from './app-sidebar-header.module.scss';\n\nexport interface AppSidebarHeaderProps extends React.HTMLAttributes<HTMLElement> {\n breadcrumbs?: BreadcrumbItemData[];\n /** Omit to hide the account menu (e.g. on signed-out chrome). */\n user?: NavUserProps['user'];\n userMenu?: Omit<NavUserProps, 'user'>;\n /** Extra controls between the appearance toggle and the account menu. */\n actions?: React.ReactNode;\n}\n\n/**\n * The header band of a content area.\n *\n * `className` and any other DOM props reach the `header` element. They used to\n * be dropped on the floor — the component took four named props and spread\n * nothing — so a caller passing `className` got no error and no class, and\n * spent the difference looking at its own stylesheet.\n */\nexport function AppSidebarHeader({\n breadcrumbs = [],\n user,\n userMenu,\n actions,\n className,\n ...props\n}: AppSidebarHeaderProps) {\n const { state } = useSidebar();\n\n return (\n <Row\n data-slot={'app-sidebar-header'}\n el={'header'}\n align={'center'}\n gap={1}\n justify={'space-between'}\n className={cn(\n s['app-sidebar-header'],\n state === 'collapsed' && s['sidebar-header-collapsed'],\n className,\n )}\n {...props}\n >\n <Row gap={1}>\n <SidebarTrigger />\n <Breadcrumbs breadcrumbs={breadcrumbs} />\n </Row>\n <Row gap={1} align={'center'}>\n {actions}\n <AppearanceToggleDropdown />\n {user && <NavUser user={user} {...userMenu} />}\n </Row>\n </Row>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;AAOG;SACa,gBAAgB,CAAC,EAC/B,WAAW,GAAG,EAAE,EAChB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACc,EAAA;AACtB,IAAA,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE;IAE9B,QACEA,KAAC,GAAG,EAAA,EAAA,WAAA,EACS,oBAAoB,EAC/B,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,QAAQ,EACf,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,eAAe,EACxB,SAAS,EAAE,EAAE,CACX,CAAC,CAAC,oBAAoB,CAAC,EACvB,KAAK,KAAK,WAAW,IAAI,CAAC,CAAC,0BAA0B,CAAC,EACtD,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAAA,CAETA,IAAA,CAAC,GAAG,EAAA,EAAC,GAAG,EAAE,CAAC,aACTC,GAAA,CAAC,cAAc,KAAG,EAClBA,GAAA,CAAC,WAAW,EAAA,EAAC,WAAW,EAAE,WAAW,EAAA,CAAI,IACrC,EACND,IAAA,CAAC,GAAG,EAAA,EAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAA,QAAA,EAAA,CACzB,OAAO,EACRC,GAAA,CAAC,wBAAwB,EAAA,EAAA,CAAG,EAC3B,IAAI,IAAIA,GAAA,CAAC,OAAO,EAAA,EAAC,IAAI,EAAE,IAAI,EAAA,GAAM,QAAQ,EAAA,CAAI,CAAA,EAAA,CAC1C,CAAA,EAAA,CACF;AAEV;;"}
package/dist/layout.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, G as Grid, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, V as Skeleton } from './index-DOKRFZ3I.js';
1
+ export { A as AppContent, a as AppContentFooter, b as AppContentFooterProps, c as AppContentMain, d as AppContentMainProps, e as AppFooter, f as AppFooterProps, g as AppShell, h as AppShellProps, i as AppSidebar, j as AppSidebarHeader, k as AppSidebarHeaderProps, l as AppSidebarProps, C as Collapse, m as CollapseProps, n as Column, o as ColumnProps, p as Container, G as Grid, R as Row, t as Sidebar, u as SidebarContent, v as SidebarFooter, w as SidebarGroup, x as SidebarGroupAction, y as SidebarGroupContent, z as SidebarGroupLabel, B as SidebarHeader, D as SidebarInput, E as SidebarInset, F as SidebarMenu, H as SidebarMenuAction, I as SidebarMenuBadge, J as SidebarMenuButton, K as SidebarMenuItem, L as SidebarMenuSkeleton, M as SidebarMenuSub, N as SidebarMenuSubButton, O as SidebarMenuSubItem, P as SidebarProvider, Q as SidebarRail, T as SidebarTrigger, V as Skeleton } from './index-DxbOGj5Y.js';
2
2
  export { R as RowProps } from './row-CuhTBQhK.js';
3
3
  import 'react';
4
4
  import './nav-user-CilmWvtr.js';
5
5
  import 'lucide-react';
6
6
  import './user-menu-content-D0Ldzigm.js';
7
7
  import './input-Cp5LET5i.js';
8
- import './tooltip-540OmbEG.js';
8
+ import './tooltip-DXoSckt9.js';
9
9
  import 'class-variance-authority';
10
10
  import 'class-variance-authority/types';
@@ -7,6 +7,7 @@ import '../../ui/Alert/alert.css';
7
7
  import '../../ui/Avatar/avatar.js';
8
8
  import { Button } from '../../ui/Button/button.js';
9
9
  import '../../ui/Chip/chip.js';
10
+ import '../../ui/ChipSelect/chip-select.js';
10
11
  import '../../ui/CodeBlock/code-block.js';
11
12
  import cn from 'clsx';
12
13
  import '../../ui/DevIndicator/dev-indicator.css';
@@ -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,cAAc,EAAE,WAAW,GAAG,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAc,EAAA;AAC9F,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;AACnE,IAAA,MAAM,YAAY,GAAG,cAAc,KAAK,SAAS;IACjD,MAAM,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY;AACzD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAA,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,EAAE;IAEnC,MAAM,gBAAgB,GAAG,KAAK,CAAC,WAAW,CACxC,CAAC,IAAa,KAA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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,KAAK,CAAC,uDAAuD,CAAC;AAClF,IAAA,OAAO,GAAG;AACZ;AAWA,SAAS,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,GAAG,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAc,EAAA;AAC9F,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;AACnE,IAAA,MAAM,YAAY,GAAG,cAAc,KAAK,SAAS;IACjD,MAAM,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY;AACzD,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK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9B,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?: "inherit" | "primary" | "secondary" | "info" | "success" | "warning" | "destructive" | "slate" | null | undefined;
65
+ theme?: "destructive" | "inherit" | "primary" | "secondary" | "warning" | "success" | "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> {
@@ -10,6 +10,7 @@ import '../../ui/Alert/alert.css';
10
10
  import '../../ui/Avatar/avatar.js';
11
11
  import { Button } from '../../ui/Button/button.js';
12
12
  import '../../ui/Chip/chip.js';
13
+ import '../../ui/ChipSelect/chip-select.js';
13
14
  import '../../ui/CodeBlock/code-block.js';
14
15
  import cn from 'clsx';
15
16
  import '../../ui/DevIndicator/dev-indicator.css';
@@ -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,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;;"}
package/dist/tokens.css CHANGED
@@ -251,6 +251,36 @@
251
251
  */
252
252
  --size-0-5: 0.25rem;
253
253
  --size-1-5: 0.75rem;
254
+ /*
255
+ * ── Type steps ─────────────────────────────────────────────────────────
256
+ *
257
+ * The sizes `Typography` sets per variant, exposed so an app can align its
258
+ * OWN rules to the same scale instead of copying the numbers into a
259
+ * stylesheet where they immediately start to drift.
260
+ *
261
+ * A component should still reach for the variant — `<Typography
262
+ * variant={'caption'}>` says what the text IS, where a raw size only says
263
+ * how big. These are for the CSS an app cannot express as a component:
264
+ * a badge's label, a table cell, a chip's count.
265
+ *
266
+ * ⚠️ `caption` is the FLOOR, and deliberately: 12px is about as small as
267
+ * sustained UI text can be and still be read at arm's length on a phone.
268
+ * The scale does not offer anything below it, and an app that wants
269
+ * something smaller is telling you its density is wrong.
270
+ *
271
+ * Headings keep their responsive overrides in the component — those are a
272
+ * breakpoint's business rather than the scale's.
273
+ */
274
+ --font-size-caption: 0.75rem;
275
+ --font-size-body2: 0.875rem;
276
+ --font-size-body1: 1rem;
277
+ --font-size-subtitle1: 1.0625rem;
278
+ --font-size-h6: 1.35rem;
279
+ --font-size-h5: 1.5rem;
280
+ --font-size-h4: 1.65rem;
281
+ --font-size-h3: 1.85rem;
282
+ --font-size-h2: 2.25rem;
283
+ --font-size-h1: 2.75rem;
254
284
  /*
255
285
  * ── Measure ────────────────────────────────────────────────────────────
256
286
  *
@@ -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?: "ghost" | "outlined" | "contained" | null | undefined;
7
+ theme?: "primary" | "secondary" | "info" | "success" | "warning" | "destructive" | "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 };
@@ -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?: "outlined" | "contained" | "ghost" | null | undefined;
7
+ theme?: "primary" | "secondary" | "info" | "success" | "warning" | "destructive" | "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 };
@@ -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?: "outlined" | "ghost" | "contained" | null | undefined;
7
+ theme?: "inherit" | "primary" | "secondary" | "success" | "destructive" | "warning" | "info" | "slate" | 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 };
@@ -28,7 +28,7 @@
28
28
  }
29
29
  .typography-module_typography__FAx__.typography-module_h1__Chrx6 {
30
30
  color: var(--text-heading);
31
- --typography-font-size: 2.75rem;
31
+ --typography-font-size: var(--font-size-h1);
32
32
  line-height: 1.25;
33
33
  }
34
34
  @media (max-width: 768px) {
@@ -38,7 +38,7 @@
38
38
  }
39
39
  .typography-module_typography__FAx__.typography-module_h2__6Qpwf {
40
40
  color: var(--text-heading);
41
- --typography-font-size: 2.25rem;
41
+ --typography-font-size: var(--font-size-h2);
42
42
  line-height: 1.25;
43
43
  }
44
44
  @media (max-width: 768px) {
@@ -58,7 +58,7 @@
58
58
  }
59
59
  .typography-module_typography__FAx__.typography-module_h4__TEi6l {
60
60
  color: var(--text-heading);
61
- --typography-font-size: 1.85rem;
61
+ --typography-font-size: var(--font-size-h3);
62
62
  line-height: 1.25;
63
63
  }
64
64
  @media (max-width: 768px) {
@@ -68,7 +68,7 @@
68
68
  }
69
69
  .typography-module_typography__FAx__.typography-module_h5__pY2ZF {
70
70
  color: var(--text-heading);
71
- --typography-font-size: 1.65rem;
71
+ --typography-font-size: var(--font-size-h4);
72
72
  font-weight: 500;
73
73
  line-height: 1.25;
74
74
  }
@@ -79,7 +79,7 @@
79
79
  }
80
80
  .typography-module_typography__FAx__.typography-module_h6__jzeAZ {
81
81
  color: var(--text-heading);
82
- --typography-font-size: 1.5rem;
82
+ --typography-font-size: var(--font-size-h5);
83
83
  line-height: 1.25;
84
84
  }
85
85
  @media (max-width: 768px) {
@@ -88,34 +88,34 @@
88
88
  }
89
89
  }
90
90
  .typography-module_typography__FAx__.typography-module_subtitle1__kbXoE {
91
- --typography-font-size: 1.0625rem;
91
+ --typography-font-size: var(--font-size-subtitle1);
92
92
  font-weight: 500;
93
93
  }
94
94
  .typography-module_typography__FAx__.typography-module_subtitle2__TesJV {
95
- --typography-font-size: 0.875rem;
95
+ --typography-font-size: var(--font-size-body2);
96
96
  font-weight: 500;
97
97
  }
98
98
  .typography-module_typography__FAx__.typography-module_body1__XiHhz {
99
- --typography-font-size: 1rem;
99
+ --typography-font-size: var(--font-size-body1);
100
100
  }
101
101
  .typography-module_typography__FAx__.typography-module_body2__321Bc {
102
102
  color: var(--text-secondary);
103
- --typography-font-size: 0.875rem;
103
+ --typography-font-size: var(--font-size-body2);
104
104
  }
105
105
  .typography-module_typography__FAx__.typography-module_overline__NaSU- {
106
- --typography-font-size: 0.875rem;
106
+ --typography-font-size: var(--font-size-body2);
107
107
  letter-spacing: 1px;
108
108
  text-transform: uppercase;
109
109
  }
110
110
  .typography-module_typography__FAx__.typography-module_caption__BAaLD {
111
- --typography-font-size: 0.75rem;
111
+ --typography-font-size: var(--font-size-caption);
112
112
  }
113
113
  .typography-module_typography__FAx__.typography-module_code__MiYWd {
114
114
  background: var(--action-hover);
115
115
  border-radius: 5px;
116
116
  --typography-font: var(--font-mono);
117
117
  --typography-font-fallback: monospace;
118
- --typography-font-size: 0.75rem;
118
+ --typography-font-size: var(--font-size-caption);
119
119
  padding: 4px var(--size-1);
120
120
  }
121
121
  .typography-module_typography__FAx__.typography-module_code-block__cdgeP {
@@ -130,7 +130,7 @@
130
130
  white-space: pre;
131
131
  }
132
132
  .typography-module_typography__FAx__.typography-module_tooltip__ZScRV {
133
- --typography-font-size: 0.75rem;
133
+ --typography-font-size: var(--font-size-caption);
134
134
  font-weight: 200;
135
135
  text-transform: uppercase;
136
136
  }
@@ -159,7 +159,7 @@
159
159
  }
160
160
  }
161
161
  .typography-module_typography__FAx__.typography-module_table-cell-small__G0MyC {
162
- --typography-font-size: 0.75rem;
162
+ --typography-font-size: var(--font-size-caption);
163
163
  }
164
164
  @media (min-width: 1360px) {
165
165
  .typography-module_typography__FAx__.typography-module_table-cell-small__G0MyC {