@ratio-ui/core 0.2.0 → 0.4.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 (143) hide show
  1. package/dist/catalogue.json +2690 -749
  2. package/dist/components/accordion/Accordion.d.ts +19 -0
  3. package/dist/components/accordion/Accordion.js +52 -0
  4. package/dist/components/accordion/index.d.ts +2 -0
  5. package/dist/components/accordion/index.js +1 -0
  6. package/dist/components/alert/Alert.d.ts +18 -0
  7. package/dist/components/alert/Alert.js +67 -0
  8. package/dist/components/alert/index.d.ts +2 -0
  9. package/dist/components/alert/index.js +1 -0
  10. package/dist/components/alert-dialog/AlertDialog.d.ts +48 -0
  11. package/dist/components/alert-dialog/AlertDialog.js +76 -0
  12. package/dist/components/alert-dialog/index.d.ts +2 -0
  13. package/dist/components/alert-dialog/index.js +1 -0
  14. package/dist/components/app-shell/AppShell.js +1 -1
  15. package/dist/components/breadcrumb/Breadcrumb.d.ts +19 -0
  16. package/dist/components/breadcrumb/Breadcrumb.js +50 -0
  17. package/dist/components/breadcrumb/index.d.ts +2 -0
  18. package/dist/components/breadcrumb/index.js +1 -0
  19. package/dist/components/calendar/Calendar.d.ts +20 -0
  20. package/dist/components/calendar/Calendar.js +119 -0
  21. package/dist/components/calendar/index.d.ts +2 -0
  22. package/dist/components/calendar/index.js +1 -0
  23. package/dist/components/chart/Chart.d.ts +137 -0
  24. package/dist/components/chart/Chart.js +238 -0
  25. package/dist/components/chart/index.d.ts +2 -0
  26. package/dist/components/chart/index.js +1 -0
  27. package/dist/components/checkbox-list/CheckboxList.d.ts +36 -0
  28. package/dist/components/checkbox-list/CheckboxList.js +93 -0
  29. package/dist/components/checkbox-list/index.d.ts +2 -0
  30. package/dist/components/checkbox-list/index.js +1 -0
  31. package/dist/components/collapsible/Collapsible.d.ts +24 -0
  32. package/dist/components/collapsible/Collapsible.js +58 -0
  33. package/dist/components/collapsible/index.d.ts +2 -0
  34. package/dist/components/collapsible/index.js +1 -0
  35. package/dist/components/combobox/Combobox.d.ts +52 -0
  36. package/dist/components/combobox/Combobox.js +92 -0
  37. package/dist/components/combobox/index.d.ts +2 -0
  38. package/dist/components/combobox/index.js +1 -0
  39. package/dist/components/data-table/DataTable.js +2 -2
  40. package/dist/components/date-picker/DatePicker.d.ts +34 -0
  41. package/dist/components/date-picker/DatePicker.js +108 -0
  42. package/dist/components/date-picker/index.d.ts +2 -0
  43. package/dist/components/date-picker/index.js +1 -0
  44. package/dist/components/date-range-picker/DateRangePicker.d.ts +40 -0
  45. package/dist/components/date-range-picker/DateRangePicker.js +146 -0
  46. package/dist/components/date-range-picker/index.d.ts +2 -0
  47. package/dist/components/date-range-picker/index.js +1 -0
  48. package/dist/components/drawer/Drawer.d.ts +52 -0
  49. package/dist/components/drawer/Drawer.js +120 -0
  50. package/dist/components/drawer/index.d.ts +2 -0
  51. package/dist/components/drawer/index.js +1 -0
  52. package/dist/components/field/Field.d.ts +38 -0
  53. package/dist/components/field/Field.js +73 -0
  54. package/dist/components/field/Label.d.ts +8 -0
  55. package/dist/components/field/Label.js +13 -0
  56. package/dist/components/field/index.d.ts +3 -0
  57. package/dist/components/field/index.js +3 -0
  58. package/dist/components/filter-tabs/FilterTabs.js +1 -1
  59. package/dist/components/global-search/GlobalSearch.js +1 -1
  60. package/dist/components/icon/registry.d.ts +2 -2
  61. package/dist/components/icon/registry.js +5 -1
  62. package/dist/components/input-group/InputGroup.js +1 -1
  63. package/dist/components/input-otp/InputOtp.d.ts +43 -0
  64. package/dist/components/input-otp/InputOtp.js +45 -0
  65. package/dist/components/input-otp/index.d.ts +2 -0
  66. package/dist/components/input-otp/index.js +1 -0
  67. package/dist/components/key-value-list/KeyValueList.d.ts +25 -0
  68. package/dist/components/key-value-list/KeyValueList.js +40 -0
  69. package/dist/components/key-value-list/index.d.ts +2 -0
  70. package/dist/components/key-value-list/index.js +1 -0
  71. package/dist/components/link/Link.d.ts +22 -0
  72. package/dist/components/link/Link.js +31 -0
  73. package/dist/components/link/index.d.ts +2 -0
  74. package/dist/components/link/index.js +1 -0
  75. package/dist/components/media-grid/MediaGrid.d.ts +49 -0
  76. package/dist/components/media-grid/MediaGrid.js +303 -0
  77. package/dist/components/media-grid/index.d.ts +2 -0
  78. package/dist/components/media-grid/index.js +1 -0
  79. package/dist/components/money-input/MoneyInput.d.ts +30 -0
  80. package/dist/components/money-input/MoneyInput.js +72 -0
  81. package/dist/components/money-input/index.d.ts +2 -0
  82. package/dist/components/money-input/index.js +1 -0
  83. package/dist/components/page-header/PageHeader.js +9 -9
  84. package/dist/components/progress/Progress.d.ts +25 -0
  85. package/dist/components/progress/Progress.js +38 -0
  86. package/dist/components/progress/index.d.ts +2 -0
  87. package/dist/components/progress/index.js +1 -0
  88. package/dist/components/radio-group/RadioGroup.d.ts +18 -0
  89. package/dist/components/radio-group/RadioGroup.js +32 -0
  90. package/dist/components/radio-group/index.d.ts +2 -0
  91. package/dist/components/radio-group/index.js +1 -0
  92. package/dist/components/save-bar/SaveBar.d.ts +27 -0
  93. package/dist/components/save-bar/SaveBar.js +37 -0
  94. package/dist/components/save-bar/index.d.ts +2 -0
  95. package/dist/components/save-bar/index.js +1 -0
  96. package/dist/components/scroll-area/ScrollArea.d.ts +12 -0
  97. package/dist/components/scroll-area/ScrollArea.js +34 -0
  98. package/dist/components/scroll-area/index.d.ts +2 -0
  99. package/dist/components/scroll-area/index.js +1 -0
  100. package/dist/components/search-field/SearchField.js +1 -1
  101. package/dist/components/select/Select.d.ts +40 -0
  102. package/dist/components/select/Select.js +84 -0
  103. package/dist/components/select/index.d.ts +2 -0
  104. package/dist/components/select/index.js +1 -0
  105. package/dist/components/separator/Separator.d.ts +15 -0
  106. package/dist/components/separator/Separator.js +25 -0
  107. package/dist/components/separator/index.d.ts +2 -0
  108. package/dist/components/separator/index.js +1 -0
  109. package/dist/components/sheet/Sheet.d.ts +52 -0
  110. package/dist/components/sheet/Sheet.js +89 -0
  111. package/dist/components/sheet/index.d.ts +2 -0
  112. package/dist/components/sheet/index.js +1 -0
  113. package/dist/components/side-nav/SideNav.js +3 -3
  114. package/dist/components/summary-chips/SummaryChips.d.ts +17 -0
  115. package/dist/components/summary-chips/SummaryChips.js +19 -0
  116. package/dist/components/summary-chips/index.d.ts +2 -0
  117. package/dist/components/summary-chips/index.js +1 -0
  118. package/dist/components/switch/Switch.d.ts +10 -0
  119. package/dist/components/switch/Switch.js +20 -0
  120. package/dist/components/switch/index.d.ts +2 -0
  121. package/dist/components/switch/index.js +1 -0
  122. package/dist/components/table/Table.js +1 -1
  123. package/dist/components/tag-input/TagInput.d.ts +44 -0
  124. package/dist/components/tag-input/TagInput.js +102 -0
  125. package/dist/components/tag-input/index.d.ts +2 -0
  126. package/dist/components/tag-input/index.js +1 -0
  127. package/dist/components/textarea/Textarea.d.ts +15 -0
  128. package/dist/components/textarea/Textarea.js +21 -0
  129. package/dist/components/textarea/index.d.ts +2 -0
  130. package/dist/components/textarea/index.js +1 -0
  131. package/dist/components/top-bar/StoreSwitcher.js +1 -1
  132. package/dist/components/top-bar/TopBar.js +2 -2
  133. package/dist/components/unit-input/UnitInput.d.ts +33 -0
  134. package/dist/components/unit-input/UnitInput.js +47 -0
  135. package/dist/components/unit-input/index.d.ts +2 -0
  136. package/dist/components/unit-input/index.js +1 -0
  137. package/dist/index.d.ts +70 -9
  138. package/dist/index.js +38 -7
  139. package/dist/lib/cn.js +9 -2
  140. package/dist/lib/format.d.ts +65 -4
  141. package/dist/lib/format.js +163 -6
  142. package/dist/styles.css +1 -1
  143. package/package.json +129 -1
