@optimum-intelligence/opti-ui 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +161 -2
  3. package/dist/components/accordion/Accordion.d.ts +17 -0
  4. package/dist/components/accordion/Accordion.js +204 -0
  5. package/dist/components/accordion/Accordion.js.map +1 -0
  6. package/dist/components/alert/Alert.d.ts +18 -0
  7. package/dist/components/alert/Alert.js +164 -0
  8. package/dist/components/alert/Alert.js.map +1 -0
  9. package/dist/components/app-shell/AppShell.d.ts +97 -0
  10. package/dist/components/app-shell/AppShell.js +689 -0
  11. package/dist/components/app-shell/AppShell.js.map +1 -0
  12. package/dist/components/avatar/Avatar.d.ts +21 -0
  13. package/dist/components/avatar/Avatar.js +190 -0
  14. package/dist/components/avatar/Avatar.js.map +1 -0
  15. package/dist/components/badge/Badge.d.ts +16 -0
  16. package/dist/components/badge/Badge.js +94 -0
  17. package/dist/components/badge/Badge.js.map +1 -0
  18. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +18 -0
  19. package/dist/components/breadcrumbs/Breadcrumbs.js +154 -0
  20. package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -0
  21. package/dist/components/button/Button.d.ts +23 -0
  22. package/dist/components/button/Button.js +159 -0
  23. package/dist/components/button/Button.js.map +1 -0
  24. package/dist/components/calendar/Calendar.d.ts +59 -0
  25. package/dist/components/calendar/Calendar.js +709 -0
  26. package/dist/components/calendar/Calendar.js.map +1 -0
  27. package/dist/components/calendar/date-utils.d.ts +32 -0
  28. package/dist/components/calendar/date-utils.js +112 -0
  29. package/dist/components/calendar/date-utils.js.map +1 -0
  30. package/dist/components/card/Card.d.ts +42 -0
  31. package/dist/components/card/Card.js +82 -0
  32. package/dist/components/card/Card.js.map +1 -0
  33. package/dist/components/choice/Choice.d.ts +32 -0
  34. package/dist/components/choice/Choice.js +371 -0
  35. package/dist/components/choice/Choice.js.map +1 -0
  36. package/dist/components/collapsible/Collapsible.d.ts +15 -0
  37. package/dist/components/collapsible/Collapsible.js +155 -0
  38. package/dist/components/collapsible/Collapsible.js.map +1 -0
  39. package/dist/components/combobox/Combobox.d.ts +68 -0
  40. package/dist/components/combobox/Combobox.js +752 -0
  41. package/dist/components/combobox/Combobox.js.map +1 -0
  42. package/dist/components/command-palette/CommandPalette.d.ts +52 -0
  43. package/dist/components/command-palette/CommandPalette.js +328 -0
  44. package/dist/components/command-palette/CommandPalette.js.map +1 -0
  45. package/dist/components/data-table/DataTable.d.ts +111 -0
  46. package/dist/components/data-table/DataTable.js +444 -0
  47. package/dist/components/data-table/DataTable.js.map +1 -0
  48. package/dist/components/date-picker/DatePicker.d.ts +50 -0
  49. package/dist/components/date-picker/DatePicker.js +485 -0
  50. package/dist/components/date-picker/DatePicker.js.map +1 -0
  51. package/dist/components/date-picker/DateRangePicker.d.ts +39 -0
  52. package/dist/components/date-picker/DateRangePicker.js +339 -0
  53. package/dist/components/date-picker/DateRangePicker.js.map +1 -0
  54. package/dist/components/date-picker/PickerField.d.ts +38 -0
  55. package/dist/components/date-picker/PickerField.js +238 -0
  56. package/dist/components/date-picker/PickerField.js.map +1 -0
  57. package/dist/components/dialog/Dialog.d.ts +70 -0
  58. package/dist/components/dialog/Dialog.js +354 -0
  59. package/dist/components/dialog/Dialog.js.map +1 -0
  60. package/dist/components/drawer/Drawer.d.ts +39 -0
  61. package/dist/components/drawer/Drawer.js +225 -0
  62. package/dist/components/drawer/Drawer.js.map +1 -0
  63. package/dist/components/empty-state/EmptyState.d.ts +12 -0
  64. package/dist/components/empty-state/EmptyState.js +116 -0
  65. package/dist/components/empty-state/EmptyState.js.map +1 -0
  66. package/dist/components/field/Field.d.ts +36 -0
  67. package/dist/components/field/Field.js +337 -0
  68. package/dist/components/field/Field.js.map +1 -0
  69. package/dist/components/file-upload/FileUpload.d.ts +91 -0
  70. package/dist/components/file-upload/FileUpload.js +714 -0
  71. package/dist/components/file-upload/FileUpload.js.map +1 -0
  72. package/dist/components/input/Input.d.ts +49 -0
  73. package/dist/components/input/Input.js +538 -0
  74. package/dist/components/input/Input.js.map +1 -0
  75. package/dist/components/link/Link.d.ts +17 -0
  76. package/dist/components/link/Link.js +91 -0
  77. package/dist/components/link/Link.js.map +1 -0
  78. package/dist/components/menu/Menu.d.ts +79 -0
  79. package/dist/components/menu/Menu.js +615 -0
  80. package/dist/components/menu/Menu.js.map +1 -0
  81. package/dist/components/number-field/NumberField.d.ts +16 -0
  82. package/dist/components/number-field/NumberField.js +188 -0
  83. package/dist/components/number-field/NumberField.js.map +1 -0
  84. package/dist/components/pagination/Pagination.d.ts +34 -0
  85. package/dist/components/pagination/Pagination.js +244 -0
  86. package/dist/components/pagination/Pagination.js.map +1 -0
  87. package/dist/components/popover/Popover.d.ts +22 -0
  88. package/dist/components/popover/Popover.js +186 -0
  89. package/dist/components/popover/Popover.js.map +1 -0
  90. package/dist/components/preview-card/PreviewCard.d.ts +20 -0
  91. package/dist/components/preview-card/PreviewCard.js +114 -0
  92. package/dist/components/preview-card/PreviewCard.js.map +1 -0
  93. package/dist/components/progress/Progress.d.ts +20 -0
  94. package/dist/components/progress/Progress.js +169 -0
  95. package/dist/components/progress/Progress.js.map +1 -0
  96. package/dist/components/scroll-area/ScrollArea.d.ts +8 -0
  97. package/dist/components/scroll-area/ScrollArea.js +112 -0
  98. package/dist/components/scroll-area/ScrollArea.js.map +1 -0
  99. package/dist/components/search-input/SearchInput.d.ts +14 -0
  100. package/dist/components/search-input/SearchInput.js +114 -0
  101. package/dist/components/search-input/SearchInput.js.map +1 -0
  102. package/dist/components/select/Select.d.ts +66 -0
  103. package/dist/components/select/Select.js +601 -0
  104. package/dist/components/select/Select.js.map +1 -0
  105. package/dist/components/separator/Separator.d.ts +4 -0
  106. package/dist/components/separator/Separator.js +46 -0
  107. package/dist/components/separator/Separator.js.map +1 -0
  108. package/dist/components/skeleton/Skeleton.d.ts +16 -0
  109. package/dist/components/skeleton/Skeleton.js +135 -0
  110. package/dist/components/skeleton/Skeleton.js.map +1 -0
  111. package/dist/components/slider/Slider.d.ts +11 -0
  112. package/dist/components/slider/Slider.js +107 -0
  113. package/dist/components/slider/Slider.js.map +1 -0
  114. package/dist/components/spinner/Spinner.d.ts +9 -0
  115. package/dist/components/spinner/Spinner.js +78 -0
  116. package/dist/components/spinner/Spinner.js.map +1 -0
  117. package/dist/components/stack/Stack.d.ts +23 -0
  118. package/dist/components/stack/Stack.js +79 -0
  119. package/dist/components/stack/Stack.js.map +1 -0
  120. package/dist/components/stat-card/StatCard.d.ts +22 -0
  121. package/dist/components/stat-card/StatCard.js +153 -0
  122. package/dist/components/stat-card/StatCard.js.map +1 -0
  123. package/dist/components/stepper/Stepper.d.ts +30 -0
  124. package/dist/components/stepper/Stepper.js +131 -0
  125. package/dist/components/stepper/Stepper.js.map +1 -0
  126. package/dist/components/table/Table.d.ts +53 -0
  127. package/dist/components/table/Table.js +221 -0
  128. package/dist/components/table/Table.js.map +1 -0
  129. package/dist/components/tabs/Tabs.d.ts +19 -0
  130. package/dist/components/tabs/Tabs.js +183 -0
  131. package/dist/components/tabs/Tabs.js.map +1 -0
  132. package/dist/components/tag/Tag.d.ts +22 -0
  133. package/dist/components/tag/Tag.js +121 -0
  134. package/dist/components/tag/Tag.js.map +1 -0
  135. package/dist/components/toast/Toast.d.ts +34 -0
  136. package/dist/components/toast/Toast.js +187 -0
  137. package/dist/components/toast/Toast.js.map +1 -0
  138. package/dist/components/toggle/Toggle.d.ts +31 -0
  139. package/dist/components/toggle/Toggle.js +197 -0
  140. package/dist/components/toggle/Toggle.js.map +1 -0
  141. package/dist/components/toolbar/Toolbar.d.ts +21 -0
  142. package/dist/components/toolbar/Toolbar.js +239 -0
  143. package/dist/components/toolbar/Toolbar.js.map +1 -0
  144. package/dist/components/tooltip/Tooltip.d.ts +33 -0
  145. package/dist/components/tooltip/Tooltip.js +182 -0
  146. package/dist/components/tooltip/Tooltip.js.map +1 -0
  147. package/dist/components/typography/Typography.d.ts +32 -0
  148. package/dist/components/typography/Typography.js +183 -0
  149. package/dist/components/typography/Typography.js.map +1 -0
  150. package/dist/fonts.css +3 -0
  151. package/dist/icons/index.d.ts +125 -0
  152. package/dist/icons/index.js +174 -0
  153. package/dist/icons/index.js.map +1 -0
  154. package/dist/index.d.ts +53 -0
  155. package/dist/index.js +56 -0
  156. package/dist/opti-ui.css +5365 -0
  157. package/dist/theme/ThemeProvider.d.ts +22 -0
  158. package/dist/theme/ThemeProvider.js +115 -0
  159. package/dist/theme/ThemeProvider.js.map +1 -0
  160. package/dist/theme/index.d.ts +2 -0
  161. package/dist/utils/cx.d.ts +10 -0
  162. package/dist/utils/cx.js +18 -0
  163. package/dist/utils/cx.js.map +1 -0
  164. package/dist/utils/index.d.ts +2 -0
  165. package/dist/utils/portal.d.ts +8 -0
  166. package/dist/utils/portal.js +16 -0
  167. package/dist/utils/portal.js.map +1 -0
  168. package/dist/utils/primitive.d.ts +13 -0
  169. package/dist/utils/primitive.js +61 -0
  170. package/dist/utils/primitive.js.map +1 -0
  171. package/dist/utils/search.d.ts +4 -0
  172. package/dist/utils/search.js +15 -0
  173. package/dist/utils/search.js.map +1 -0
  174. package/package.json +71 -4
