@vikram-hegde/skeletal 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/alert-dialog/index.d.ts +2 -0
- package/dist/alert-dialog/index.js +2 -0
- package/dist/alert-dialog-1hxVC_5N.js +71 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +2 -0
- package/dist/badge-C3p1L0E7.css +53 -0
- package/dist/badge-C3p1L0E7.js +32 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +2 -0
- package/dist/button-B48UNbaC.css +152 -0
- package/dist/button-B48UNbaC.js +46 -0
- package/dist/button-Dvd4n2U4.d.ts +56 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-wh2BoiSj.css +76 -0
- package/dist/checkbox-wh2BoiSj.js +112 -0
- package/dist/cluster-BJ4m5uGN.css +9 -0
- package/dist/cluster-BJ4m5uGN.js +21 -0
- package/dist/combobox/index.d.ts +2 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox-DWH7uSsx.css +389 -0
- package/dist/combobox-DWH7uSsx.js +327 -0
- package/dist/command-palette/index.d.ts +2 -0
- package/dist/command-palette/index.js +2 -0
- package/dist/command-palette-DF4XJ8qz.css +164 -0
- package/dist/command-palette-DF4XJ8qz.js +191 -0
- package/dist/dialog/index.d.ts +6 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog-C4yqxII_.js +73 -0
- package/dist/dialog-footer-Br9KZP4v.js +29 -0
- package/dist/dialog-footer-bNVIVPbu.d.ts +56 -0
- package/dist/dialog-portal-B21WFYkQ.css +131 -0
- package/dist/dialog-portal-B21WFYkQ.js +26 -0
- package/dist/dialog-portal-BF89FBeX.d.ts +15 -0
- package/dist/dialog-title-DRYRIxCp.js +35 -0
- package/dist/dialog-title-jyf86Q8C.d.ts +36 -0
- package/dist/dialog-viewport-CaMWJrCJ.d.ts +42 -0
- package/dist/dialog-viewport-vpbsq7Ib.js +21 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +2 -0
- package/dist/drawer-DQmz_uCP.css +214 -0
- package/dist/drawer-DQmz_uCP.js +180 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon-DBOdxNvH.css +6 -0
- package/dist/icon-DBOdxNvH.js +20 -0
- package/dist/index-A2QmU5r9.d.ts +37 -0
- package/dist/index-B0uNLS7z.d.ts +301 -0
- package/dist/index-B63PSP58.d.ts +94 -0
- package/dist/index-BBOkTl3h.d.ts +261 -0
- package/dist/index-BLFVnve3.d.ts +53 -0
- package/dist/index-BXPUT5u-.d.ts +72 -0
- package/dist/index-BngvATZx.d.ts +35 -0
- package/dist/index-Br2NrBW_.d.ts +444 -0
- package/dist/index-CUy-9csi.d.ts +135 -0
- package/dist/index-CbMW32E9.d.ts +82 -0
- package/dist/index-CyTcR6iv.d.ts +433 -0
- package/dist/index-CznsZ_1M.d.ts +85 -0
- package/dist/index-D-6gOciw.d.ts +350 -0
- package/dist/index-DdqDyczP.d.ts +209 -0
- package/dist/index-GOGpFujX.d.ts +144 -0
- package/dist/index-W3ozKcis.d.ts +245 -0
- package/dist/index-kpw3_4q_.d.ts +50 -0
- package/dist/index-rH7TJeJt.d.ts +334 -0
- package/dist/index-rQ7sRkqg.d.ts +122 -0
- package/dist/index.css +93 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +26 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +2 -0
- package/dist/input-CQ_ean8e.css +129 -0
- package/dist/input-CQ_ean8e.js +65 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +4 -0
- package/dist/layout-qoyutnKU.css +181 -0
- package/dist/layout-qoyutnKU.js +169 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu-DRdGMI_-.css +236 -0
- package/dist/menu-DRdGMI_-.js +243 -0
- package/dist/merge-class-name-C4KJJGuK.js +15 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +2 -0
- package/dist/popover-CenynT0Z.css +139 -0
- package/dist/popover-CenynT0Z.js +174 -0
- package/dist/radio/index.d.ts +2 -0
- package/dist/radio/index.js +2 -0
- package/dist/radio-BJrvdkga.css +80 -0
- package/dist/radio-BJrvdkga.js +75 -0
- package/dist/scroll-area/index.d.ts +2 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/scroll-area-DkORxJE9.css +175 -0
- package/dist/scroll-area-DkORxJE9.js +114 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +2 -0
- package/dist/select-BaqBHUac.css +273 -0
- package/dist/select-BaqBHUac.js +254 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton-W6fwO5pf.css +88 -0
- package/dist/skeleton-W6fwO5pf.js +97 -0
- package/dist/spinner/index.d.ts +2 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner-DB6ap8Si.css +43 -0
- package/dist/spinner-DB6ap8Si.js +27 -0
- package/dist/stack-BzFVrsmT.css +12 -0
- package/dist/stack-BzFVrsmT.js +52 -0
- package/dist/style-vars-ZSrCUzKx.js +13 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch-DizP31iF.css +76 -0
- package/dist/switch-DizP31iF.js +58 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip-CQk2WjUS.css +92 -0
- package/dist/tooltip-CQk2WjUS.js +138 -0
- package/package.json +68 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import './combobox-DWH7uSsx.css';
|
|
2
|
+
import { t as mergeClassName } from "./merge-class-name-C4KJJGuK.js";
|
|
3
|
+
import { t as Button } from "./button-B48UNbaC.js";
|
|
4
|
+
import { t as Icon$1 } from "./icon-DBOdxNvH.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Combobox } from "@base-ui/react/combobox";
|
|
7
|
+
import { CaretDown } from "@phosphor-icons/react";
|
|
8
|
+
//#region src/combobox/combobox.module.css
|
|
9
|
+
var combobox_module_default = {
|
|
10
|
+
"combobox__arrow": "--7Iuq_combobox__arrow",
|
|
11
|
+
"combobox__backdrop": "--7Iuq_combobox__backdrop",
|
|
12
|
+
"combobox__chip": "--7Iuq_combobox__chip",
|
|
13
|
+
"combobox__chip-remove": "--7Iuq_combobox__chip-remove",
|
|
14
|
+
"combobox__chips": "--7Iuq_combobox__chips",
|
|
15
|
+
"combobox__clear": "--7Iuq_combobox__clear",
|
|
16
|
+
"combobox__empty": "--7Iuq_combobox__empty",
|
|
17
|
+
"combobox__group": "--7Iuq_combobox__group",
|
|
18
|
+
"combobox__group-label": "--7Iuq_combobox__group-label",
|
|
19
|
+
"combobox__icon": "--7Iuq_combobox__icon",
|
|
20
|
+
"combobox__input": "--7Iuq_combobox__input",
|
|
21
|
+
"combobox__input-group": "--7Iuq_combobox__input-group",
|
|
22
|
+
"combobox__item": "--7Iuq_combobox__item",
|
|
23
|
+
"combobox__item-indicator": "--7Iuq_combobox__item-indicator",
|
|
24
|
+
"combobox__label": "--7Iuq_combobox__label",
|
|
25
|
+
"combobox__list": "--7Iuq_combobox__list",
|
|
26
|
+
"combobox__popup": "--7Iuq_combobox__popup",
|
|
27
|
+
"combobox__portal": "--7Iuq_combobox__portal",
|
|
28
|
+
"combobox__positioner": "--7Iuq_combobox__positioner",
|
|
29
|
+
"combobox__row": "--7Iuq_combobox__row",
|
|
30
|
+
"combobox__separator": "--7Iuq_combobox__separator",
|
|
31
|
+
"combobox__status": "--7Iuq_combobox__status",
|
|
32
|
+
"combobox__trigger": "--7Iuq_combobox__trigger"
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/combobox/combobox-arrow.tsx
|
|
36
|
+
function ComboboxArrow({ className, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(Combobox.Arrow, {
|
|
38
|
+
className: mergeClassName(combobox_module_default.combobox__arrow, className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/combobox/combobox-backdrop.tsx
|
|
44
|
+
function ComboboxBackdrop({ className, ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(Combobox.Backdrop, {
|
|
46
|
+
className: mergeClassName(combobox_module_default.combobox__backdrop, className),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/combobox/combobox-chip.tsx
|
|
52
|
+
function ComboboxChip({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(Combobox.Chip, {
|
|
54
|
+
className: mergeClassName(combobox_module_default.combobox__chip, className),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/combobox/combobox-chip-remove.tsx
|
|
60
|
+
function ComboboxChipRemove({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
62
|
+
className: mergeClassName(combobox_module_default["combobox__chip-remove"], className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/combobox/combobox-chips.tsx
|
|
68
|
+
function ComboboxChips({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(Combobox.Chips, {
|
|
70
|
+
className: mergeClassName(combobox_module_default.combobox__chips, className),
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/combobox/combobox-clear.tsx
|
|
76
|
+
function ComboboxClear({ className, variant = "ghost", size = "sm", fullWidth = false, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(Combobox.Clear, {
|
|
78
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
79
|
+
variant,
|
|
80
|
+
size,
|
|
81
|
+
fullWidth,
|
|
82
|
+
className: mergeClassName(combobox_module_default.combobox__clear, className)
|
|
83
|
+
}),
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/combobox/combobox-collection.tsx
|
|
89
|
+
function ComboboxCollection(props) {
|
|
90
|
+
return /* @__PURE__ */ jsx(Combobox.Collection, { ...props });
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/combobox/combobox-empty.tsx
|
|
94
|
+
function ComboboxEmpty({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
96
|
+
className: mergeClassName(combobox_module_default.combobox__empty, className),
|
|
97
|
+
...props
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/combobox/combobox-group.tsx
|
|
102
|
+
function ComboboxGroup({ className, ...props }) {
|
|
103
|
+
return /* @__PURE__ */ jsx(Combobox.Group, {
|
|
104
|
+
className: mergeClassName(combobox_module_default.combobox__group, className),
|
|
105
|
+
...props
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/combobox/combobox-group-label.tsx
|
|
110
|
+
function ComboboxGroupLabel({ className, ...props }) {
|
|
111
|
+
return /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
112
|
+
className: mergeClassName(combobox_module_default["combobox__group-label"], className),
|
|
113
|
+
...props
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/combobox/combobox-input.tsx
|
|
118
|
+
function ComboboxInput({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx(Combobox.Input, {
|
|
120
|
+
className: mergeClassName(combobox_module_default.combobox__input, className),
|
|
121
|
+
...props
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/combobox/combobox-input-group.tsx
|
|
126
|
+
function ComboboxInputGroup({ className, ...props }) {
|
|
127
|
+
return /* @__PURE__ */ jsx(Combobox.InputGroup, {
|
|
128
|
+
className: mergeClassName(combobox_module_default["combobox__input-group"], className),
|
|
129
|
+
...props
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/combobox/combobox-item.tsx
|
|
134
|
+
function ComboboxItem({ className, ...props }) {
|
|
135
|
+
return /* @__PURE__ */ jsx(Combobox.Item, {
|
|
136
|
+
className: mergeClassName(combobox_module_default.combobox__item, className),
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/combobox/combobox-item-indicator.tsx
|
|
142
|
+
function ComboboxItemIndicator({ className, ...props }) {
|
|
143
|
+
return /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
144
|
+
className: mergeClassName(combobox_module_default["combobox__item-indicator"], className),
|
|
145
|
+
...props
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/combobox/combobox-label.tsx
|
|
150
|
+
function ComboboxLabel({ className, ...props }) {
|
|
151
|
+
return /* @__PURE__ */ jsx(Combobox.Label, {
|
|
152
|
+
className: mergeClassName(combobox_module_default.combobox__label, className),
|
|
153
|
+
...props
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/combobox/combobox-list.tsx
|
|
158
|
+
function ComboboxList({ className, ...props }) {
|
|
159
|
+
return /* @__PURE__ */ jsx(Combobox.List, {
|
|
160
|
+
className: mergeClassName(combobox_module_default.combobox__list, className),
|
|
161
|
+
...props
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/combobox/combobox-popup.tsx
|
|
166
|
+
function ComboboxPopup({ className, ...props }) {
|
|
167
|
+
return /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
168
|
+
className: mergeClassName(combobox_module_default.combobox__popup, className),
|
|
169
|
+
...props
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/combobox/combobox-portal.tsx
|
|
174
|
+
function ComboboxPortal({ className, ...props }) {
|
|
175
|
+
return /* @__PURE__ */ jsx(Combobox.Portal, {
|
|
176
|
+
className: mergeClassName(combobox_module_default.combobox__portal, className),
|
|
177
|
+
...props
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/combobox/combobox-positioner.tsx
|
|
182
|
+
function ComboboxPositioner({ className, sideOffset = 4, ...props }) {
|
|
183
|
+
return /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
184
|
+
className: mergeClassName(combobox_module_default.combobox__positioner, className),
|
|
185
|
+
sideOffset,
|
|
186
|
+
...props
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/combobox/combobox-root.tsx
|
|
191
|
+
function ComboboxRoot(props) {
|
|
192
|
+
return /* @__PURE__ */ jsx(Combobox.Root, { ...props });
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/combobox/combobox-row.tsx
|
|
196
|
+
function ComboboxRow({ className, ...props }) {
|
|
197
|
+
return /* @__PURE__ */ jsx(Combobox.Row, {
|
|
198
|
+
className: mergeClassName(combobox_module_default.combobox__row, className),
|
|
199
|
+
...props
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/combobox/combobox-separator.tsx
|
|
204
|
+
function ComboboxSeparator({ className, ...props }) {
|
|
205
|
+
return /* @__PURE__ */ jsx(Combobox.Separator, {
|
|
206
|
+
className: mergeClassName(combobox_module_default.combobox__separator, className),
|
|
207
|
+
...props
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/combobox/combobox-status.tsx
|
|
212
|
+
function ComboboxStatus({ className, ...props }) {
|
|
213
|
+
return /* @__PURE__ */ jsx(Combobox.Status, {
|
|
214
|
+
className: mergeClassName(combobox_module_default.combobox__status, className),
|
|
215
|
+
...props
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/combobox/combobox-trigger.tsx
|
|
220
|
+
function ComboboxTrigger({ className, variant = "ghost", size = "sm", fullWidth = false, children, ...props }) {
|
|
221
|
+
return /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
222
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
223
|
+
variant,
|
|
224
|
+
size,
|
|
225
|
+
fullWidth,
|
|
226
|
+
className: mergeClassName(combobox_module_default.combobox__trigger, className)
|
|
227
|
+
}),
|
|
228
|
+
...props,
|
|
229
|
+
children: [children, /* @__PURE__ */ jsx(Combobox.Icon, {
|
|
230
|
+
className: combobox_module_default.combobox__icon,
|
|
231
|
+
children: /* @__PURE__ */ jsx(Icon$1, {
|
|
232
|
+
name: CaretDown,
|
|
233
|
+
size: 16
|
|
234
|
+
})
|
|
235
|
+
})]
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/combobox/combobox-value.tsx
|
|
240
|
+
function ComboboxValue(props) {
|
|
241
|
+
return /* @__PURE__ */ jsx(Combobox.Value, { ...props });
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/combobox/index.ts
|
|
245
|
+
/**
|
|
246
|
+
* Compound component for a filterable select — an input combined with a list of
|
|
247
|
+
* predefined items.
|
|
248
|
+
*
|
|
249
|
+
* Assemble the parts as properties of the object:
|
|
250
|
+
*
|
|
251
|
+
* ```tsx
|
|
252
|
+
* import { Combobox } from '@vikram-hegde/skeletal'
|
|
253
|
+
*
|
|
254
|
+
* const fruits = [
|
|
255
|
+
* { value: 'apple', label: 'Apple' },
|
|
256
|
+
* { value: 'banana', label: 'Banana' },
|
|
257
|
+
* { value: 'orange', label: 'Orange' },
|
|
258
|
+
* ]
|
|
259
|
+
*
|
|
260
|
+
* <Combobox.Root items={fruits}>
|
|
261
|
+
* <Combobox.Label>Choose a fruit</Combobox.Label>
|
|
262
|
+
* <Combobox.InputGroup>
|
|
263
|
+
* <Combobox.Input placeholder="e.g. Apple" />
|
|
264
|
+
* <Combobox.Clear aria-label="Clear selection">
|
|
265
|
+
* <Icon name={X} size={14} />
|
|
266
|
+
* </Combobox.Clear>
|
|
267
|
+
* <Combobox.Trigger aria-label="Open popup" />
|
|
268
|
+
* </Combobox.InputGroup>
|
|
269
|
+
* <Combobox.Portal>
|
|
270
|
+
* <Combobox.Positioner>
|
|
271
|
+
* <Combobox.Popup>
|
|
272
|
+
* <Combobox.Empty>No fruits found.</Combobox.Empty>
|
|
273
|
+
* <Combobox.List>
|
|
274
|
+
* {(fruit) => (
|
|
275
|
+
* <Combobox.Item key={fruit.value} value={fruit}>
|
|
276
|
+
* <Combobox.ItemIndicator>
|
|
277
|
+
* <Icon name={Check} size={14} />
|
|
278
|
+
* </Combobox.ItemIndicator>
|
|
279
|
+
* {fruit.label}
|
|
280
|
+
* </Combobox.Item>
|
|
281
|
+
* )}
|
|
282
|
+
* </Combobox.List>
|
|
283
|
+
* </Combobox.Popup>
|
|
284
|
+
* </Combobox.Positioner>
|
|
285
|
+
* </Combobox.Portal>
|
|
286
|
+
* </Combobox.Root>
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* Composition follows the Base UI anatomy — the popup anchors to the
|
|
290
|
+
* `Combobox.InputGroup` (so it matches the field's width) and handles collision
|
|
291
|
+
* avoidance; `Combobox.Portal` moves it to `<body>`. Add `multiple` to
|
|
292
|
+
* `Combobox.Root` and render `Combobox.Chip`s inside `Combobox.Value` for
|
|
293
|
+
* multi-select. The trigger owns its `CaretDown` chevron — no `Combobox.Icon` is needed.
|
|
294
|
+
*
|
|
295
|
+
* All parts are thin styled wrappers over Base UI's `Combobox`, so every Base UI
|
|
296
|
+
* prop, `render` override, and ref behaves the same. Part prop types are
|
|
297
|
+
* exported separately (`ComboboxProps`, `ComboboxItemProps`, etc.).
|
|
298
|
+
*/
|
|
299
|
+
const Combobox$1 = {
|
|
300
|
+
Root: ComboboxRoot,
|
|
301
|
+
Label: ComboboxLabel,
|
|
302
|
+
InputGroup: ComboboxInputGroup,
|
|
303
|
+
Input: ComboboxInput,
|
|
304
|
+
Trigger: ComboboxTrigger,
|
|
305
|
+
Clear: ComboboxClear,
|
|
306
|
+
Value: ComboboxValue,
|
|
307
|
+
Chips: ComboboxChips,
|
|
308
|
+
Chip: ComboboxChip,
|
|
309
|
+
ChipRemove: ComboboxChipRemove,
|
|
310
|
+
Portal: ComboboxPortal,
|
|
311
|
+
Backdrop: ComboboxBackdrop,
|
|
312
|
+
Positioner: ComboboxPositioner,
|
|
313
|
+
Popup: ComboboxPopup,
|
|
314
|
+
Arrow: ComboboxArrow,
|
|
315
|
+
Status: ComboboxStatus,
|
|
316
|
+
Empty: ComboboxEmpty,
|
|
317
|
+
List: ComboboxList,
|
|
318
|
+
Row: ComboboxRow,
|
|
319
|
+
Item: ComboboxItem,
|
|
320
|
+
ItemIndicator: ComboboxItemIndicator,
|
|
321
|
+
Separator: ComboboxSeparator,
|
|
322
|
+
Group: ComboboxGroup,
|
|
323
|
+
GroupLabel: ComboboxGroupLabel,
|
|
324
|
+
Collection: ComboboxCollection
|
|
325
|
+
};
|
|
326
|
+
//#endregion
|
|
327
|
+
export { Combobox$1 as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as CommandPaletteItemProps, c as CommandPaletteGroupLabelProps, d as CommandPaletteEmptyProps, f as CommandPaletteContentProps, i as CommandPaletteListProps, l as CommandPaletteGroupProps, n as CommandPaletteOpenChangeDetails, o as CommandPaletteInputGroupProps, r as CommandPaletteRootProps, s as CommandPaletteInputProps, t as CommandPalette, u as CommandPaletteFooterProps } from "../index-BBOkTl3h.js";
|
|
2
|
+
export { CommandPalette, type CommandPaletteContentProps, type CommandPaletteEmptyProps, type CommandPaletteFooterProps, type CommandPaletteGroupLabelProps, type CommandPaletteGroupProps, type CommandPaletteInputGroupProps, type CommandPaletteInputProps, type CommandPaletteItemProps, type CommandPaletteListProps, type CommandPaletteOpenChangeDetails, type CommandPaletteRootProps };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
@layer skeletal {
|
|
2
|
+
.gdjOOW_command__content {
|
|
3
|
+
border: 1px solid var(--sk-border);
|
|
4
|
+
border-radius: calc(var(--sk-radius) + .375rem * (var(--sk-radius) / var(--sk-radius)));
|
|
5
|
+
background-color: var(--sk-popover);
|
|
6
|
+
max-block-size: min(70dvb, 30rem);
|
|
7
|
+
inline-size: min(32rem, 100%);
|
|
8
|
+
color: var(--sk-popover-foreground);
|
|
9
|
+
box-shadow: var(--sk-shadow-lg);
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
margin: auto;
|
|
12
|
+
transition: scale .2s ease-out, opacity .2s ease-out;
|
|
13
|
+
display: flex;
|
|
14
|
+
position: relative;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
|
|
17
|
+
&[data-starting-style], &[data-ending-style] {
|
|
18
|
+
opacity: 0;
|
|
19
|
+
scale: .98;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media (prefers-reduced-motion: reduce) {
|
|
23
|
+
transition: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (width < 48rem) {
|
|
27
|
+
border-radius: calc(var(--sk-radius) + .5rem * (var(--sk-radius) / var(--sk-radius)))
|
|
28
|
+
calc(var(--sk-radius) + .5rem * (var(--sk-radius) / var(--sk-radius))) 0 0;
|
|
29
|
+
max-block-size: min(80dvb, 40rem);
|
|
30
|
+
inline-size: 100%;
|
|
31
|
+
max-inline-size: none;
|
|
32
|
+
will-change: transform;
|
|
33
|
+
margin: 0;
|
|
34
|
+
padding-block-end: env(safe-area-inset-bottom, 0px);
|
|
35
|
+
transition: transform .22s ease-out, opacity .22s ease-out;
|
|
36
|
+
transform: translateY(0);
|
|
37
|
+
|
|
38
|
+
&[data-starting-style], &[data-ending-style] {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
transform: translateY(100%) scale3d(1, 1, 1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media (prefers-reduced-motion: reduce) {
|
|
44
|
+
transition: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.gdjOOW_command__input-group {
|
|
50
|
+
border-block-end: 1px solid var(--sk-border);
|
|
51
|
+
color: var(--sk-muted-foreground);
|
|
52
|
+
padding-block: .875rem;
|
|
53
|
+
padding-inline: 1rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.gdjOOW_command__input {
|
|
57
|
+
min-inline-size: 0;
|
|
58
|
+
color: var(--sk-foreground);
|
|
59
|
+
background: none;
|
|
60
|
+
border: none;
|
|
61
|
+
outline: none;
|
|
62
|
+
flex: 1;
|
|
63
|
+
font-family: inherit;
|
|
64
|
+
font-size: .9375rem;
|
|
65
|
+
|
|
66
|
+
&::placeholder {
|
|
67
|
+
color: var(--sk-muted-foreground);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.gdjOOW_command__list {
|
|
72
|
+
overflow-block: auto;
|
|
73
|
+
overscroll-behavior: contain;
|
|
74
|
+
padding: .375rem;
|
|
75
|
+
scroll-padding: .375rem;
|
|
76
|
+
|
|
77
|
+
&[data-empty] {
|
|
78
|
+
padding: 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.gdjOOW_command__item {
|
|
83
|
+
border-radius: var(--sk-radius);
|
|
84
|
+
min-block-size: 2.25rem;
|
|
85
|
+
inline-size: 100%;
|
|
86
|
+
color: var(--sk-foreground);
|
|
87
|
+
text-align: start;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
background: none;
|
|
90
|
+
border: none;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: .625rem;
|
|
93
|
+
padding-block: .375rem;
|
|
94
|
+
padding-inline: .625rem;
|
|
95
|
+
font-family: inherit;
|
|
96
|
+
font-size: .875rem;
|
|
97
|
+
display: flex;
|
|
98
|
+
|
|
99
|
+
&[data-highlighted] {
|
|
100
|
+
background: var(--sk-muted);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:focus-visible {
|
|
104
|
+
outline: 2px solid var(--sk-ring);
|
|
105
|
+
outline-offset: -2px;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.gdjOOW_command__item-hint {
|
|
110
|
+
color: var(--sk-muted-foreground);
|
|
111
|
+
margin-inline-start: auto;
|
|
112
|
+
font-size: .75rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.gdjOOW_command__group {
|
|
116
|
+
display: contents;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.gdjOOW_command__group-label {
|
|
120
|
+
color: var(--sk-muted-foreground);
|
|
121
|
+
letter-spacing: .06em;
|
|
122
|
+
text-transform: uppercase;
|
|
123
|
+
user-select: none;
|
|
124
|
+
padding-block: .75rem .25rem;
|
|
125
|
+
padding-inline: .625rem;
|
|
126
|
+
font-size: .6875rem;
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
line-height: 1.25;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.gdjOOW_command__empty {
|
|
132
|
+
text-align: center;
|
|
133
|
+
color: var(--sk-muted-foreground);
|
|
134
|
+
justify-content: center;
|
|
135
|
+
align-items: center;
|
|
136
|
+
padding-block: 2rem;
|
|
137
|
+
padding-inline: 1rem;
|
|
138
|
+
font-size: .875rem;
|
|
139
|
+
display: flex;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.gdjOOW_command__empty:empty {
|
|
143
|
+
padding: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.gdjOOW_command__footer {
|
|
147
|
+
background-color: var(--sk-muted);
|
|
148
|
+
border-block-start: 1px solid var(--sk-border);
|
|
149
|
+
color: var(--sk-muted-foreground);
|
|
150
|
+
flex-wrap: wrap;
|
|
151
|
+
justify-content: flex-start;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: .5rem;
|
|
154
|
+
padding-block: .5rem;
|
|
155
|
+
padding-inline: .75rem;
|
|
156
|
+
font-size: .75rem;
|
|
157
|
+
display: flex;
|
|
158
|
+
|
|
159
|
+
@media (width < 48rem) {
|
|
160
|
+
margin-block-end: calc(-1 * env(safe-area-inset-bottom, 0px));
|
|
161
|
+
padding-block-end: calc(.5rem + env(safe-area-inset-bottom, 0px));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import './command-palette-DF4XJ8qz.css';
|
|
2
|
+
import { t as mergeClassName } from "./merge-class-name-C4KJJGuK.js";
|
|
3
|
+
import { t as DialogPortal } from "./dialog-portal-B21WFYkQ.js";
|
|
4
|
+
import { n as DialogBackdrop, t as DialogViewport } from "./dialog-viewport-vpbsq7Ib.js";
|
|
5
|
+
import { t as Cluster } from "./cluster-BJ4m5uGN.js";
|
|
6
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Autocomplete } from "@base-ui/react/autocomplete";
|
|
10
|
+
//#region src/command-palette/command-palette.module.css
|
|
11
|
+
var command_palette_module_default = {
|
|
12
|
+
"command__content": "gdjOOW_command__content",
|
|
13
|
+
"command__empty": "gdjOOW_command__empty",
|
|
14
|
+
"command__footer": "gdjOOW_command__footer",
|
|
15
|
+
"command__group": "gdjOOW_command__group",
|
|
16
|
+
"command__group-label": "gdjOOW_command__group-label",
|
|
17
|
+
"command__input": "gdjOOW_command__input",
|
|
18
|
+
"command__input-group": "gdjOOW_command__input-group",
|
|
19
|
+
"command__item": "gdjOOW_command__item",
|
|
20
|
+
"command__item-hint": "gdjOOW_command__item-hint",
|
|
21
|
+
"command__list": "gdjOOW_command__list"
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/command-palette/command-palette-content.tsx
|
|
25
|
+
function CommandPaletteContent({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
27
|
+
className: mergeClassName(command_palette_module_default.command__content, className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/command-palette/command-palette-empty.tsx
|
|
33
|
+
function CommandPaletteEmpty({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(Autocomplete.Empty, {
|
|
35
|
+
className: mergeClassName(command_palette_module_default.command__empty, className),
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/command-palette/command-palette-footer.tsx
|
|
41
|
+
function CommandPaletteFooter({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: clsx(command_palette_module_default.command__footer, className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/command-palette/command-palette-group.tsx
|
|
49
|
+
function CommandPaletteGroup({ className, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Autocomplete.Group, {
|
|
51
|
+
className: mergeClassName(command_palette_module_default.command__group, className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/command-palette/command-palette-group-label.tsx
|
|
57
|
+
function CommandPaletteGroupLabel({ className, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsx(Autocomplete.GroupLabel, {
|
|
59
|
+
className: mergeClassName(command_palette_module_default["command__group-label"], className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/command-palette/command-palette-input.tsx
|
|
65
|
+
function CommandPaletteInput({ className, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(Autocomplete.Input, {
|
|
67
|
+
className: mergeClassName(command_palette_module_default.command__input, className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/command-palette/command-palette-input-group.tsx
|
|
73
|
+
function CommandPaletteInputGroup({ className, children, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx(Autocomplete.InputGroup, {
|
|
75
|
+
className: mergeClassName(command_palette_module_default["command__input-group"], className),
|
|
76
|
+
...props,
|
|
77
|
+
children: /* @__PURE__ */ jsx(Cluster, {
|
|
78
|
+
space: "0.625rem",
|
|
79
|
+
align: "center",
|
|
80
|
+
children
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/command-palette/command-palette-item.tsx
|
|
86
|
+
function CommandPaletteItem({ className, hint, children, ...props }) {
|
|
87
|
+
return /* @__PURE__ */ jsxs(Autocomplete.Item, {
|
|
88
|
+
className: mergeClassName(command_palette_module_default.command__item, className),
|
|
89
|
+
...props,
|
|
90
|
+
children: [children, hint !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
91
|
+
className: command_palette_module_default["command__item-hint"],
|
|
92
|
+
children: hint
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/command-palette/command-palette-list.tsx
|
|
98
|
+
function CommandPaletteList({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx(Autocomplete.List, {
|
|
100
|
+
className: mergeClassName(command_palette_module_default.command__list, className),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/command-palette/command-palette-root.tsx
|
|
106
|
+
function CommandPaletteRoot({ open, defaultOpen, onOpenChange, onOpenChangeComplete, modal = true, children, items, value, defaultValue, onValueChange, onItemHighlighted, mode = "list", autoHighlight = "always", keepHighlight, highlightItemOnHover, itemToStringValue, submitOnItemClick, filter, ...dialogProps }) {
|
|
107
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
108
|
+
open,
|
|
109
|
+
defaultOpen,
|
|
110
|
+
onOpenChange,
|
|
111
|
+
onOpenChangeComplete,
|
|
112
|
+
modal,
|
|
113
|
+
...dialogProps,
|
|
114
|
+
children: /* @__PURE__ */ jsx(Autocomplete.Root, {
|
|
115
|
+
items,
|
|
116
|
+
open,
|
|
117
|
+
defaultOpen,
|
|
118
|
+
inline: true,
|
|
119
|
+
mode,
|
|
120
|
+
value,
|
|
121
|
+
defaultValue,
|
|
122
|
+
onValueChange,
|
|
123
|
+
onItemHighlighted,
|
|
124
|
+
autoHighlight,
|
|
125
|
+
keepHighlight,
|
|
126
|
+
highlightItemOnHover,
|
|
127
|
+
itemToStringValue,
|
|
128
|
+
submitOnItemClick,
|
|
129
|
+
filter,
|
|
130
|
+
children
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/command-palette/index.ts
|
|
136
|
+
/**
|
|
137
|
+
* Compound component for a command palette.
|
|
138
|
+
*
|
|
139
|
+
* Assemble the parts as properties of the object:
|
|
140
|
+
*
|
|
141
|
+
* ```tsx
|
|
142
|
+
* import { CommandPalette } from '@vikram-hegde/skeletal'
|
|
143
|
+
*
|
|
144
|
+
* <CommandPalette.Root open={open} onOpenChange={setOpen} items={commands}>
|
|
145
|
+
* <CommandPalette.Portal>
|
|
146
|
+
* <CommandPalette.Backdrop />
|
|
147
|
+
* <CommandPalette.Viewport>
|
|
148
|
+
* <CommandPalette.Content>
|
|
149
|
+
* <CommandPalette.InputGroup>
|
|
150
|
+
* <Icon name={MagnifyingGlass} size={16} />
|
|
151
|
+
* <CommandPalette.Input placeholder="Type a command…" />
|
|
152
|
+
* </CommandPalette.InputGroup>
|
|
153
|
+
* <CommandPalette.List>
|
|
154
|
+
* {(command) => (
|
|
155
|
+
* <CommandPalette.Item value={command.id} onClick={…}>
|
|
156
|
+
* {command.label}
|
|
157
|
+
* </CommandPalette.Item>
|
|
158
|
+
* )}
|
|
159
|
+
* </CommandPalette.List>
|
|
160
|
+
* <CommandPalette.Empty>No commands found.</CommandPalette.Empty>
|
|
161
|
+
* <CommandPalette.Footer>
|
|
162
|
+
* <kbd>↑↓</kbd> navigate · <kbd>↵</kbd> select
|
|
163
|
+
* </CommandPalette.Footer>
|
|
164
|
+
* </CommandPalette.Content>
|
|
165
|
+
* </CommandPalette.Viewport>
|
|
166
|
+
* </CommandPalette.Portal>
|
|
167
|
+
* </CommandPalette.Root>
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* The palette is a modal Dialog composed with a query-filtered Base UI
|
|
171
|
+
* Autocomplete (`inline` mode): typing filters the items, arrow keys navigate,
|
|
172
|
+
* and Enter/click executes the highlighted command via the item's `onClick`.
|
|
173
|
+
* Open it with a shortcut by controlling `open`.
|
|
174
|
+
*/
|
|
175
|
+
const CommandPalette = {
|
|
176
|
+
Root: CommandPaletteRoot,
|
|
177
|
+
Portal: DialogPortal,
|
|
178
|
+
Backdrop: DialogBackdrop,
|
|
179
|
+
Viewport: DialogViewport,
|
|
180
|
+
Content: CommandPaletteContent,
|
|
181
|
+
InputGroup: CommandPaletteInputGroup,
|
|
182
|
+
Input: CommandPaletteInput,
|
|
183
|
+
List: CommandPaletteList,
|
|
184
|
+
Group: CommandPaletteGroup,
|
|
185
|
+
GroupLabel: CommandPaletteGroupLabel,
|
|
186
|
+
Item: CommandPaletteItem,
|
|
187
|
+
Empty: CommandPaletteEmpty,
|
|
188
|
+
Footer: CommandPaletteFooter
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
export { CommandPalette as t };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { i as DialogBackdropProps, n as DialogViewportProps } from "../dialog-viewport-CaMWJrCJ.js";
|
|
2
|
+
import { i as DialogDescriptionProps, n as DialogTitleProps, o as DialogCloseProps } from "../dialog-title-jyf86Q8C.js";
|
|
3
|
+
import { a as DialogContentSize, i as DialogContentProps, n as DialogFooterProps } from "../dialog-footer-bNVIVPbu.js";
|
|
4
|
+
import { n as DialogPortalProps } from "../dialog-portal-BF89FBeX.js";
|
|
5
|
+
import { n as DialogTriggerProps, r as DialogProps, t as Dialog } from "../index-CznsZ_1M.js";
|
|
6
|
+
export { Dialog, type DialogBackdropProps, type DialogCloseProps, type DialogContentProps, type DialogContentSize, type DialogDescriptionProps, type DialogFooterProps, type DialogPortalProps, type DialogProps, type DialogTitleProps, type DialogTriggerProps, type DialogViewportProps };
|