@@ -0,0 +1,12 @@
1
+ import { JSX, ReactNode, Ref } from "react";
2
+ /** The props of ScrollArea. */
3
+ export type ScrollAreaProps = {
4
+ /** The scrolling content. */
5
+ children: ReactNode;
6
+ /** Which scrollbars to offer. Defaults to vertical. */
7
+ orientation?: 'vertical' | 'horizontal' | 'both';
8
+ /** Receives the rendered element. */
9
+ ref?: Ref<HTMLDivElement>;
10
+ };
11
+ /** A scrolling region that fills its parent, which sets the height or width, with a thin scrollbar in the design system greys. */
12
+ export declare function ScrollArea({ children, orientation, ref }: ScrollAreaProps): JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { ScrollArea } from "@base-ui/react/scroll-area";
4
+ // src/components/scroll-area/ScrollArea.tsx
5
+ function Bar({ orientation }) {
6
+ return /* @__PURE__ */ jsx(ScrollArea.Scrollbar, {
7
+ "data-slot": "scroll-area-scrollbar",
8
+ orientation,
9
+ className: cn("rt:flex rt:touch-none rt:p-px rt:select-none rt:data-horizontal:h-1.5 rt:data-horizontal:flex-col rt:data-vertical:h-full rt:data-vertical:w-1.5"),
10
+ children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {
11
+ "data-slot": "scroll-area-thumb",
12
+ className: "rt:relative rt:flex-1 rt:rounded-sm rt:bg-border-strong rt:transition-colors rt:hover:bg-foreground-subdued"
13
+ })
14
+ });
15
+ }
16
+ /** A scrolling region that fills its parent, which sets the height or width, with a thin scrollbar in the design system greys. */
17
+ function ScrollArea$1({ children, orientation = "vertical", ref }) {
18
+ return /* @__PURE__ */ jsxs(ScrollArea.Root, {
19
+ ref,
20
+ "data-slot": "scroll-area",
21
+ className: "rt:relative rt:size-full",
22
+ children: [
23
+ /* @__PURE__ */ jsx(ScrollArea.Viewport, {
24
+ "data-slot": "scroll-area-viewport",
25
+ className: "rt:size-full rt:outline-none rt:focus-visible:focus-ring",
26
+ children
27
+ }),
28
+ orientation !== "horizontal" && /* @__PURE__ */ jsx(Bar, { orientation: "vertical" }),
29
+ orientation !== "vertical" && /* @__PURE__ */ jsx(Bar, { orientation: "horizontal" }),
30
+ /* @__PURE__ */ jsx(ScrollArea.Corner, {})
31
+ ]
32
+ });
33
+ }
34
+ export { ScrollArea$1 as ScrollArea };
@@ -0,0 +1,2 @@
1
+ import { ScrollArea, ScrollAreaProps } from "./ScrollArea.js";
2
+ export { ScrollArea, type ScrollAreaProps };
@@ -0,0 +1 @@
1
+ export { ScrollArea } from "./ScrollArea.js";
@@ -1,7 +1,7 @@
1
1
  import { Icon } from "../icon/Icon.js";