@@ -0,0 +1,197 @@
1
+ "use client";
2
+ import { withClass } from "../../utils/cx.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import * as React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { Toggle } from "@base-ui/react/toggle";
7
+ import { ToggleGroup } from "@base-ui/react/toggle-group";
8
+ //#region src/components/toggle/Toggle.tsx
9
+ /** Two-state button (bold, pin, favourite…). Inside a ToggleGroup it acts as a segment. */
10
+ function Toggle$1(t0) {
11
+ const $ = c(12);
12
+ let className;
13
+ let props;
14
+ let ref;
15
+ let t1;
16
+ if ($[0] !== t0) {
17
+ ({size: t1, className, ref, ...props} = t0);
18
+ $[0] = t0;
19
+ $[1] = className;
20
+ $[2] = props;
21
+ $[3] = ref;
22
+ $[4] = t1;
23
+ } else {
24
+ className = $[1];
25
+ props = $[2];
26
+ ref = $[3];
27
+ t1 = $[4];
28
+ }
29
+ const size = t1 === void 0 ? "md" : t1;
30
+ let t2;
31
+ if ($[5] !== className) {
32
+ t2 = withClass("oui-toggle", className);
33
+ $[5] = className;
34
+ $[6] = t2;
35
+ } else t2 = $[6];
36
+ let t3;
37
+ if ($[7] !== props || $[8] !== ref || $[9] !== size || $[10] !== t2) {
38
+ t3 = /* @__PURE__ */ jsx(Toggle, {
39
+ ref,
40
+ className: t2,
41
+ "data-size": size,
42
+ ...props
43
+ });
44
+ $[7] = props;
45
+ $[8] = ref;
46
+ $[9] = size;
47
+ $[10] = t2;
48
+ $[11] = t3;
49
+ } else t3 = $[11];
50
+ return t3;
51
+ }
52
+ function ToggleGroup$1(t0) {
53
+ const $ = c(16);
54
+ let className;
55
+ let fullWidth;
56
+ let props;
57
+ let ref;
58
+ let t1;
59
+ let t2;
60
+ if ($[0] !== t0) {
61
+ ({size: t1, variant: t2, fullWidth, className, ref, ...props} = t0);
62
+ $[0] = t0;
63
+ $[1] = className;
64
+ $[2] = fullWidth;
65
+ $[3] = props;
66
+ $[4] = ref;
67
+ $[5] = t1;
68
+ $[6] = t2;
69
+ } else {
70
+ className = $[1];
71
+ fullWidth = $[2];
72
+ props = $[3];
73
+ ref = $[4];
74
+ t1 = $[5];
75
+ t2 = $[6];
76
+ }
77
+ const size = t1 === void 0 ? "md" : t1;
78
+ const variant = t2 === void 0 ? "segmented" : t2;
79
+ let t3;
80
+ if ($[7] !== className) {
81
+ t3 = withClass("oui-toggle-group", className);
82
+ $[7] = className;
83
+ $[8] = t3;
84
+ } else t3 = $[8];
85
+ const t4 = fullWidth || void 0;
86
+ let t5;
87
+ if ($[9] !== props || $[10] !== ref || $[11] !== size || $[12] !== t3 || $[13] !== t4 || $[14] !== variant) {
88
+ t5 = /* @__PURE__ */ jsx(ToggleGroup, {
89
+ ref,
90
+ className: t3,
91
+ "data-size": size,
92
+ "data-variant": variant,
93
+ "data-full-width": t4,
94
+ ...props
95
+ });
96
+ $[9] = props;
97
+ $[10] = ref;
98
+ $[11] = size;
99
+ $[12] = t3;
100
+ $[13] = t4;
101
+ $[14] = variant;
102
+ $[15] = t5;
103
+ } else t5 = $[15];
104
+ return t5;
105
+ }
106
+ /** Single-choice switcher (e.g. Day / Week / Month). Always keeps one value selected. */
107
+ function SegmentedControl(t0) {
108
+ const $ = c(24);
109
+ let defaultValue;
110
+ let onValueChange;
111
+ let options;
112
+ let props;
113
+ let ref;
114
+ let t1;
115
+ let value;
116
+ if ($[0] !== t0) {
117
+ ({options, value, defaultValue, onValueChange, size: t1, ref, ...props} = t0);
118
+ $[0] = t0;
119
+ $[1] = defaultValue;
120
+ $[2] = onValueChange;
121
+ $[3] = options;
122
+ $[4] = props;
123
+ $[5] = ref;
124
+ $[6] = t1;
125
+ $[7] = value;
126
+ } else {
127
+ defaultValue = $[1];
128
+ onValueChange = $[2];
129
+ options = $[3];
130
+ props = $[4];
131
+ ref = $[5];
132
+ t1 = $[6];
133
+ value = $[7];
134
+ }
135
+ const size = t1 === void 0 ? "md" : t1;
136
+ const [internal, setInternal] = React.useState(defaultValue ?? options[0]?.value);
137
+ const current = value ?? internal;
138
+ let t2;
139
+ if ($[8] !== current) {
140
+ t2 = current != null ? [current] : [];
141
+ $[8] = current;
142
+ $[9] = t2;
143
+ } else t2 = $[9];
144
+ let t3;
145
+ if ($[10] !== onValueChange) {
146
+ t3 = (next) => {
147
+ const picked = next[0];
148
+ if (picked == null) return;
149
+ setInternal(picked);
150
+ onValueChange?.(picked);
151
+ };
152
+ $[10] = onValueChange;
153
+ $[11] = t3;
154
+ } else t3 = $[11];
155
+ let t4;
156
+ if ($[12] !== options || $[13] !== size) {
157
+ let t5;
158
+ if ($[15] !== size) {
159
+ t5 = (option) => /* @__PURE__ */ jsx(Toggle$1, {
160
+ value: option.value,
161
+ size,
162
+ disabled: option.disabled,
163
+ "aria-label": option["aria-label"],
164
+ children: option.label
165
+ }, option.value);
166
+ $[15] = size;
167
+ $[16] = t5;
168
+ } else t5 = $[16];
169
+ t4 = options.map(t5);
170
+ $[12] = options;
171
+ $[13] = size;
172
+ $[14] = t4;
173
+ } else t4 = $[14];
174
+ let t5;
175
+ if ($[17] !== props || $[18] !== ref || $[19] !== size || $[20] !== t2 || $[21] !== t3 || $[22] !== t4) {
176
+ t5 = /* @__PURE__ */ jsx(ToggleGroup$1, {
177
+ ref,
178
+ size,
179
+ value: t2,
180
+ onValueChange: t3,
181
+ ...props,
182
+ children: t4
183
+ });
184
+ $[17] = props;
185
+ $[18] = ref;
186
+ $[19] = size;
187
+ $[20] = t2;
188
+ $[21] = t3;
189
+ $[22] = t4;
190
+ $[23] = t5;
191
+ } else t5 = $[23];
192
+ return t5;
193
+ }
194
+ //#endregion
195
+ export { SegmentedControl, Toggle$1 as Toggle, ToggleGroup$1 as ToggleGroup };
196
+
197
+ //# sourceMappingURL=Toggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toggle.js","names":["React","Toggle","BaseToggle","ToggleGroup","BaseToggleGroup","withClass","ToggleSize","ToggleProps","Props","size","t0","$","_c","className","props","ref","t1","undefined","t2","t3","ToggleGroupProps","variant","fullWidth","t4","t5","SegmentedControlOption","value","label","ReactNode","disabled","SegmentedControlProps","Omit","options","defaultValue","onValueChange","SegmentedControl","internal","setInternal","useState","current","next","picked","option","map","Toggle","_c","BaseToggle","ToggleGroup","BaseToggleGroup"],"sources":["../../../src/components/toggle/Toggle.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Toggle as BaseToggle } from '@base-ui/react/toggle';\nimport { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group';\nimport { withClass } from '../../utils/cx';\n\nexport type ToggleSize = 'sm' | 'md';\n\nexport interface ToggleProps extends BaseToggle.Props {\n size?: ToggleSize;\n}\n\n/** Two-state button (bold, pin, favourite…). Inside a ToggleGroup it acts as a segment. */\nexport function Toggle({ size = 'md', className, ref, ...props }: ToggleProps) {\n return <BaseToggle ref={ref} className={withClass('oui-toggle', className)} data-size={size} {...props} />;\n}\n\nexport interface ToggleGroupProps extends BaseToggleGroup.Props {\n size?: ToggleSize;\n /** `segmented` renders a pill track like a tab switcher; `outline` separate buttons. */\n variant?: 'segmented' | 'outline';\n /** Stretch segments to fill the width. */\n fullWidth?: boolean;\n}\n\nexport function ToggleGroup({\n size = 'md',\n variant = 'segmented',\n fullWidth,\n className,\n ref,\n ...props\n}: ToggleGroupProps) {\n return (\n <BaseToggleGroup\n ref={ref}\n className={withClass('oui-toggle-group', className)}\n data-size={size}\n data-variant={variant}\n data-full-width={fullWidth || undefined}\n {...props}\n />\n );\n}\n\nexport interface SegmentedControlOption {\n value: string;\n label: React.ReactNode;\n disabled?: boolean;\n 'aria-label'?: string;\n}\n\nexport interface SegmentedControlProps\n extends Omit<ToggleGroupProps, 'value' | 'defaultValue' | 'onValueChange' | 'multiple' | 'children'> {\n options: SegmentedControlOption[];\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n}\n\n/** Single-choice switcher (e.g. Day / Week / Month). Always keeps one value selected. */\nexport function SegmentedControl({\n options,\n value,\n defaultValue,\n onValueChange,\n size = 'md',\n ref,\n ...props\n}: SegmentedControlProps) {\n const [internal, setInternal] = React.useState(defaultValue ?? options[0]?.value);\n const current = value ?? internal;\n return (\n <ToggleGroup\n ref={ref}\n size={size}\n value={current != null ? [current] : []}\n onValueChange={(next) => {\n const picked = next[0];\n if (picked == null) return; // keep one segment selected\n setInternal(picked);\n onValueChange?.(picked);\n }}\n {...props}\n >\n {options.map((option) => (\n <Toggle\n key={option.value}\n value={option.value}\n size={size}\n disabled={option.disabled}\n aria-label={option['aria-label']}\n >\n {option.label}\n </Toggle>\n ))}\n </ToggleGroup>\n );\n}\n"],"mappings":";;;;;;;;;AAYA,SAAOC,SAAAS,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAA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S,QAAOW,IAAKnB,EAUZ;EAACb,EAAA,MAAAqB;EAAArB,EAAA,MAAAF;EAAAE,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,QAAAG,SAAAH,EAAA,QAAAI,OAAAJ,EAAA,QAAAF,QAAAE,EAAA,QAAAO,MAAAP,EAAA,QAAAQ,MAAAR,EAAA,QAAAY,IAAA;EAtBJC,KAAA,oBAACuB,eAAD;GACOhC;GACCN;GACC,OAAAS;GACQ,eAAAC;GAKd,GACGL;GAEHS,UAAAA;EAZS,CAAA;EAuBEZ,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAF;EAAAE,EAAA,MAAAO;EAAAP,EAAA,MAAAQ;EAAAR,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAvBda;AAuBc"}
@@ -0,0 +1,21 @@
1
+ import { Toolbar as BaseToolbar } from '@base-ui/react/toolbar';
2
+ declare function ToolbarRoot({ className, ref, ...props }: BaseToolbar.Root.Props): import("react").JSX.Element;
3
+ declare function ToolbarButton({ className, ref, ...props }: BaseToolbar.Button.Props): import("react").JSX.Element;
4
+ declare function ToolbarLink({ className, ref, ...props }: BaseToolbar.Link.Props): import("react").JSX.Element;
5
+ declare function ToolbarGroup({ className, ref, ...props }: BaseToolbar.Group.Props): import("react").JSX.Element;
6
+ declare function ToolbarSeparator({ className, ref, ...props }: BaseToolbar.Separator.Props): import("react").JSX.Element;
7
+ declare function ToolbarInput({ className, ref, ...props }: BaseToolbar.Input.Props): import("react").JSX.Element;
8
+ /**
9
+ * Row of controls that is a single tab stop; arrow keys move between them.
10
+ * Other controls join through `render`: `<Toolbar.Button render={<Toggle />} />`,
11
+ * `<Toolbar.Button render={<Menu.Trigger />} />`.
12
+ */
13
+ export declare const Toolbar: {
14
+ Root: typeof ToolbarRoot;
15
+ Button: typeof ToolbarButton;
16
+ Link: typeof ToolbarLink;
17
+ Group: typeof ToolbarGroup;
18
+ Separator: typeof ToolbarSeparator;
19
+ Input: typeof ToolbarInput;
20
+ };
21
+ export {};
@@ -0,0 +1,239 @@
1
+ "use client";
2
+ import { withClass } from "../../utils/cx.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { Toolbar } from "@base-ui/react/toolbar";
6
+ //#region src/components/toolbar/Toolbar.tsx
7
+ function ToolbarRoot(t0) {
8
+ const $ = c(10);
9
+ let className;
10
+ let props;
11
+ let ref;
12
+ if ($[0] !== t0) {
13
+ ({className, ref, ...props} = t0);
14
+ $[0] = t0;
15
+ $[1] = className;
16
+ $[2] = props;
17
+ $[3] = ref;
18
+ } else {
19
+ className = $[1];
20
+ props = $[2];
21
+ ref = $[3];
22
+ }
23
+ let t1;
24
+ if ($[4] !== className) {
25
+ t1 = withClass("oui-toolbar", className);
26
+ $[4] = className;
27
+ $[5] = t1;
28
+ } else t1 = $[5];
29
+ let t2;
30
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
31
+ t2 = /* @__PURE__ */ jsx(Toolbar.Root, {
32
+ ref,
33
+ className: t1,
34
+ ...props
35
+ });
36
+ $[6] = props;
37
+ $[7] = ref;
38
+ $[8] = t1;
39
+ $[9] = t2;
40
+ } else t2 = $[9];
41
+ return t2;
42
+ }
43
+ function ToolbarButton(t0) {
44
+ const $ = c(10);
45
+ let className;
46
+ let props;
47
+ let ref;
48
+ if ($[0] !== t0) {
49
+ ({className, ref, ...props} = t0);
50
+ $[0] = t0;
51
+ $[1] = className;
52
+ $[2] = props;
53
+ $[3] = ref;
54
+ } else {
55
+ className = $[1];
56
+ props = $[2];
57
+ ref = $[3];
58
+ }
59
+ let t1;
60
+ if ($[4] !== className) {
61
+ t1 = withClass("oui-toolbar__button", className);
62
+ $[4] = className;
63
+ $[5] = t1;
64
+ } else t1 = $[5];
65
+ let t2;
66
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
67
+ t2 = /* @__PURE__ */ jsx(Toolbar.Button, {
68
+ ref,
69
+ className: t1,
70
+ ...props
71
+ });
72
+ $[6] = props;
73
+ $[7] = ref;
74
+ $[8] = t1;
75
+ $[9] = t2;
76
+ } else t2 = $[9];
77
+ return t2;
78
+ }
79
+ function ToolbarLink(t0) {
80
+ const $ = c(10);
81
+ let className;
82
+ let props;
83
+ let ref;
84
+ if ($[0] !== t0) {
85
+ ({className, ref, ...props} = t0);
86
+ $[0] = t0;
87
+ $[1] = className;
88
+ $[2] = props;
89
+ $[3] = ref;
90
+ } else {
91
+ className = $[1];
92
+ props = $[2];
93
+ ref = $[3];
94
+ }
95
+ let t1;
96
+ if ($[4] !== className) {
97
+ t1 = withClass("oui-toolbar__link", className);
98
+ $[4] = className;
99
+ $[5] = t1;
100
+ } else t1 = $[5];
101
+ let t2;
102
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
103
+ t2 = /* @__PURE__ */ jsx(Toolbar.Link, {
104
+ ref,
105
+ className: t1,
106
+ ...props
107
+ });
108
+ $[6] = props;
109
+ $[7] = ref;
110
+ $[8] = t1;
111
+ $[9] = t2;
112
+ } else t2 = $[9];
113
+ return t2;
114
+ }
115
+ function ToolbarGroup(t0) {
116
+ const $ = c(10);
117
+ let className;
118
+ let props;
119
+ let ref;
120
+ if ($[0] !== t0) {
121
+ ({className, ref, ...props} = t0);
122
+ $[0] = t0;
123
+ $[1] = className;
124
+ $[2] = props;
125
+ $[3] = ref;
126
+ } else {
127
+ className = $[1];
128
+ props = $[2];
129
+ ref = $[3];
130
+ }
131
+ let t1;
132
+ if ($[4] !== className) {
133
+ t1 = withClass("oui-toolbar__group", className);
134
+ $[4] = className;
135
+ $[5] = t1;
136
+ } else t1 = $[5];
137
+ let t2;
138
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
139
+ t2 = /* @__PURE__ */ jsx(Toolbar.Group, {
140
+ ref,
141
+ className: t1,
142
+ ...props
143
+ });
144
+ $[6] = props;
145
+ $[7] = ref;
146
+ $[8] = t1;
147
+ $[9] = t2;
148
+ } else t2 = $[9];
149
+ return t2;
150
+ }
151
+ function ToolbarSeparator(t0) {
152
+ const $ = c(10);
153
+ let className;
154
+ let props;
155
+ let ref;
156
+ if ($[0] !== t0) {
157
+ ({className, ref, ...props} = t0);
158
+ $[0] = t0;
159
+ $[1] = className;
160
+ $[2] = props;
161
+ $[3] = ref;
162
+ } else {
163
+ className = $[1];
164
+ props = $[2];
165
+ ref = $[3];
166
+ }
167
+ let t1;
168
+ if ($[4] !== className) {
169
+ t1 = withClass("oui-toolbar__separator", className);
170
+ $[4] = className;
171
+ $[5] = t1;
172
+ } else t1 = $[5];
173
+ let t2;
174
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
175
+ t2 = /* @__PURE__ */ jsx(Toolbar.Separator, {
176
+ ref,
177
+ className: t1,
178
+ ...props
179
+ });
180
+ $[6] = props;
181
+ $[7] = ref;
182
+ $[8] = t1;
183
+ $[9] = t2;
184
+ } else t2 = $[9];
185
+ return t2;
186
+ }
187
+ function ToolbarInput(t0) {
188
+ const $ = c(10);
189
+ let className;
190
+ let props;
191
+ let ref;
192
+ if ($[0] !== t0) {
193
+ ({className, ref, ...props} = t0);
194
+ $[0] = t0;
195
+ $[1] = className;
196
+ $[2] = props;
197
+ $[3] = ref;
198
+ } else {
199
+ className = $[1];
200
+ props = $[2];
201
+ ref = $[3];
202
+ }
203
+ let t1;
204
+ if ($[4] !== className) {
205
+ t1 = withClass("oui-input oui-toolbar__input", className);
206
+ $[4] = className;
207
+ $[5] = t1;
208
+ } else t1 = $[5];
209
+ let t2;
210
+ if ($[6] !== props || $[7] !== ref || $[8] !== t1) {
211
+ t2 = /* @__PURE__ */ jsx(Toolbar.Input, {
212
+ ref,
213
+ className: t1,
214
+ ...props
215
+ });
216
+ $[6] = props;
217
+ $[7] = ref;
218
+ $[8] = t1;
219
+ $[9] = t2;
220
+ } else t2 = $[9];
221
+ return t2;
222
+ }
223
+ /**
224
+ * Row of controls that is a single tab stop; arrow keys move between them.
225
+ * Other controls join through `render`: `<Toolbar.Button render={<Toggle />} />`,
226
+ * `<Toolbar.Button render={<Menu.Trigger />} />`.
227
+ */
228
+ var Toolbar$1 = {
229
+ Root: ToolbarRoot,
230
+ Button: ToolbarButton,
231
+ Link: ToolbarLink,
232
+ Group: ToolbarGroup,
233
+ Separator: ToolbarSeparator,
234
+ Input: ToolbarInput
235
+ };
236
+ //#endregion
237
+ export { Toolbar$1 as Toolbar };
238
+
239
+ //# sourceMappingURL=Toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.js","names":["Toolbar","BaseToolbar","withClass","ToolbarRoot","t0","$","_c","className","props","ref","t1","t2","ToolbarButton","ToolbarLink","ToolbarGroup","ToolbarSeparator","ToolbarInput","Root","Button","Link","Group","Separator","Input","_c","BaseToolbar","Toolbar"],"sources":["../../../src/components/toolbar/Toolbar.tsx"],"sourcesContent":["import { Toolbar as BaseToolbar } from '@base-ui/react/toolbar';\nimport { withClass } from '../../utils/cx';\n\nfunction ToolbarRoot({ className, ref, ...props }: BaseToolbar.Root.Props) {\n return <BaseToolbar.Root ref={ref} className={withClass('oui-toolbar', className)} {...props} />;\n}\n\nfunction ToolbarButton({ className, ref, ...props }: BaseToolbar.Button.Props) {\n return <BaseToolbar.Button ref={ref} className={withClass('oui-toolbar__button', className)} {...props} />;\n}\n\nfunction ToolbarLink({ className, ref, ...props }: BaseToolbar.Link.Props) {\n return <BaseToolbar.Link ref={ref} className={withClass('oui-toolbar__link', className)} {...props} />;\n}\n\nfunction ToolbarGroup({ className, ref, ...props }: BaseToolbar.Group.Props) {\n return <BaseToolbar.Group ref={ref} className={withClass('oui-toolbar__group', className)} {...props} />;\n}\n\nfunction ToolbarSeparator({ className, ref, ...props }: BaseToolbar.Separator.Props) {\n return <BaseToolbar.Separator ref={ref} className={withClass('oui-toolbar__separator', className)} {...props} />;\n}\n\nfunction ToolbarInput({ className, ref, ...props }: BaseToolbar.Input.Props) {\n return <BaseToolbar.Input ref={ref} className={withClass('oui-input oui-toolbar__input', className)} {...props} />;\n}\n\n/**\n * Row of controls that is a single tab stop; arrow keys move between them.\n * Other controls join through `render`: `<Toolbar.Button render={<Toggle />} />`,\n * `<Toolbar.Button render={<Menu.Trigger />} />`.\n */\nexport const Toolbar = {\n Root: ToolbarRoot,\n Button: ToolbarButton,\n Link: ToolbarLink,\n Group: ToolbarGroup,\n Separator: ToolbarSeparator,\n Input: ToolbarInput,\n};\n"],"mappings":";;;;;;AAGA,SAAAG,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAqB,CAAA,CAAAG,WAAAE,KAAA,GAAAD,SAAAJ;EAAoDC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAF,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAI,MAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAE,WAAA;EACzBG,KAAAR,UAAU,eAAeK,SAAS;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAM;CAAA,IAAAN,EAAA,OAAAG,SAAAH,EAAA,OAAAI,OAAAJ,EAAA,OAAAK,IAAA;EAA1EC,KAAA,oBAAAa,QAAA,MAAA;GAAuBf;GAAgB,WAAAC;GAAmC,GAAMF;EAAK,CAAA;EAAIH,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAAzFM;AAAyF;AAGlG,SAAAC,cAAAR,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EA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A;GAAwBf;GAAgB,WAAAC;GAAoD,GAAMF;EAAK,CAAA;EAAIH,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;EAAAL,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,OAA3GM;AAA2G;;;;;;AAQpH,IAAaX,YAAU;CACrBiB,MAAMd;CACNe,QAAQN;CACRO,MAAMN;CACNO,OAAON;CACPO,WAAWN;CACXO,OAAON;AACT"}
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
3
+ export interface TooltipContentProps extends BaseTooltip.Popup.Props {
4
+ side?: BaseTooltip.Positioner.Props['side'];
5
+ align?: BaseTooltip.Positioner.Props['align'];
6
+ sideOffset?: BaseTooltip.Positioner.Props['sideOffset'];
7
+ arrow?: boolean;
8
+ positionerProps?: BaseTooltip.Positioner.Props;
9
+ }
10
+ declare function TooltipContent({ side, align, sideOffset, arrow, positionerProps, className, children, ref, ...props }: TooltipContentProps): React.JSX.Element;
11
+ export interface TooltipProps extends Omit<BaseTooltip.Root.Props, 'children'> {
12
+ /** Tooltip text. */
13
+ content: React.ReactNode;
14
+ /** The trigger. Must be a single element that accepts a ref (e.g. a Button). */
15
+ children: React.ReactElement;
16
+ side?: TooltipContentProps['side'];
17
+ align?: TooltipContentProps['align'];
18
+ /** Hover delay in ms. */
19
+ delay?: number;
20
+ contentProps?: Omit<TooltipContentProps, 'children'>;
21
+ }
22
+ declare function TooltipComponent({ content, children, side, align, delay, contentProps, ...rootProps }: TooltipProps): React.JSX.Element;
23
+ /**
24
+ * `<Tooltip content="Export"><IconButton … /></Tooltip>`.
25
+ * Wrap the app in `Tooltip.Provider` so adjacent tooltips open instantly.
26
+ */
27
+ export declare const Tooltip: typeof TooltipComponent & {
28
+ Provider: React.FC<import("@base-ui/react").TooltipProviderProps>;
29
+ Root: <Payload>(props: BaseTooltip.Root.Props<Payload>) => React.JSX.Element;
30
+ Trigger: BaseTooltip.Trigger;
31
+ Content: typeof TooltipContent;
32
+ };
33
+ export {};
@@ -0,0 +1,182 @@
1
+ "use client";
2
+ import { usePortalContainer } from "../../utils/portal.js";
3
+ import { withClass } from "../../utils/cx.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Tooltip } from "@base-ui/react/tooltip";
8
+ //#region src/components/tooltip/Tooltip.tsx
9
+ function TooltipContent(t0) {
10
+ const $ = c(29);
11
+ let children;
12
+ let className;
13
+ let positionerProps;
14
+ let props;
15
+ let ref;
16
+ let t1;
17
+ let t2;
18
+ let t3;
19
+ let t4;
20
+ if ($[0] !== t0) {
21
+ ({side: t1, align: t2, sideOffset: t3, arrow: t4, positionerProps, className, children, ref, ...props} = t0);
22
+ $[0] = t0;
23
+ $[1] = children;
24
+ $[2] = className;
25
+ $[3] = positionerProps;
26
+ $[4] = props;
27
+ $[5] = ref;
28
+ $[6] = t1;
29
+ $[7] = t2;
30
+ $[8] = t3;
31
+ $[9] = t4;
32
+ } else {
33
+ children = $[1];
34
+ className = $[2];
35
+ positionerProps = $[3];
36
+ props = $[4];
37
+ ref = $[5];
38
+ t1 = $[6];
39
+ t2 = $[7];
40
+ t3 = $[8];
41
+ t4 = $[9];
42
+ }
43
+ const side = t1 === void 0 ? "top" : t1;
44
+ const align = t2 === void 0 ? "center" : t2;
45
+ const sideOffset = t3 === void 0 ? 8 : t3;
46
+ const arrow = t4 === void 0 ? true : t4;
47
+ const container = usePortalContainer();
48
+ let t5;
49
+ if ($[10] !== className) {
50
+ t5 = withClass("oui-tooltip", className);
51
+ $[10] = className;
52
+ $[11] = t5;
53
+ } else t5 = $[11];
54
+ let t6;
55
+ if ($[12] !== arrow) {
56
+ t6 = arrow && /* @__PURE__ */ jsx(Tooltip.Arrow, { className: "oui-tooltip__arrow" });
57
+ $[12] = arrow;
58
+ $[13] = t6;
59
+ } else t6 = $[13];
60
+ let t7;
61
+ if ($[14] !== children || $[15] !== props || $[16] !== ref || $[17] !== t5 || $[18] !== t6) {
62
+ t7 = /* @__PURE__ */ jsxs(Tooltip.Popup, {
63
+ ref,
64
+ className: t5,
65
+ ...props,
66
+ children: [t6, children]
67
+ });
68
+ $[14] = children;
69
+ $[15] = props;
70
+ $[16] = ref;
71
+ $[17] = t5;
72
+ $[18] = t6;
73
+ $[19] = t7;
74
+ } else t7 = $[19];
75
+ let t8;
76
+ if ($[20] !== align || $[21] !== positionerProps || $[22] !== side || $[23] !== sideOffset || $[24] !== t7) {
77
+ t8 = /* @__PURE__ */ jsx(Tooltip.Positioner, {
78
+ className: "oui-tooltip__positioner",
79
+ side,
80
+ align,
81
+ sideOffset,
82
+ ...positionerProps,
83
+ children: t7
84
+ });
85
+ $[20] = align;
86
+ $[21] = positionerProps;
87
+ $[22] = side;
88
+ $[23] = sideOffset;
89
+ $[24] = t7;
90
+ $[25] = t8;
91
+ } else t8 = $[25];
92
+ let t9;
93
+ if ($[26] !== container || $[27] !== t8) {
94
+ t9 = /* @__PURE__ */ jsx(Tooltip.Portal, {
95
+ container,
96
+ children: t8
97
+ });
98
+ $[26] = container;
99
+ $[27] = t8;
100
+ $[28] = t9;
101
+ } else t9 = $[28];
102
+ return t9;
103
+ }
104
+ function TooltipComponent(t0) {
105
+ const $ = c(20);
106
+ let align;
107
+ let children;
108
+ let content;
109
+ let contentProps;
110
+ let delay;
111
+ let rootProps;
112
+ let side;
113
+ if ($[0] !== t0) {
114
+ ({content, children, side, align, delay, contentProps, ...rootProps} = t0);
115
+ $[0] = t0;
116
+ $[1] = align;
117
+ $[2] = children;
118
+ $[3] = content;
119
+ $[4] = contentProps;
120
+ $[5] = delay;
121
+ $[6] = rootProps;
122
+ $[7] = side;
123
+ } else {
124
+ align = $[1];
125
+ children = $[2];
126
+ content = $[3];
127
+ contentProps = $[4];
128
+ delay = $[5];
129
+ rootProps = $[6];
130
+ side = $[7];
131
+ }
132
+ let t1;
133
+ if ($[8] !== children || $[9] !== delay) {
134
+ t1 = /* @__PURE__ */ jsx(Tooltip.Trigger, {
135
+ delay,
136
+ render: children
137
+ });
138
+ $[8] = children;
139
+ $[9] = delay;
140
+ $[10] = t1;
141
+ } else t1 = $[10];
142
+ let t2;
143
+ if ($[11] !== align || $[12] !== content || $[13] !== contentProps || $[14] !== side) {
144
+ t2 = /* @__PURE__ */ jsx(TooltipContent, {
145
+ side,
146
+ align,
147
+ ...contentProps,
148
+ children: content
149
+ });
150
+ $[11] = align;
151
+ $[12] = content;
152
+ $[13] = contentProps;
153
+ $[14] = side;
154
+ $[15] = t2;
155
+ } else t2 = $[15];
156
+ let t3;
157
+ if ($[16] !== rootProps || $[17] !== t1 || $[18] !== t2) {
158
+ t3 = /* @__PURE__ */ jsxs(Tooltip.Root, {
159
+ ...rootProps,
160
+ children: [t1, t2]
161
+ });
162
+ $[16] = rootProps;
163
+ $[17] = t1;
164
+ $[18] = t2;
165
+ $[19] = t3;
166
+ } else t3 = $[19];
167
+ return t3;
168
+ }
169
+ /**
170
+ * `<Tooltip content="Export"><IconButton … /></Tooltip>`.
171
+ * Wrap the app in `Tooltip.Provider` so adjacent tooltips open instantly.
172
+ */
173
+ var Tooltip$1 = Object.assign(TooltipComponent, {
174
+ Provider: Tooltip.Provider,
175
+ Root: Tooltip.Root,
176
+ Trigger: Tooltip.Trigger,
177
+ Content: TooltipContent
178
+ });
179
+ //#endregion
180
+ export { Tooltip$1 as Tooltip };
181
+
182
+ //# sourceMappingURL=Tooltip.js.map