2
2
  import { InputGroup, InputGroupAddon, InputGroupInput } from "../input-group/InputGroup.js";
3
- import { useRef, useState } from "react";
4
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useRef, useState } from "react";
5
5
  // src/components/search-field/SearchField.tsx
6
6
  /**
7
7
  * The search field above a listing: a search icon, the input and a clear button that appears once there is text.
@@ -0,0 +1,40 @@
1
+ import { JSX } from "react";
2
+ import { Select } from "@base-ui/react/select";
3
+ /** The props of Select: Base UI's root props, such as value, defaultValue, onValueChange, items, name and disabled. */
4
+ export type SelectProps<Value = string> = Select.Root.Props<Value>;
5
+ /** A choice from a fixed list. Pass items ({ label, value }[]) so the trigger shows the label of the chosen value. Put a SelectTrigger and a SelectContent inside it. */
6
+ declare function Select$1<Value = string>(props: SelectProps<Value>): JSX.Element;
7
+ /** The height of the trigger in px: 36 for forms, 32 for fields inside a table. */
8
+ export type SelectSize = 36 | 32;
9
+ /** The props of SelectTrigger: Base UI's trigger props except className and style, with the height. Mark an invalid field with aria-invalid. */
10
+ export type SelectTriggerProps = Omit<Select.Trigger.Props, 'className' | 'style'> & {
11
+ /** The height in px: 36 for forms, 32 inside a table. Defaults to 36. */
12
+ size?: SelectSize;
13
+ };
14
+ /** The closed field: the chosen value (or the placeholder) and a chevron at the right. Put a SelectValue inside it. */
15
+ export declare function SelectTrigger({ size, children, ...props }: SelectTriggerProps): JSX.Element;
16
+ /** The props of SelectValue: Base UI's value props except className and style. */
17
+ export type SelectValueProps = Omit<Select.Value.Props, 'className' | 'style'>;
18
+ /** Shows the label of the chosen option inside the trigger, or the placeholder while nothing is chosen. */
19
+ export declare function SelectValue(props: SelectValueProps): JSX.Element;
20
+ /** The props of SelectContent: the popup props plus where the list sits. */
21
+ export type SelectContentProps = Omit<Select.Popup.Props, 'className' | 'style'> & Pick<Select.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>;
22
+ /** The list: the popover look (8px radius, outline, no shadow, 6px 0 padding), as wide as the trigger. It opens below the trigger. */
23
+ export declare function SelectContent({ align, alignOffset, side, sideOffset, children, ...props }: SelectContentProps): JSX.Element;
24
+ /** The props of SelectGroup: Base UI's group props except className and style. */
25
+ export type SelectGroupProps = Omit<Select.Group.Props, 'className' | 'style'>;
26
+ /** Groups related options under a SelectLabel. */
27
+ export declare function SelectGroup(props: SelectGroupProps): JSX.Element;
28
+ /** The props of SelectLabel: Base UI's group label props except className and style. */
29
+ export type SelectLabelProps = Omit<Select.GroupLabel.Props, 'className' | 'style'>;
30
+ /** The heading of a group, in the muted colour. */
31
+ export declare function SelectLabel(props: SelectLabelProps): JSX.Element;
32
+ /** The props of SelectItem: Base UI's item props except className and style. The value is the one the select reports. */
33
+ export type SelectItemProps = Omit<Select.Item.Props, 'className' | 'style'>;
34
+ /** One option. The highlighted one has the accent background, the chosen one a check at its end, a disabled one is dimmed and cannot be chosen. */
35
+ export declare function SelectItem({ children, ...props }: SelectItemProps): JSX.Element;
36
+ /** The props of SelectSeparator: Base UI's separator props except className and style. */
37
+ export type SelectSeparatorProps = Omit<Select.Separator.Props, 'className' | 'style'>;
38
+ /** A hairline between groups. */
39
+ export declare function SelectSeparator(props: SelectSeparatorProps): JSX.Element;
40
+ export { Select$1 as Select };
@@ -0,0 +1,84 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { Icon } from "../icon/Icon.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { cva } from "class-variance-authority";
5
+ import { Select } from "@base-ui/react/select";
6
+ // src/components/select/Select.tsx
7
+ /** A choice from a fixed list. Pass items ({ label, value }[]) so the trigger shows the label of the chosen value. Put a SelectTrigger and a SelectContent inside it. */
8
+ function Select$1(props) {
9
+ return /* @__PURE__ */ jsx(Select.Root, { ...props });
10
+ }
11
+ const triggerVariants = cva("rt:flex rt:w-full rt:min-w-0 rt:items-center rt:justify-between rt:gap-2 rt:rounded-lg rt:bg-background rt:text-b3 rt:text-foreground rt:whitespace-nowrap rt:shadow-ring-subtle rt:outline-none rt:select-none rt:transition-colors rt:forced-outline rt:focus-visible:shadow-ring-focus rt:aria-invalid:shadow-ring-invalid rt:aria-invalid:focus-visible:shadow-ring-invalid rt:data-placeholder:text-muted-foreground rt:disabled:pointer-events-none rt:disabled:cursor-not-allowed rt:disabled:opacity-50", {
12
+ variants: { size: {
13
+ 36: "rt:h-9 rt:pr-8 rt:pl-3",
14
+ 32: "rt:h-8 rt:pr-8 rt:pl-2.75"
15
+ } },
16
+ defaultVariants: { size: 36 }
17
+ });
18
+ /** The closed field: the chosen value (or the placeholder) and a chevron at the right. Put a SelectValue inside it. */
19
+ function SelectTrigger({ size = 36, children, ...props }) {
20
+ return /* @__PURE__ */ jsxs(Select.Trigger, {
21
+ className: cn(triggerVariants({ size }), "rt:relative"),
22
+ ...props,
23
+ children: [children, /* @__PURE__ */ jsx(Select.Icon, {
24
+ render: /* @__PURE__ */ jsx("span", { className: "rt:pointer-events-none rt:absolute rt:right-3 rt:flex rt:text-muted-foreground" }),
25
+ children: /* @__PURE__ */ jsx(Icon, { name: "nav-caret-down" })
26
+ })]
27
+ });
28
+ }
29
+ /** Shows the label of the chosen option inside the trigger, or the placeholder while nothing is chosen. */
30
+ function SelectValue(props) {
31
+ return /* @__PURE__ */ jsx(Select.Value, {
32
+ className: "rt:min-w-0 rt:flex-1 rt:truncate rt:text-left",
33
+ ...props
34
+ });
35
+ }
36
+ /** The list: the popover look (8px radius, outline, no shadow, 6px 0 padding), as wide as the trigger. It opens below the trigger. */
37
+ function SelectContent({ align = "start", alignOffset = 0, side = "bottom", sideOffset = 4, children, ...props }) {
38
+ return /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
39
+ align,
40
+ alignOffset,
41
+ side,
42
+ sideOffset,
43
+ alignItemWithTrigger: false,
44
+ className: "rt:isolate rt:z-50",
45
+ children: /* @__PURE__ */ jsx(Select.Popup, {
46
+ className: "rt:max-h-available rt:min-w-anchor rt:overflow-y-auto rt:rounded-lg rt:border rt:border-border rt:bg-popover rt:py-1.5 rt:text-b3 rt:text-popover-foreground rt:outline-hidden rt:transition-colors",
47
+ ...props,
48
+ children: /* @__PURE__ */ jsx(Select.List, { children })
49
+ })
50
+ }) });
51
+ }
52
+ /** Groups related options under a SelectLabel. */
53
+ function SelectGroup(props) {
54
+ return /* @__PURE__ */ jsx(Select.Group, { ...props });
55
+ }
56
+ /** The heading of a group, in the muted colour. */
57
+ function SelectLabel(props) {
58
+ return /* @__PURE__ */ jsx(Select.GroupLabel, {
59
+ className: "rt:px-3 rt:py-1 rt:text-label rt:uppercase rt:text-foreground-subdued",
60
+ ...props
61
+ });
62
+ }
63
+ /** One option. The highlighted one has the accent background, the chosen one a check at its end, a disabled one is dimmed and cannot be chosen. */
64
+ function SelectItem({ children, ...props }) {
65
+ return /* @__PURE__ */ jsxs(Select.Item, {
66
+ className: "rt:relative rt:flex rt:h-7 rt:cursor-default rt:items-center rt:gap-2 rt:pr-8 rt:pl-3 rt:text-b3 rt:text-foreground rt:outline-none rt:select-none rt:transition-colors rt:data-highlighted:bg-accent rt:data-highlighted:text-accent-foreground rt:data-disabled:pointer-events-none rt:data-disabled:opacity-50",
67
+ ...props,
68
+ children: [/* @__PURE__ */ jsx(Select.ItemText, {
69
+ className: "rt:flex-1 rt:truncate",
70
+ children
71
+ }), /* @__PURE__ */ jsx(Select.ItemIndicator, {
72
+ render: /* @__PURE__ */ jsx("span", { className: "rt:pointer-events-none rt:absolute rt:right-3 rt:flex" }),
73
+ children: /* @__PURE__ */ jsx(Icon, { name: "check" })
74
+ })]
75
+ });
76
+ }
77
+ /** A hairline between groups. */
78
+ function SelectSeparator(props) {
79
+ return /* @__PURE__ */ jsx(Select.Separator, {
80
+ className: "rt:my-1.5 rt:h-px rt:bg-divider",
81
+ ...props
82
+ });
83
+ }
84
+ export { Select$1 as Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue };
@@ -0,0 +1,2 @@
1
+ import { Select, SelectContent, SelectContentProps, SelectGroup, SelectGroupProps, SelectItem, SelectItemProps, SelectLabel, SelectLabelProps, SelectProps, SelectSeparator, SelectSeparatorProps, SelectSize, SelectTrigger, SelectTriggerProps, SelectValue, SelectValueProps } from "./Select.js";
2
+ export { Select, SelectContent, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, type SelectProps, SelectSeparator, type SelectSeparatorProps, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps };
@@ -0,0 +1 @@
1
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./Select.js";
@@ -0,0 +1,15 @@
1
+ import { JSX, Ref } from "react";
2
+ /** The props of Separator. */
3
+ export type SeparatorProps = {
4
+ /** The direction of the line. Defaults to horizontal. */
5
+ orientation?: 'horizontal' | 'vertical';
6
+ /** True, the default, hides the line from assistive technology; false makes it a semantic separator. */
7
+ decorative?: boolean;
8
+ /** Receives the rendered element. */
9
+ ref?: Ref<HTMLDivElement>;
10
+ };
11
+ /**
12
+ * A 1px hairline in the divider grey, horizontal or vertical. A horizontal line fills its row and shrinks to share it, so
13
+ * two lines and a word between them in an Inline make the "or" divider; a vertical line keeps its 1px.
14
+ */
15
+ export declare function Separator({ orientation, decorative, ref }: SeparatorProps): JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Separator } from "@base-ui/react/separator";
4
+ // src/components/separator/Separator.tsx
5
+ /**
6
+ * A 1px hairline in the divider grey, horizontal or vertical. A horizontal line fills its row and shrinks to share it, so
7
+ * two lines and a word between them in an Inline make the "or" divider; a vertical line keeps its 1px.
8
+ */
9
+ function Separator$1({ orientation = "horizontal", decorative = true, ref }) {
10
+ const classes = cn("rt:bg-divider rt:data-horizontal:h-px rt:data-horizontal:min-h-px rt:data-horizontal:w-full rt:data-vertical:w-px rt:data-vertical:shrink-0 rt:data-vertical:self-stretch");
11
+ if (decorative) return /* @__PURE__ */ jsx("div", {
12
+ ref,
13
+ role: "none",
14
+ "data-slot": "separator",
15
+ "data-orientation": orientation,
16
+ className: classes
17
+ });
18
+ return /* @__PURE__ */ jsx(Separator, {
19
+ ref,
20
+ "data-slot": "separator",
21
+ orientation,
22
+ className: classes
23
+ });
24
+ }
25
+ export { Separator$1 as Separator };
@@ -0,0 +1,2 @@
1
+ import { Separator, SeparatorProps } from "./Separator.js";
2
+ export { Separator, type SeparatorProps };
@@ -0,0 +1 @@
1
+ export { Separator } from "./Separator.js";
@@ -0,0 +1,52 @@
1
+ import { ComponentProps, JSX } from "react";
2
+ import { Dialog } from "@base-ui/react/dialog";
3
+ /**
4
+ * The root of a sheet. It holds the open state and renders nothing itself. Pass `open` and `onOpenChange` to control it,
5
+ * or `defaultOpen` to leave it uncontrolled. The page behind is inert while it is open, with no scrim over it.
6
+ */
7
+ export declare function Sheet(props: Dialog.Root.Props): JSX.Element;
8
+ /** Props of SheetTrigger. */
9
+ export type SheetTriggerProps = Omit<Dialog.Trigger.Props, 'className' | 'style'>;
10
+ /** The button that opens the sheet. */
11
+ export declare function SheetTrigger(props: SheetTriggerProps): JSX.Element;
12
+ /** Props of SheetClose. */
13
+ export type SheetCloseProps = Omit<Dialog.Close.Props, 'className' | 'style'>;
14
+ /** A button that closes the sheet, such as Done in the footer. */
15
+ export declare function SheetClose(props: SheetCloseProps): JSX.Element;
16
+ /** The edge a sheet sits on. */
17
+ export type SheetSide = 'right' | 'left' | 'bottom';
18
+ /** Props of SheetContent. */
19
+ export interface SheetContentProps extends Omit<Dialog.Popup.Props, 'className' | 'style'> {
20
+ /** The edge the sheet sits on: a full-height side sheet, or a bottom sheet with 24px top corners. Defaults to right. */
21
+ side?: SheetSide;
22
+ /** Whether the corner close button shows. Defaults to true. */
23
+ showCloseButton?: boolean;
24
+ /** The accessible name of the corner close button. Defaults to Close. */
25
+ closeLabel?: string;
26
+ }
27
+ /**
28
+ * The panel, white with a hairline on its inner edge. A side sheet is full height and three quarters of a phone screen,
29
+ * 384px from the small breakpoint up; a bottom sheet spans the screen, sizes to its content and has 24px top corners.
30
+ * It appears without sliding and with no scrim, blur or shadow. Put SheetHeader, SheetBody and SheetFooter inside.
31
+ */
32
+ export declare function SheetContent({ children, side, showCloseButton, closeLabel, ...props }: SheetContentProps): JSX.Element;
33
+ /** Props of SheetHeader. */
34
+ export type SheetHeaderProps = Omit<ComponentProps<'div'>, 'className' | 'style'>;
35
+ /** The title and description, stacked, with room on the right for the close button. */
36
+ export declare function SheetHeader(props: SheetHeaderProps): JSX.Element;
37
+ /** Props of SheetBody. */
38
+ export type SheetBodyProps = Omit<ComponentProps<'div'>, 'className' | 'style'>;
39
+ /** The content between header and footer. It takes the free height and scrolls when the content is taller. */
40
+ export declare function SheetBody(props: SheetBodyProps): JSX.Element;
41
+ /** Props of SheetFooter. */
42
+ export type SheetFooterProps = Omit<ComponentProps<'div'>, 'className' | 'style'>;
43
+ /** The row of actions at the bottom of the sheet, aligned to the end. */
44
+ export declare function SheetFooter(props: SheetFooterProps): JSX.Element;
45
+ /** Props of SheetTitle. */
46
+ export type SheetTitleProps = Omit<Dialog.Title.Props, 'className' | 'style'>;
47
+ /** The sheet's name, in the b4 style. It names the sheet for assistive technology. */
48
+ export declare function SheetTitle(props: SheetTitleProps): JSX.Element;
49
+ /** Props of SheetDescription. */
50
+ export type SheetDescriptionProps = Omit<Dialog.Description.Props, 'className' | 'style'>;
51
+ /** One line that says what the sheet is for, in subdued body text. */
52
+ export declare function SheetDescription(props: SheetDescriptionProps): JSX.Element;
@@ -0,0 +1,89 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { Icon } from "../icon/Icon.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Dialog } from "@base-ui/react/dialog";
5
+ // src/components/sheet/Sheet.tsx
6
+ /**
7
+ * The root of a sheet. It holds the open state and renders nothing itself. Pass `open` and `onOpenChange` to control it,
8
+ * or `defaultOpen` to leave it uncontrolled. The page behind is inert while it is open, with no scrim over it.
9
+ */
10
+ function Sheet(props) {
11
+ return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
12
+ }
13
+ /** The button that opens the sheet. */
14
+ function SheetTrigger(props) {
15
+ return /* @__PURE__ */ jsx(Dialog.Trigger, {
16
+ "data-slot": "sheet-trigger",
17
+ ...props
18
+ });
19
+ }
20
+ /** A button that closes the sheet, such as Done in the footer. */
21
+ function SheetClose(props) {
22
+ return /* @__PURE__ */ jsx(Dialog.Close, {
23
+ "data-slot": "sheet-close",
24
+ ...props
25
+ });
26
+ }
27
+ /**
28
+ * The panel, white with a hairline on its inner edge. A side sheet is full height and three quarters of a phone screen,
29
+ * 384px from the small breakpoint up; a bottom sheet spans the screen, sizes to its content and has 24px top corners.
30
+ * It appears without sliding and with no scrim, blur or shadow. Put SheetHeader, SheetBody and SheetFooter inside.
31
+ */
32
+ function SheetContent({ children, side = "right", showCloseButton = true, closeLabel = "Close", ...props }) {
33
+ return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(Dialog.Popup, {
34
+ "data-slot": "sheet-content",
35
+ "data-side": side,
36
+ className: cn("rt:fixed rt:z-50 rt:flex rt:max-h-full rt:flex-col rt:overflow-y-auto rt:border-border rt:bg-popover rt:text-b3 rt:text-popover-foreground rt:focus-visible:focus-ring", "rt:side-right:inset-y-0 rt:side-right:right-0 rt:side-right:w-3/4 rt:side-right:border-l rt:side-right:sm:w-96", "rt:side-left:inset-y-0 rt:side-left:left-0 rt:side-left:w-3/4 rt:side-left:border-r rt:side-left:sm:w-96", "rt:side-bottom:inset-x-0 rt:side-bottom:bottom-0 rt:side-bottom:rounded-t-3xl rt:side-bottom:border-x rt:side-bottom:border-t"),
37
+ ...props,
38
+ children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog.Close, {
39
+ "data-slot": "sheet-close",
40
+ "aria-label": closeLabel,
41
+ className: "rt:absolute rt:top-5 rt:right-5 rt:flex rt:size-7 rt:items-center rt:justify-center rt:rounded-md rt:text-icon rt:transition-colors rt:hover:bg-primary-tint rt:focus-visible:focus-ring",
42
+ children: /* @__PURE__ */ jsx(Icon, {
43
+ name: "x",
44
+ size: 12
45
+ })
46
+ })]
47
+ }) });
48
+ }
49
+ /** The title and description, stacked, with room on the right for the close button. */
50
+ function SheetHeader(props) {
51
+ return /* @__PURE__ */ jsx("div", {
52
+ "data-slot": "sheet-header",
53
+ className: "rt:flex rt:shrink-0 rt:flex-col rt:gap-1 rt:p-6 rt:pr-20",
54
+ ...props
55
+ });
56
+ }
57
+ /** The content between header and footer. It takes the free height and scrolls when the content is taller. */
58
+ function SheetBody(props) {
59
+ return /* @__PURE__ */ jsx("div", {
60
+ "data-slot": "sheet-body",
61
+ className: "rt:flex rt:min-h-0 rt:flex-1 rt:flex-col rt:gap-3.5 rt:overflow-y-auto rt:px-6 rt:pb-6",
62
+ ...props
63
+ });
64
+ }
65
+ /** The row of actions at the bottom of the sheet, aligned to the end. */
66
+ function SheetFooter(props) {
67
+ return /* @__PURE__ */ jsx("div", {
68
+ "data-slot": "sheet-footer",
69
+ className: "rt:mt-auto rt:flex rt:shrink-0 rt:items-center rt:justify-end rt:gap-2 rt:px-6 rt:pb-6",
70
+ ...props
71
+ });
72
+ }
73
+ /** The sheet's name, in the b4 style. It names the sheet for assistive technology. */
74
+ function SheetTitle(props) {
75
+ return /* @__PURE__ */ jsx(Dialog.Title, {
76
+ "data-slot": "sheet-title",
77
+ className: "rt:text-b4 rt:text-foreground-strong",
78
+ ...props
79
+ });
80
+ }
81
+ /** One line that says what the sheet is for, in subdued body text. */
82
+ function SheetDescription(props) {
83
+ return /* @__PURE__ */ jsx(Dialog.Description, {
84
+ "data-slot": "sheet-description",
85
+ className: "rt:text-b3 rt:text-foreground-subdued",
86
+ ...props
87
+ });
88
+ }
89
+ export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -0,0 +1,2 @@
1
+ import { Sheet, SheetBody, SheetBodyProps, SheetClose, SheetCloseProps, SheetContent, SheetContentProps, SheetDescription, SheetDescriptionProps, SheetFooter, SheetFooterProps, SheetHeader, SheetHeaderProps, SheetSide, SheetTitle, SheetTitleProps, SheetTrigger, SheetTriggerProps } from "./Sheet.js";
2
+ export { Sheet, SheetBody, type SheetBodyProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetSide, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps };
@@ -0,0 +1 @@
1
+ export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./Sheet.js";
@@ -1,10 +1,10 @@
1
- import { ShellNavContext } from "../app-shell/context.js";
2
1
  import { cn } from "../../lib/cn.js";
3
- import { Avatar } from "../avatar/Avatar.js";
4
2
  import { Icon } from "../icon/Icon.js";
3
+ import { ShellNavContext } from "../app-shell/context.js";
4
+ import { Avatar } from "../avatar/Avatar.js";
5
5
  import { RatioLink } from "../link-provider/RatioLink.js";
6
- import { use, useState, useSyncExternalStore } from "react";
7
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { use, useState, useSyncExternalStore } from "react";
8
8
  import { Dialog } from "@base-ui/react/dialog";
9
9
  // src/components/side-nav/SideNav.tsx
10
10
  const PHONE_QUERY = "(max-width: 767px)";
@@ -0,0 +1,17 @@
1
+ import { HTMLAttributes, JSX, Ref } from "react";
2
+ /** One chip: a label, with an optional value after it ("Includes GST" and "Yes"). */
3
+ export interface SummaryChip {
4
+ /** The label, such as Cost price or HSN code. */
5
+ label: string;
6
+ /** The value, shown after the label in the foreground ink. Leave out for a chip that is only a name. */
7
+ value?: string;
8
+ }
9
+ /** The props of SummaryChips: the HTML attributes of a list, except className and style, with the chips. */
10
+ export type SummaryChipsProps = Omit<HTMLAttributes<HTMLUListElement>, 'className' | 'style' | 'children'> & {
11
+ /** The chips, in order. Nothing is rendered when empty. */
12
+ items: readonly SummaryChip[];
13
+ /** Receives the rendered list. */
14
+ ref?: Ref<HTMLUListElement>;
15
+ };
16
+ /** A row of 20px chips that summarise values, such as the ones a collapsed section still shows. */
17
+ export declare function SummaryChips({ items, ref, ...rest }: SummaryChipsProps): JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ // src/components/summary-chips/SummaryChips.tsx
3
+ /** A row of 20px chips that summarise values, such as the ones a collapsed section still shows. */
4
+ function SummaryChips({ items, ref, ...rest }) {
5
+ if (items.length === 0) return null;
6
+ return /* @__PURE__ */ jsx("ul", {
7
+ ...rest,
8
+ ref,
9
+ className: "rt:m-0 rt:flex rt:list-none rt:flex-wrap rt:gap-1 rt:p-0",
10
+ children: items.map((item) => /* @__PURE__ */ jsxs("li", {
11
+ className: "rt:inline-flex rt:h-5 rt:items-center rt:gap-1 rt:rounded-sm rt:border rt:border-chip-border rt:bg-chip-background rt:px-2 rt:text-c1 rt:whitespace-nowrap rt:text-chip-foreground",
12
+ children: [/* @__PURE__ */ jsx("span", { children: item.label }), item.value !== void 0 ? /* @__PURE__ */ jsx("span", {
13
+ className: "rt:text-c2 rt:text-foreground",
14
+ children: item.value
15
+ }) : null]
16
+ }, item.label))
17
+ });
18
+ }
19
+ export { SummaryChips };
@@ -0,0 +1,2 @@
1
+ import { SummaryChip, SummaryChips, SummaryChipsProps } from "./SummaryChips.js";
2
+ export { type SummaryChip, SummaryChips, type SummaryChipsProps };
@@ -0,0 +1 @@
1
+ export { SummaryChips } from "./SummaryChips.js";
@@ -0,0 +1,10 @@
1
+ import { JSX } from "react";
2
+ import { Switch } from "@base-ui/react/switch";
3
+ /** The props of Switch: Base UI's switch props, except className, style and render. Give it an aria-label or a label that points to it. */
4
+ export type SwitchProps = Omit<Switch.Root.Props, 'className' | 'style' | 'render'>;
5
+ /**
6
+ * An on/off switch, 32px by 18px. Off it is drawn with the control hairline; on it is filled in the primary colour.
7
+ * In forced-colours mode the thumb keeps a system-colour outline, and its side shows the state. The thumb jumps to the other end with no slide, and colours fade over 120ms.
8
+ */
9
+ declare function Switch$1({ ...props }: SwitchProps): JSX.Element;
10
+ export { Switch$1 as Switch };
@@ -0,0 +1,20 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Switch } from "@base-ui/react/switch";
4
+ // src/components/switch/Switch.tsx
5
+ /**
6
+ * An on/off switch, 32px by 18px. Off it is drawn with the control hairline; on it is filled in the primary colour.
7
+ * In forced-colours mode the thumb keeps a system-colour outline, and its side shows the state. The thumb jumps to the other end with no slide, and colours fade over 120ms.
8
+ */
9
+ function Switch$1({ ...props }) {
10
+ return /* @__PURE__ */ jsx(Switch.Root, {
11
+ "data-slot": "switch",
12
+ className: cn("rt:peer rt:relative rt:inline-flex rt:h-4.5 rt:w-8 rt:shrink-0 rt:cursor-pointer rt:items-center rt:justify-start rt:rounded-3xl rt:bg-background rt:shadow-ring-hairline rt:transition-colors rt:outline-none", "rt:after:absolute rt:after:-inset-x-1.5 rt:after:-inset-y-1.5", "rt:data-checked:justify-end rt:data-checked:bg-primary rt:data-checked:shadow-none", "rt:focus-visible:focus-ring rt:forced-outline", "rt:aria-invalid:shadow-ring-invalid rt:aria-invalid:focus-visible:shadow-ring-invalid", "rt:data-disabled:cursor-not-allowed rt:data-disabled:opacity-50"),
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx(Switch.Thumb, {
15
+ "data-slot": "switch-thumb",
16
+ className: "rt:pointer-events-none rt:mx-0.5 rt:block rt:size-3.5 rt:rounded-3xl rt:forced-outline rt:bg-control rt:transition-colors rt:data-checked:bg-primary-foreground"
17
+ })
18
+ });
19
+ }
20
+ export { Switch$1 as Switch };
@@ -0,0 +1,2 @@
1
+ import { Switch, SwitchProps } from "./Switch.js";
2
+ export { Switch, type SwitchProps };
@@ -0,0 +1 @@
1
+ export { Switch } from "./Switch.js";
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../../lib/cn.js";
2
- import { createContext, use } from "react";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import { createContext, use } from "react";
4
4
  // src/components/table/Table.tsx
5
5
  const SectionContext = createContext("body");
6
6
  const BoxContext = createContext(false);
@@ -0,0 +1,44 @@
1
+ import { JSX, Ref } from "react";
2
+ /** The props of TagInput. Field's wiring (id, aria-describedby, aria-invalid, aria-required, disabled) lands on the picker. */
3
+ export type TagInputProps = {
4
+ /** The existing values the picker offers, such as S, M, L, XL and XXL. */
5
+ options: readonly string[];
6
+ /** The chosen values, in order, when the owner holds the state. */
7
+ value?: readonly string[];
8
+ /** The values chosen at first, when the component holds the state. */
9
+ defaultValue?: readonly string[];
10
+ /** Called with every new list of values: after a pick, an added value or a removal. */
11
+ onValueChange?: (value: string[]) => void;
12
+ /** Shows a small field that adds a typed value on Enter. Defaults to true. */
13
+ creatable?: boolean;
14
+ /** The placeholder and accessible name of the small field. Defaults to "Add value". */
15
+ addLabel?: string;
16
+ /** The placeholder of the picker, shown while nothing is chosen. */
17
+ placeholder?: string;
18
+ /** The line the list shows when no value matches the typed text. Defaults to "No matching values". */
19
+ emptyText?: string;
20
+ /** The form field name: one hidden input per chosen value is submitted under it. */
21
+ name?: string;
22
+ /** Dims the component and stops every change. */
23
+ disabled?: boolean;
24
+ /** The id of the picker's input, which a label points to. */
25
+ id?: string;
26
+ /** The accessible name of the picker, when no label points to it. */
27
+ 'aria-label'?: string;
28
+ /** The id of the element that names the picker. */
29
+ 'aria-labelledby'?: string;
30
+ /** The ids of the hint or error that describe the component. */
31
+ 'aria-describedby'?: string;
32
+ /** Marks the values as invalid, which draws the error ring. */
33
+ 'aria-invalid'?: boolean | 'true' | 'false';
34
+ /** Marks the values as required. */
35
+ 'aria-required'?: boolean | 'true' | 'false';
36
+ /** Receives the picker's input element. */
37
+ ref?: Ref<HTMLInputElement>;
38
+ };
39
+ /**
40
+ * Several values as chips in one field in the input's look. The picker offers the existing values (typing filters them),
41
+ * a small field below adds a new one on Enter, and a chip goes with its remove button or with Backspace in the empty
42
+ * picker. Base UI's combobox cannot accept a value it does not list, which is why new values have their own field.
43
+ */
44
+ export declare function TagInput({ options, value, defaultValue, onValueChange, creatable, addLabel, placeholder, emptyText, name, disabled, id, ref, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired }: TagInputProps): JSX.Element;