@plastic-js/tsumiki 0.1.0 → 0.1.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/dist/components/Accordion.js +7 -0
- package/dist/components/Accordion.js.map +1 -0
- package/dist/components/Avatar.js +7 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/CardNumberInput.js +67 -0
- package/dist/components/CardNumberInput.js.map +1 -0
- package/dist/components/Carousel.js +7 -0
- package/dist/components/Carousel.js.map +1 -0
- package/dist/components/Checkbox.js +7 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Clipboard.js +7 -0
- package/dist/components/Clipboard.js.map +1 -0
- package/dist/components/Collapsible.js +7 -0
- package/dist/components/Collapsible.js.map +1 -0
- package/dist/components/ColorPicker.js +7 -0
- package/dist/components/ColorPicker.js.map +1 -0
- package/dist/components/Combobox.js +19 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/ConfirmDialog.js +36 -0
- package/dist/components/ConfirmDialog.js.map +1 -0
- package/dist/components/DateInput.js +7 -0
- package/dist/components/DateInput.js.map +1 -0
- package/dist/components/DatePicker.js +7 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/Dialog.js +218 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/Drawer.js +7 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/Field.js +7 -0
- package/dist/components/Field.js.map +1 -0
- package/dist/components/Fieldset.js +7 -0
- package/dist/components/Fieldset.js.map +1 -0
- package/dist/components/FileUpload.js +7 -0
- package/dist/components/FileUpload.js.map +1 -0
- package/dist/components/FilteredSelect.js +173 -0
- package/dist/components/FilteredSelect.js.map +1 -0
- package/dist/components/FocusTrap.js +7 -0
- package/dist/components/FocusTrap.js.map +1 -0
- package/dist/components/HoverCard.js +7 -0
- package/dist/components/HoverCard.js.map +1 -0
- package/dist/components/Icon.js +37 -0
- package/dist/components/Icon.js.map +1 -0
- package/dist/components/Listbox.js +7 -0
- package/dist/components/Listbox.js.map +1 -0
- package/dist/components/Menu.js +7 -0
- package/dist/components/Menu.js.map +1 -0
- package/dist/components/MoneyInput.js +114 -0
- package/dist/components/MoneyInput.js.map +1 -0
- package/dist/components/MyFilteredSelect.js +119 -0
- package/dist/components/MyFilteredSelect.js.map +1 -0
- package/dist/components/NumberInput.js +7 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/Pagination.js +7 -0
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Popover.js +7 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/Portal.js +7 -0
- package/dist/components/Portal.js.map +1 -0
- package/dist/components/Presence.js +7 -0
- package/dist/components/Presence.js.map +1 -0
- package/dist/components/Progress.js +7 -0
- package/dist/components/Progress.js.map +1 -0
- package/dist/components/RadioGroup.js +7 -0
- package/dist/components/RadioGroup.js.map +1 -0
- package/dist/components/RatingGroup.js +7 -0
- package/dist/components/RatingGroup.js.map +1 -0
- package/dist/components/SearchInput.js +66 -0
- package/dist/components/SearchInput.js.map +1 -0
- package/dist/components/Select.js +7 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/SignaturePad.js +7 -0
- package/dist/components/SignaturePad.js.map +1 -0
- package/dist/components/Skeleton.js +29 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Slider.js +7 -0
- package/dist/components/Slider.js.map +1 -0
- package/dist/components/Splitter.js +7 -0
- package/dist/components/Splitter.js.map +1 -0
- package/dist/components/Steps.js +7 -0
- package/dist/components/Steps.js.map +1 -0
- package/dist/components/SwipeReveal.js +161 -0
- package/dist/components/SwipeReveal.js.map +1 -0
- package/dist/components/Switch.js +7 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/Tabs.js +7 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/TagsInput.js +7 -0
- package/dist/components/TagsInput.js.map +1 -0
- package/dist/components/Toast.js +7 -0
- package/dist/components/Toast.js.map +1 -0
- package/dist/components/Toggle.js +7 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/components/ToggleGroup.js +7 -0
- package/dist/components/ToggleGroup.js.map +1 -0
- package/dist/components/Tooltip.js +7 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/Tour.js +7 -0
- package/dist/components/Tour.js.map +1 -0
- package/dist/components/TreeView.js +7 -0
- package/dist/components/TreeView.js.map +1 -0
- package/dist/index.js +50 -2714
- package/package.json +1 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Combobox, useComboboxContext } from "@plastic-js/ark";
|
|
2
|
+
import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
|
|
3
|
+
import { Loop, createComputed, createContext, createEffect, createSignal, splitProps, useContext } from "@plastic-js/plastic";
|
|
4
|
+
import { collection } from "@zag-js/combobox";
|
|
5
|
+
//#region src/components/FilteredSelect.jsx
|
|
6
|
+
var _tmpl3 = template("<span></span>");
|
|
7
|
+
var _tmpl2 = template("<svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2.5\" viewBox=\"0 0 24 24\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg>");
|
|
8
|
+
var _tmpl = template("<svg fill=\"none\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"2\" viewBox=\"0 0 24 24\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>");
|
|
9
|
+
var access = (value) => {
|
|
10
|
+
return typeof value === "function" ? value() : value;
|
|
11
|
+
};
|
|
12
|
+
var FilterContext = createContext(null);
|
|
13
|
+
var defaultItemToValue = (item) => String(item?.value ?? item?.id ?? item);
|
|
14
|
+
var defaultItemToString = (item) => String(item?.label ?? item?.name ?? item);
|
|
15
|
+
var defaultFilter = (item, query, itemToString) => itemToString(item).toLowerCase().includes(query);
|
|
16
|
+
var Root = (props = {}) => {
|
|
17
|
+
const [local, rest] = splitProps(props, [
|
|
18
|
+
"items",
|
|
19
|
+
"itemToValue",
|
|
20
|
+
"itemToString",
|
|
21
|
+
"filter",
|
|
22
|
+
"inputValue",
|
|
23
|
+
"onInputValueChange",
|
|
24
|
+
"children"
|
|
25
|
+
]);
|
|
26
|
+
const itemToValue = local.itemToValue ?? defaultItemToValue;
|
|
27
|
+
const itemToString = local.itemToString ?? defaultItemToString;
|
|
28
|
+
const filter = local.filter ?? defaultFilter;
|
|
29
|
+
const query = createSignal(access(local.inputValue) ?? "");
|
|
30
|
+
const filteredItems = createComputed(() => {
|
|
31
|
+
const q = query().trim().toLowerCase();
|
|
32
|
+
const list = access(local.items) ?? [];
|
|
33
|
+
return q ? list.filter((item) => filter(item, q, itemToString)) : list;
|
|
34
|
+
});
|
|
35
|
+
const collection$1 = createComputed(() => collection({
|
|
36
|
+
items: filteredItems(),
|
|
37
|
+
itemToValue,
|
|
38
|
+
itemToString
|
|
39
|
+
}));
|
|
40
|
+
return jsx(FilterContext.Provider, mergeProps({
|
|
41
|
+
value: filteredItems,
|
|
42
|
+
children: () => jsx(Combobox.Root, mergeProps(rest, {
|
|
43
|
+
collection: collection$1,
|
|
44
|
+
inputValue: query,
|
|
45
|
+
onInputValueChange: (value) => {
|
|
46
|
+
query(value);
|
|
47
|
+
local.onInputValueChange?.(value);
|
|
48
|
+
},
|
|
49
|
+
children: [jsx(HighlightSingleMatch, mergeProps({
|
|
50
|
+
itemToValue,
|
|
51
|
+
items: filteredItems
|
|
52
|
+
})), () => local.children]
|
|
53
|
+
}))
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
var HighlightSingleMatch = (props = {}) => {
|
|
57
|
+
const combobox = useComboboxContext();
|
|
58
|
+
createEffect(() => {
|
|
59
|
+
const api = combobox();
|
|
60
|
+
const list = props.items();
|
|
61
|
+
if (!api.open || list.length !== 1) return;
|
|
62
|
+
const value = props.itemToValue(list[0]);
|
|
63
|
+
if (api.highlightedValue !== value) api.setHighlightValue(value);
|
|
64
|
+
});
|
|
65
|
+
return null;
|
|
66
|
+
};
|
|
67
|
+
var Input = (props = {}) => {
|
|
68
|
+
const combobox = useComboboxContext();
|
|
69
|
+
return jsx(Combobox.Input, mergeProps(props, { onInput: (event) => combobox().getInputProps().onChange?.(event) }));
|
|
70
|
+
};
|
|
71
|
+
var Items = (props = {}) => {
|
|
72
|
+
return jsx(Loop, mergeProps({
|
|
73
|
+
each: useContext(FilterContext) ?? [],
|
|
74
|
+
children: (item) => props.children?.(item)
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
77
|
+
function ChevronIcon() {
|
|
78
|
+
return _tmpl.cloneNode(true);
|
|
79
|
+
}
|
|
80
|
+
function CheckIcon() {
|
|
81
|
+
return _tmpl2.cloneNode(true);
|
|
82
|
+
}
|
|
83
|
+
var FilteredSelect = (props = {}) => {
|
|
84
|
+
const [local, rest] = splitProps(props, [
|
|
85
|
+
"items",
|
|
86
|
+
"itemToString",
|
|
87
|
+
"itemToValue",
|
|
88
|
+
"placeholder",
|
|
89
|
+
"label",
|
|
90
|
+
"openOnClick",
|
|
91
|
+
"disabled",
|
|
92
|
+
"classNames",
|
|
93
|
+
"emptyText"
|
|
94
|
+
]);
|
|
95
|
+
const cn = local.classNames ?? {};
|
|
96
|
+
return jsx(Root, mergeProps({
|
|
97
|
+
get itemToString() {
|
|
98
|
+
return local.itemToString;
|
|
99
|
+
},
|
|
100
|
+
get itemToValue() {
|
|
101
|
+
return local.itemToValue;
|
|
102
|
+
},
|
|
103
|
+
get items() {
|
|
104
|
+
return local.items;
|
|
105
|
+
},
|
|
106
|
+
get openOnClick() {
|
|
107
|
+
return local.openOnClick ?? true;
|
|
108
|
+
}
|
|
109
|
+
}, rest, { children: [
|
|
110
|
+
() => local.label && jsx(Combobox.Label, mergeProps({
|
|
111
|
+
get className() {
|
|
112
|
+
return cn.label;
|
|
113
|
+
},
|
|
114
|
+
children: () => local.label
|
|
115
|
+
})),
|
|
116
|
+
jsx(Combobox.Control, mergeProps({
|
|
117
|
+
get className() {
|
|
118
|
+
return cn.control;
|
|
119
|
+
},
|
|
120
|
+
children: [jsx(Input, mergeProps({
|
|
121
|
+
get className() {
|
|
122
|
+
return cn.input;
|
|
123
|
+
},
|
|
124
|
+
get disabled() {
|
|
125
|
+
return local.disabled;
|
|
126
|
+
},
|
|
127
|
+
get placeholder() {
|
|
128
|
+
return local.placeholder ?? "Type to search...";
|
|
129
|
+
}
|
|
130
|
+
})), jsx(Combobox.Trigger, mergeProps({
|
|
131
|
+
get className() {
|
|
132
|
+
return cn.trigger;
|
|
133
|
+
},
|
|
134
|
+
type: "button",
|
|
135
|
+
children: jsx(ChevronIcon, {})
|
|
136
|
+
}))]
|
|
137
|
+
})),
|
|
138
|
+
jsx(Combobox.Content, mergeProps({
|
|
139
|
+
get className() {
|
|
140
|
+
return cn.content;
|
|
141
|
+
},
|
|
142
|
+
children: [jsx(Combobox.Empty, mergeProps({
|
|
143
|
+
get className() {
|
|
144
|
+
return cn.empty;
|
|
145
|
+
},
|
|
146
|
+
children: () => local.emptyText ?? "No results found"
|
|
147
|
+
})), jsx(Items, mergeProps({ children: (item) => jsx(Combobox.Item, mergeProps({
|
|
148
|
+
get className() {
|
|
149
|
+
return cn.item;
|
|
150
|
+
},
|
|
151
|
+
item,
|
|
152
|
+
get key() {
|
|
153
|
+
return local.itemToValue?.(item) ?? item;
|
|
154
|
+
},
|
|
155
|
+
children: [jsx(Combobox.ItemText, mergeProps({
|
|
156
|
+
get className() {
|
|
157
|
+
return cn.itemText;
|
|
158
|
+
},
|
|
159
|
+
children: () => local.itemToString?.(item) ?? String(item)
|
|
160
|
+
})), () => {
|
|
161
|
+
const _el0 = _tmpl3.cloneNode(true);
|
|
162
|
+
insert(_el0, () => jsx(CheckIcon, {}));
|
|
163
|
+
setProp(_el0, "className", () => cn.check);
|
|
164
|
+
return _el0;
|
|
165
|
+
}]
|
|
166
|
+
})) }))]
|
|
167
|
+
}))
|
|
168
|
+
] }));
|
|
169
|
+
};
|
|
170
|
+
//#endregion
|
|
171
|
+
export { FilteredSelect as default };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=FilteredSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilteredSelect.js","names":["Combobox","useComboboxContext","Loop","createComputed","createContext","createEffect","createSignal","splitProps","useContext","collection","createCollection","_tmpl3","_template","_tmpl2","_tmpl","access","value","FilterContext","defaultItemToValue","item","String","id","defaultItemToString","label","name","defaultFilter","query","itemToString","toLowerCase","includes","Root","props","local","rest","itemToValue","filter","inputValue","filteredItems","q","trim","list","items","_jsx","Provider","_mergeProps","children","onInputValueChange","HighlightSingleMatch","combobox","api","open","length","highlightedValue","setHighlightValue","Input","onInput","event","getInputProps","onChange","Items","each","ChevronIcon","cloneNode","CheckIcon","FilteredSelect","cn","classNames","openOnClick","Label","className","Control","control","input","disabled","placeholder","Trigger","trigger","type","Content","content","Empty","empty","emptyText","Item","key","ItemText","itemText","_el0","_insert","_setProp","check"],"sources":["../../src/components/FilteredSelect.jsx"],"sourcesContent":["import { Combobox, useComboboxContext } from '@plastic-js/ark'\nimport {\n\tLoop, createComputed, createContext, createEffect, createSignal, splitProps, useContext,\n} from '@plastic-js/plastic'\nimport { collection as createCollection } from '@zag-js/combobox'\n\n// FilteredSelect — a filterable single-select built on the pure `Combobox`\n// primitive's underlying headless machine.\n//\n// This file owns two things:\n// 1. The filter plumbing. The headless component is \"controlled collection\"\n// only: it expects you to build a @zag-js collection yourself and narrow it\n// down as the user types. The internal <Root> keeps a query in sync with the\n// input, filters the list and feeds a reactive collection back to the\n// headless Root.\n// 2. The public API / contract. The default-exported <FilteredSelect> assembles\n// the full structure (label, control, input, trigger, content, items) and\n// exposes a flat prop API. It is intentionally style-agnostic: every visual\n// slot is themed through the `classNames` map, so the styling layer\n// (MyFilteredSelect) only has to supply CSS.\n\nconst access = (value)=> {\n\treturn typeof value === 'function' ? value() : value\n}\n\n// Exposes the filtered items to <Items> without forcing the caller to thread\n// them through props.\nconst FilterContext = createContext(null)\n\nconst defaultItemToValue = item=> String(item?.value ?? item?.id ?? item)\nconst defaultItemToString = item=> String(item?.label ?? item?.name ?? item)\n\n// Substring match on the item's display string. Override via the `filter` prop\n// for fuzzy/score-based matching.\nconst defaultFilter = (item, query, itemToString)=> itemToString(item).toLowerCase().includes(query)\n\nconst Root = (props = {})=> {\n\tconst [local, rest] = splitProps(props, [\n\t\t'items', 'itemToValue', 'itemToString', 'filter', 'inputValue', 'onInputValueChange', 'children',\n\t])\n\n\tconst itemToValue = local.itemToValue ?? defaultItemToValue\n\tconst itemToString = local.itemToString ?? defaultItemToString\n\tconst filter = local.filter ?? defaultFilter\n\n\t// Internal query mirrors the input. We seed it from any `inputValue` the\n\t// caller passed so an initial/controlled value still filters correctly.\n\tconst query = createSignal(access(local.inputValue) ?? '')\n\n\t// Recomputes on typing and whenever the source `items` change. An empty\n\t// query shows everything; otherwise only the matches survive.\n\tconst filteredItems = createComputed(()=> {\n\t\tconst q = query().trim().toLowerCase()\n\t\tconst list = access(local.items) ?? []\n\t\treturn q ? list.filter(item=> filter(item, q, itemToString)) : list\n\t})\n\n\tconst collection = createComputed(()=> createCollection({\n\t\titems: filteredItems(),\n\t\titemToValue,\n\t\titemToString,\n\t}))\n\n\treturn (\n\t\t<FilterContext.Provider value={filteredItems}>\n\t\t\t<Combobox.Root\n\t\t\t\t{...rest}\n\t\t\t\tcollection={collection}\n\t\t\t\tinputValue={query}\n\t\t\t\tonInputValueChange={(value)=> {\n\t\t\t\t\tquery(value)\n\t\t\t\t\tlocal.onInputValueChange?.(value)\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<HighlightSingleMatch itemToValue={itemToValue} items={filteredItems} />\n\t\t\t\t{local.children}\n\t\t\t</Combobox.Root>\n\t\t</FilterContext.Provider>\n\t)\n}\n\n// When the open list narrows to a single match, pre-highlight it so the user\n// can confirm with Enter/Tab without arrowing down. We nudge the machine's own\n// (uncontrolled) highlight imperatively rather than controlling `highlightedValue`\n// — controlling it would pin the highlight in place and fight the machine, e.g.\n// blocking the highlight-clear on the next keystroke and the select-and-close on\n// Enter. We only set it; the machine still clears/moves it on input and navigation.\nconst HighlightSingleMatch = (props = {})=> {\n\tconst combobox = useComboboxContext()\n\tcreateEffect(()=> {\n\t\tconst api = combobox()\n\t\tconst list = props.items()\n\t\tif (!api.open || list.length !== 1){ return }\n\t\tconst value = props.itemToValue(list[0])\n\t\tif (api.highlightedValue !== value){ api.setHighlightValue(value) }\n\t})\n\treturn null\n}\n\n// The headless input only fires zag's INPUT.CHANGE on the native `change`\n// event — which, unlike React's onChange, fires on blur, not per keystroke. So\n// typing never reached the machine and the list never filtered. We bridge the\n// per-keystroke `input` event to zag's own onChange handler so every character\n// drives the same INPUT.CHANGE (open + filter) behaviour.\nconst Input = (props = {})=> {\n\tconst combobox = useComboboxContext()\n\treturn (\n\t\t<Combobox.Input\n\t\t\t{...props}\n\t\t\tonInput={event=> combobox().getInputProps().onChange?.(event)}\n\t\t/>\n\t)\n}\n\n// Render-prop over the filtered items. Place inside <Combobox.Content> and\n// return a <Combobox.Item> for each match. Backed by <Loop> so the list stays\n// reactive — a bare thunk returned from a component is unwrapped once and would\n// never re-filter.\nconst Items = (props = {})=> {\n\tconst items = useContext(FilterContext)\n\treturn (\n\t\t<Loop each={items ?? []}>\n\t\t\t{item=> props.children?.(item)}\n\t\t</Loop>\n\t)\n}\n\nfunction ChevronIcon(){\n\treturn (\n\t\t<svg\n\t\t\tfill='none' stroke='currentColor' strokeLinecap='round' strokeLinejoin='round'\n\t\t\tstrokeWidth='2' viewBox='0 0 24 24'\n\t\t>\n\t\t\t<polyline points='6 9 12 15 18 9' />\n\t\t</svg>\n\t)\n}\n\nfunction CheckIcon(){\n\treturn (\n\t\t<svg\n\t\t\tfill='none' stroke='currentColor' strokeLinecap='round' strokeLinejoin='round'\n\t\t\tstrokeWidth='2.5' viewBox='0 0 24 24'\n\t\t>\n\t\t\t<polyline points='20 6 9 17 4 12' />\n\t\t</svg>\n\t)\n}\n\n// Public component. `classNames` themes each slot (control/input/trigger/content/\n// empty/item/itemText/check/label); anything not split here (e.g. `filter`,\n// `name`) flows through to the filter Root.\nconst FilteredSelect = (props = {})=> {\n\tconst [local, rest] = splitProps(props, [\n\t\t'items',\n\t\t'itemToString',\n\t\t'itemToValue',\n\t\t'placeholder',\n\t\t'label',\n\t\t'openOnClick',\n\t\t'disabled',\n\t\t'classNames',\n\t\t'emptyText',\n\t])\n\n\tconst cn = local.classNames ?? {}\n\n\t// `value`, `onValueChange`, `filter`, `name`, … are not transformed here, so\n\t// they ride `rest` straight through to the underlying machine.\n\treturn (\n\t\t<Root\n\t\t\titemToString={local.itemToString}\n\t\t\titemToValue={local.itemToValue}\n\t\t\titems={local.items}\n\t\t\topenOnClick={local.openOnClick ?? true}\n\t\t\t{...rest}\n\t\t>\n\t\t\t{local.label && (\n\t\t\t\t<Combobox.Label className={cn.label}>\n\t\t\t\t\t{local.label}\n\t\t\t\t</Combobox.Label>\n\t\t\t)}\n\t\t\t<Combobox.Control className={cn.control}>\n\t\t\t\t<Input\n\t\t\t\t\tclassName={cn.input}\n\t\t\t\t\tdisabled={local.disabled}\n\t\t\t\t\tplaceholder={local.placeholder ?? 'Type to search...'}\n\t\t\t\t/>\n\t\t\t\t<Combobox.Trigger className={cn.trigger} type='button'>\n\t\t\t\t\t<ChevronIcon />\n\t\t\t\t</Combobox.Trigger>\n\t\t\t</Combobox.Control>\n\t\t\t<Combobox.Content className={cn.content}>\n\t\t\t\t<Combobox.Empty className={cn.empty}>\n\t\t\t\t\t{local.emptyText ?? 'No results found'}\n\t\t\t\t</Combobox.Empty>\n\t\t\t\t<Items>\n\t\t\t\t\t{item=> (\n\t\t\t\t\t\t<Combobox.Item className={cn.item} item={item} key={local.itemToValue?.(item) ?? item}>\n\t\t\t\t\t\t\t<Combobox.ItemText className={cn.itemText}>\n\t\t\t\t\t\t\t\t{local.itemToString?.(item) ?? String(item)}\n\t\t\t\t\t\t\t</Combobox.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AAAyB,YAAA;IAAA,OAI1BJ,GAAGc;GAAO;GAAAlC,UAAA,CAAAH,IAAA1C,SAAAgF,OAAApC,WAAA;IAAA,IAAAyB,YAAA;KAAA,OACXJ,GAAGgB;IAAK;IAAApC,gBACjCb,MAAMkD,aAAa;GAAkB,CAAA,CAAA,GAAAxC,IAAAiB,OAAAf,WAAA,EAAAC,WAGrC1B,SAAIuB,IAAA1C,SAAAmF,MAAAvC,WAAA;IAAA,IAAAyB,YAAA;KAAA,OACsBJ,GAAG9C;IAAI;IAAQA;IAAI,IAAAiE,MAAA;KAAA,OAAOpD,MAAME,cAAcf,IAAI,KAAKA;IAAI;IAAA0B,UAAA,CAAAH,IAAA1C,SAAAqF,UAAAzC,WAAA;KAAA,IAAAyB,YAAA;MAAA,OACtDJ,GAAGqB;KAAQ;KAAAzC,gBACvCb,MAAML,eAAeR,IAAI,KAAKC,OAAOD,IAAI;IAAC,CAAA,CAAA,SAAA;KAAA,MAAAoE,OAAA5E,OAAAmD,UAAA,IAAA;KAAA0B,OAAAD,YAAA7C,IAAAqB,WAAA,CAAA,CAAA,CAAA;KAAA0B,QAAAF,MAAA,mBAE3BtB,GAAGyB,KAAK;KAAA,OAAAH;IAAA,CAAA;GAAA,CAAA,CAAA,EAI1B,CAAA,CAAA,CAAA;EAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAKN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusTrap.js","names":["FocusTrap"],"sources":["../../src/components/FocusTrap.jsx"],"sourcesContent":["import { FocusTrap } from '@plastic-js/ark'\n\nexport default FocusTrap\n"],"mappings":";;AAEA,IAAA,oBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HoverCard.js","names":["HoverCard"],"sources":["../../src/components/HoverCard.jsx"],"sourcesContent":["import { HoverCard } from '@plastic-js/ark'\n\nexport default HoverCard\n"],"mappings":";;AAEA,IAAA,oBAAeA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { setProp, template } from "@plastic-js/plastic/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
//#region src/components/Icon.jsx
|
|
4
|
+
var _tmpl = template("<span></span>");
|
|
5
|
+
var iconClass = css({
|
|
6
|
+
display: "inline-flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
justifyContent: "center",
|
|
9
|
+
color: "currentColor",
|
|
10
|
+
"& svg": {
|
|
11
|
+
width: "100%",
|
|
12
|
+
height: "100%",
|
|
13
|
+
display: "block",
|
|
14
|
+
strokeWidth: "var(--icon-sw)"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var Icon = ({ svg, size = 22, strokeWidth = 1.25, className }) => {
|
|
18
|
+
const style = {
|
|
19
|
+
width: `${size}px`,
|
|
20
|
+
height: `${size}px`,
|
|
21
|
+
"--icon-sw": strokeWidth
|
|
22
|
+
};
|
|
23
|
+
const setEl = (el) => {
|
|
24
|
+
if (el && el.innerHTML !== svg) el.innerHTML = svg;
|
|
25
|
+
};
|
|
26
|
+
return (() => {
|
|
27
|
+
const _el0 = _tmpl.cloneNode(true);
|
|
28
|
+
setProp(_el0, "className", () => className ? `${iconClass} ${className}` : iconClass);
|
|
29
|
+
setProp(_el0, "ref", () => setEl);
|
|
30
|
+
setProp(_el0, "style", () => style);
|
|
31
|
+
return _el0;
|
|
32
|
+
})();
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Icon as default };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["css","_tmpl","_template","iconClass","display","alignItems","justifyContent","color","width","height","strokeWidth","Icon","svg","size","className","style","setEl","el","innerHTML","_el0","cloneNode","_setProp"],"sources":["../../src/components/Icon.jsx"],"sourcesContent":["import { css } from '@emotion/css'\n\nconst iconClass = css({\n\tdisplay: 'inline-flex',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tcolor: 'currentColor',\n\t'& svg': {\n\t\twidth: '100%', height: '100%', display: 'block', strokeWidth: 'var(--icon-sw)',\n\t},\n})\n\nconst Icon = ({\n\tsvg, size = 22, strokeWidth = 1.25, className,\n})=> {\n\tconst style = {\n\t\twidth: `${size}px`, height: `${size}px`, '--icon-sw': strokeWidth,\n\t}\n\tconst setEl = (el)=> { if (el && el.innerHTML !== svg){ el.innerHTML = svg } }\n\treturn <span className={className ? `${iconClass} ${className}` : iconClass} ref={setEl} style={style} />\n}\n\nexport default Icon\n"],"mappings":";;;AAAkC,IAAAC,QAAAC,SAAA,eAAA;AAElC,IAAMC,YAAYH,IAAI;CACrBI,SAAS;CACTC,YAAY;CACZC,gBAAgB;CAChBC,OAAO;CACP,SAAS;EACRC,OAAO;EAAQC,QAAQ;EAAQL,SAAS;EAASM,aAAa;CAC/D;AACD,CAAC;AAED,IAAMC,QAAQ,EACbC,KAAKC,OAAO,IAAIH,cAAc,MAAMI,gBAChC;CACJ,MAAMC,QAAQ;EACbP,OAAO,GAAGK,KAAI;EAAMJ,QAAQ,GAAGI,KAAI;EAAM,aAAaH;CACvD;CACA,MAAMM,SAASC,OAAM;EAAE,IAAIA,MAAMA,GAAGC,cAAcN,KAAMK,GAAGC,YAAYN;CAAM;CAC7E,cAAA;EAAA,MAAAO,OAAAlB,MAAAmB,UAAA,IAAA;EAAAC,QAAAF,MAAA,mBAAwBL,YAAY,GAAGX,UAAS,GAAIW,cAAcX,SAAS;EAAAkB,QAAAF,MAAA,aAAOH,KAAK;EAAAK,QAAAF,MAAA,eAASJ,KAAK;EAAA,OAAAI;CAAA,GAAA;AACtG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Listbox.js","names":["Listbox"],"sources":["../../src/components/Listbox.jsx"],"sourcesContent":["import { Listbox } from '@plastic-js/ark'\n\nexport default Listbox\n"],"mappings":";;AAEA,IAAA,kBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.js","names":["Menu"],"sources":["../../src/components/Menu.jsx"],"sourcesContent":["import { Menu } from '@plastic-js/ark'\n\nexport default Menu\n"],"mappings":";;AAEA,IAAA,eAAeA"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { insert, jsx, mergeProps, setProp, template } from "@plastic-js/plastic/jsx-runtime";
|
|
2
|
+
import { css } from "@emotion/css";
|
|
3
|
+
import { splitProps } from "@plastic-js/plastic";
|
|
4
|
+
//#region src/components/MoneyInput.jsx
|
|
5
|
+
var _tmpl2 = template("<span></span>");
|
|
6
|
+
var _tmpl = template("<div><span></span><!><!></div>");
|
|
7
|
+
var wrapperClass = css({
|
|
8
|
+
display: "flex",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
width: "100%",
|
|
11
|
+
boxSizing: "border-box",
|
|
12
|
+
height: "44px",
|
|
13
|
+
background: "var(--bg, rgba(0,0,0,0.2))",
|
|
14
|
+
border: "1px solid var(--border)",
|
|
15
|
+
borderRadius: "10px",
|
|
16
|
+
padding: "0 14px",
|
|
17
|
+
"&:focus-within": { borderColor: "var(--accent)" }
|
|
18
|
+
});
|
|
19
|
+
var errorClass = css({ borderColor: "var(--danger) !important" });
|
|
20
|
+
var affixTextClass = css({
|
|
21
|
+
color: "var(--muted)",
|
|
22
|
+
fontSize: "14px",
|
|
23
|
+
whiteSpace: "nowrap",
|
|
24
|
+
userSelect: "none",
|
|
25
|
+
marginRight: "2px"
|
|
26
|
+
});
|
|
27
|
+
var affixSuffixClass = css({
|
|
28
|
+
color: "var(--ink)",
|
|
29
|
+
fontSize: "14px",
|
|
30
|
+
fontWeight: 600,
|
|
31
|
+
whiteSpace: "nowrap",
|
|
32
|
+
userSelect: "none",
|
|
33
|
+
paddingLeft: "10px",
|
|
34
|
+
marginLeft: "4px",
|
|
35
|
+
borderLeft: "1px solid var(--border)"
|
|
36
|
+
});
|
|
37
|
+
var affixSuffixDisabledClass = css({ opacity: .5 });
|
|
38
|
+
var inputClass = css({
|
|
39
|
+
flex: 1,
|
|
40
|
+
minWidth: 0,
|
|
41
|
+
height: "100%",
|
|
42
|
+
background: "transparent",
|
|
43
|
+
border: "none",
|
|
44
|
+
color: "var(--ink)",
|
|
45
|
+
fontSize: "15px",
|
|
46
|
+
fontFamily: "inherit",
|
|
47
|
+
outline: "none",
|
|
48
|
+
"&::placeholder": { color: "var(--muted)" },
|
|
49
|
+
"&:disabled": {
|
|
50
|
+
opacity: .5,
|
|
51
|
+
cursor: "not-allowed",
|
|
52
|
+
WebkitTextFillColor: "var(--ink)"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var read = (value) => {
|
|
56
|
+
return typeof value === "function" ? value() : value;
|
|
57
|
+
};
|
|
58
|
+
var groupThousands = (digits) => {
|
|
59
|
+
if (!digits) return "";
|
|
60
|
+
return Number(digits).toLocaleString("en-US");
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Currency amount input. Keeps an integer digits-only string as its value and
|
|
64
|
+
* renders it grouped by thousands with a currency prefix.
|
|
65
|
+
*
|
|
66
|
+
* @param value digits-only string, or an accessor returning one
|
|
67
|
+
* @param onValueChange called with the next digits-only string on input
|
|
68
|
+
* @param invalid boolean or accessor; toggles the error border
|
|
69
|
+
* @param currency prefix symbol, defaults to ₱
|
|
70
|
+
* @param affix optional suffix text (e.g. K, M), defaults to empty
|
|
71
|
+
*/
|
|
72
|
+
var MoneyInput = (props) => {
|
|
73
|
+
const [local, rest] = splitProps(props, [
|
|
74
|
+
"value",
|
|
75
|
+
"onValueChange",
|
|
76
|
+
"invalid",
|
|
77
|
+
"currency",
|
|
78
|
+
"affix",
|
|
79
|
+
"placeholder",
|
|
80
|
+
"disabled"
|
|
81
|
+
]);
|
|
82
|
+
return () => {
|
|
83
|
+
const _el0 = _tmpl.cloneNode(true);
|
|
84
|
+
const _el1 = _el0.firstChild;
|
|
85
|
+
const _el2 = _el0.firstChild.nextSibling;
|
|
86
|
+
const _el3 = _el0.firstChild.nextSibling.nextSibling;
|
|
87
|
+
insert(_el1, () => local.currency ?? "₱");
|
|
88
|
+
setProp(_el1, "className", () => affixTextClass);
|
|
89
|
+
insert(_el0, () => jsx("input", mergeProps({
|
|
90
|
+
className: inputClass,
|
|
91
|
+
get disabled() {
|
|
92
|
+
return local.disabled;
|
|
93
|
+
},
|
|
94
|
+
inputMode: "numeric",
|
|
95
|
+
onInput: (e) => local.onValueChange?.(e.target.value.replace(/\D/g, "")),
|
|
96
|
+
get placeholder() {
|
|
97
|
+
return local.placeholder;
|
|
98
|
+
},
|
|
99
|
+
value: () => groupThousands(read(local.value))
|
|
100
|
+
}, rest)), _el2);
|
|
101
|
+
insert(_el0, () => read(local.affix) && (() => {
|
|
102
|
+
const _el0 = _tmpl2.cloneNode(true);
|
|
103
|
+
insert(_el0, () => read(local.affix));
|
|
104
|
+
setProp(_el0, "className", () => `${affixSuffixClass} ${read(local.disabled) ? affixSuffixDisabledClass : ""}`);
|
|
105
|
+
return _el0;
|
|
106
|
+
}), _el3);
|
|
107
|
+
setProp(_el0, "className", () => `${wrapperClass} ${read(local.invalid) ? errorClass : ""}`);
|
|
108
|
+
return _el0;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
export { MoneyInput as default };
|
|
113
|
+
|
|
114
|
+
//# sourceMappingURL=MoneyInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoneyInput.js","names":["css","splitProps","_tmpl2","_template","_tmpl","wrapperClass","display","alignItems","width","boxSizing","height","background","border","borderRadius","padding","borderColor","errorClass","affixTextClass","color","fontSize","whiteSpace","userSelect","marginRight","affixSuffixClass","fontWeight","paddingLeft","marginLeft","borderLeft","affixSuffixDisabledClass","opacity","inputClass","flex","minWidth","fontFamily","outline","cursor","WebkitTextFillColor","read","value","groupThousands","digits","Number","toLocaleString","MoneyInput","props","local","rest","_el0","cloneNode","_el1","firstChild","_el2","nextSibling","_el3","_insert","currency","_setProp","_jsx","_mergeProps","className","disabled","inputMode","onInput","e","onValueChange","target","replace","placeholder","affix","invalid"],"sources":["../../src/components/MoneyInput.jsx"],"sourcesContent":["import { css } from '@emotion/css'\nimport { splitProps } from '@plastic-js/plastic'\n\nconst wrapperClass = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\twidth: '100%',\n\tboxSizing: 'border-box',\n\theight: '44px',\n\tbackground: 'var(--bg, rgba(0,0,0,0.2))',\n\tborder: '1px solid var(--border)',\n\tborderRadius: '10px',\n\tpadding: '0 14px',\n\t'&:focus-within': { borderColor: 'var(--accent)' },\n})\n\nconst errorClass = css({\n\tborderColor: 'var(--danger) !important',\n})\n\nconst affixTextClass = css({\n\tcolor: 'var(--muted)',\n\tfontSize: '14px',\n\twhiteSpace: 'nowrap',\n\tuserSelect: 'none',\n\tmarginRight: '2px',\n})\n\n// Trailing unit (e.g. K, M): brighter and separated so it reads as part of the\n// value rather than faint decoration.\nconst affixSuffixClass = css({\n\tcolor: 'var(--ink)',\n\tfontSize: '14px',\n\tfontWeight: 600,\n\twhiteSpace: 'nowrap',\n\tuserSelect: 'none',\n\tpaddingLeft: '10px',\n\tmarginLeft: '4px',\n\tborderLeft: '1px solid var(--border)',\n})\n\n// Dim the suffix to match the disabled value text (the span is a sibling of the\n// input, so it doesn't inherit the input's :disabled styling).\nconst affixSuffixDisabledClass = css({\n\topacity: 0.5,\n})\n\nconst inputClass = css({\n\tflex: 1,\n\tminWidth: 0,\n\theight: '100%',\n\tbackground: 'transparent',\n\tborder: 'none',\n\tcolor: 'var(--ink)',\n\tfontSize: '15px',\n\tfontFamily: 'inherit',\n\toutline: 'none',\n\t'&::placeholder': { color: 'var(--muted)' },\n\t// Keep disabled text legible (WebKit otherwise forces a faint grey) while\n\t// still reading as read-only, matching the other disabled fields.\n\t'&:disabled': {\n\t\topacity: 0.5,\n\t\tcursor: 'not-allowed',\n\t\tWebkitTextFillColor: 'var(--ink)',\n\t},\n})\n\n// Props may be plain values or reactive accessors (signals); unwrap either.\nconst read = (value)=> {\n\treturn typeof value === 'function' ? value() : value\n}\n\n// Stored value is a digits-only string; display it grouped by thousands.\nconst groupThousands = (digits)=> {\n\tif (!digits){ return '' }\n\treturn Number(digits).toLocaleString('en-US')\n}\n\n/**\n * Currency amount input. Keeps an integer digits-only string as its value and\n * renders it grouped by thousands with a currency prefix.\n *\n * @param value digits-only string, or an accessor returning one\n * @param onValueChange called with the next digits-only string on input\n * @param invalid boolean or accessor; toggles the error border\n * @param currency prefix symbol, defaults to ₱\n * @param affix optional suffix text (e.g. K, M), defaults to empty\n */\nconst MoneyInput = (props)=> {\n\tconst [local, rest] = splitProps(props, ['value', 'onValueChange', 'invalid', 'currency', 'affix', 'placeholder', 'disabled'])\n\treturn (\n\t\t<div className={()=> `${wrapperClass} ${read(local.invalid) ? errorClass : ''}`}>\n\t\t\t<span className={affixTextClass}>\n\t\t\t\t{local.currency ?? '₱'}\n\t\t\t</span>\n\t\t\t<input\n\t\t\t\tclassName={inputClass}\n\t\t\t\tdisabled={local.disabled}\n\t\t\t\tinputMode='numeric'\n\t\t\t\tonInput={e=> local.onValueChange?.(e.target.value.replace(/\\D/g, ''))}\n\t\t\t\tplaceholder={local.placeholder}\n\t\t\t\tvalue={()=> groupThousands(read(local.value))}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t\t{()=> read(local.affix) && (\n\t\t\t\t<span className={()=> `${affixSuffixClass} ${read(local.disabled) ? affixSuffixDisabledClass : ''}`}>\n\t\t\t\t\t{read(local.affix)}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n\nexport default MoneyInput\n"],"mappings":";;;;AACgD,IAAAE,SAAAC,SAAA,eAAA;AAAA,IAAAC,QAAAD,SAAA,gCAAA;AAEhD,IAAME,eAAeL,IAAI;CACxBM,SAAS;CACTC,YAAY;CACZC,OAAO;CACPC,WAAW;CACXC,QAAQ;CACRC,YAAY;CACZC,QAAQ;CACRC,cAAc;CACdC,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,YAAAU,IAAA,SAAAC,WAAA;GAAAC,WAInB7B;GAAU,IAAA8B,WAAA;IAAA,OACXf,MAAMe;GAAQ;GAAAC,WACd;GAASC,UACVC,MAAIlB,MAAMmB,gBAAgBD,EAAEE,OAAO3B,MAAM4B,QAAQ,OAAO,EAAE,CAAC;GAAC,IAAAC,cAAA;IAAA,OACxDtB,MAAMsB;GAAW;GAAA7B,aAClBC,eAAeF,KAAKQ,MAAMP,KAAK,CAAC;EAAC,GACzCQ,IAAI,CAAA,GAAAK,IAAA;EAAAG,OAAAP,YAEHV,KAAKQ,MAAMuB,KAAK,YAAC;GAAA,MAAArB,OAAA7C,OAAA8C,UAAA,IAAA;GAAAM,OAAAP,YAEpBV,KAAKQ,MAAMuB,KAAK,CAAC;GAAAZ,QAAAT,MAAA,mBADG,GAAGxB,iBAAgB,GAAIc,KAAKQ,MAAMe,QAAQ,IAAIhC,2BAA2B,IAAI;GAAA,OAAAmB;EAAA,IAGnGM,IAAA;EAAAG,QAAAT,MAAA,mBAjBmB,GAAG1C,aAAY,GAAIgC,KAAKQ,MAAMwB,OAAO,IAAIrD,aAAa,IAAI;EAAA,OAAA+B;CAAA;AAoBjF"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import FilteredSelect from "./FilteredSelect.js";
|
|
2
|
+
import { jsx, mergeProps } from "@plastic-js/plastic/jsx-runtime";
|
|
3
|
+
import { css } from "@emotion/css";
|
|
4
|
+
//#region src/components/MyFilteredSelect.jsx
|
|
5
|
+
var classNames = {
|
|
6
|
+
control: css({
|
|
7
|
+
position: "relative",
|
|
8
|
+
display: "flex",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
width: "100%",
|
|
11
|
+
height: "46px",
|
|
12
|
+
background: "var(--surface)",
|
|
13
|
+
border: "1px solid var(--border)",
|
|
14
|
+
borderRadius: "10px",
|
|
15
|
+
transition: "border-color 150ms ease",
|
|
16
|
+
"&:focus-within": { borderColor: "var(--accent)" }
|
|
17
|
+
}),
|
|
18
|
+
input: css({
|
|
19
|
+
flex: 1,
|
|
20
|
+
minWidth: 0,
|
|
21
|
+
height: "100%",
|
|
22
|
+
background: "transparent",
|
|
23
|
+
border: "none",
|
|
24
|
+
outline: "none",
|
|
25
|
+
padding: "0 0 0 14px",
|
|
26
|
+
color: "var(--ink)",
|
|
27
|
+
fontSize: "15px",
|
|
28
|
+
fontFamily: "inherit",
|
|
29
|
+
"&::placeholder": { color: "var(--muted)" }
|
|
30
|
+
}),
|
|
31
|
+
trigger: css({
|
|
32
|
+
flexShrink: 0,
|
|
33
|
+
width: "36px",
|
|
34
|
+
height: "100%",
|
|
35
|
+
display: "flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
background: "transparent",
|
|
39
|
+
border: "none",
|
|
40
|
+
color: "var(--muted)",
|
|
41
|
+
cursor: "pointer",
|
|
42
|
+
padding: 0,
|
|
43
|
+
transition: "transform 180ms ease, color 180ms ease",
|
|
44
|
+
"&[data-state=\"open\"]": {
|
|
45
|
+
transform: "rotate(180deg)",
|
|
46
|
+
color: "var(--accent)"
|
|
47
|
+
},
|
|
48
|
+
"& svg": {
|
|
49
|
+
width: "18px",
|
|
50
|
+
height: "18px"
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
content: css({
|
|
54
|
+
background: "var(--surface)",
|
|
55
|
+
border: "1px solid var(--border)",
|
|
56
|
+
borderRadius: "12px",
|
|
57
|
+
padding: "6px",
|
|
58
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.5)",
|
|
59
|
+
maxHeight: "280px",
|
|
60
|
+
overflowY: "auto",
|
|
61
|
+
minWidth: "220px",
|
|
62
|
+
zIndex: 9999,
|
|
63
|
+
marginTop: "4px",
|
|
64
|
+
"&[hidden]": { display: "none" },
|
|
65
|
+
"&::-webkit-scrollbar": { width: "4px" },
|
|
66
|
+
"&::-webkit-scrollbar-track": { background: "transparent" },
|
|
67
|
+
"&::-webkit-scrollbar-thumb": {
|
|
68
|
+
background: "var(--border)",
|
|
69
|
+
borderRadius: "4px"
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
item: css({
|
|
73
|
+
display: "flex",
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
gap: "10px",
|
|
76
|
+
padding: "10px 12px",
|
|
77
|
+
borderRadius: "8px",
|
|
78
|
+
cursor: "pointer",
|
|
79
|
+
color: "var(--ink)",
|
|
80
|
+
fontSize: "14px",
|
|
81
|
+
transition: "background 120ms ease",
|
|
82
|
+
"&[data-highlighted]": { background: "var(--surface-2)" },
|
|
83
|
+
"&[data-selected]": {
|
|
84
|
+
color: "var(--accent)",
|
|
85
|
+
background: "rgba(47, 123, 255, 0.1)"
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
itemText: css({
|
|
89
|
+
flex: 1,
|
|
90
|
+
minWidth: 0
|
|
91
|
+
}),
|
|
92
|
+
check: css({
|
|
93
|
+
flexShrink: 0,
|
|
94
|
+
width: "18px",
|
|
95
|
+
height: "18px",
|
|
96
|
+
color: "var(--accent)",
|
|
97
|
+
opacity: 0,
|
|
98
|
+
transition: "opacity 120ms ease",
|
|
99
|
+
"[data-selected] &": { opacity: 1 }
|
|
100
|
+
}),
|
|
101
|
+
empty: css({
|
|
102
|
+
padding: "24px 12px",
|
|
103
|
+
textAlign: "center",
|
|
104
|
+
color: "var(--muted)",
|
|
105
|
+
fontSize: "14px"
|
|
106
|
+
}),
|
|
107
|
+
label: css({
|
|
108
|
+
display: "block",
|
|
109
|
+
fontSize: "13px",
|
|
110
|
+
fontWeight: 600,
|
|
111
|
+
color: "var(--muted)",
|
|
112
|
+
marginBottom: "6px"
|
|
113
|
+
})
|
|
114
|
+
};
|
|
115
|
+
var MyFilteredSelect = (props = {}) => jsx(FilteredSelect, mergeProps({ classNames }, props));
|
|
116
|
+
//#endregion
|
|
117
|
+
export { MyFilteredSelect as default };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=MyFilteredSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyFilteredSelect.js","names":["css","FilteredSelect","controlClass","position","display","alignItems","width","height","background","border","borderRadius","transition","borderColor","inputClass","flex","minWidth","outline","padding","color","fontSize","fontFamily","triggerClass","flexShrink","justifyContent","cursor","transform","contentClass","boxShadow","maxHeight","overflowY","zIndex","marginTop","itemClass","gap","itemTextClass","checkClass","opacity","emptyClass","textAlign","labelClass","fontWeight","marginBottom","classNames","control","input","trigger","content","item","itemText","check","empty","label","MyFilteredSelect","props","_jsx","_mergeProps"],"sources":["../../src/components/MyFilteredSelect.jsx"],"sourcesContent":["import { css } from '@emotion/css'\nimport FilteredSelect from './FilteredSelect.jsx'\n\n// MyFilteredSelect — the project's themed FilteredSelect. It owns nothing but\n// style: it supplies a `classNames` slot map to FilteredSelect, which holds all\n// the structure, behaviour and the public API/contract.\n\nconst controlClass = css({\n\tposition: 'relative',\n\tdisplay: 'flex',\n\talignItems: 'center',\n\twidth: '100%',\n\theight: '46px',\n\tbackground: 'var(--surface)',\n\tborder: '1px solid var(--border)',\n\tborderRadius: '10px',\n\ttransition: 'border-color 150ms ease',\n\t'&:focus-within': {\n\t\tborderColor: 'var(--accent)',\n\t},\n})\n\nconst inputClass = css({\n\tflex: 1,\n\tminWidth: 0,\n\theight: '100%',\n\tbackground: 'transparent',\n\tborder: 'none',\n\toutline: 'none',\n\tpadding: '0 0 0 14px',\n\tcolor: 'var(--ink)',\n\tfontSize: '15px',\n\tfontFamily: 'inherit',\n\t'&::placeholder': { color: 'var(--muted)' },\n})\n\nconst triggerClass = css({\n\tflexShrink: 0,\n\twidth: '36px',\n\theight: '100%',\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tbackground: 'transparent',\n\tborder: 'none',\n\tcolor: 'var(--muted)',\n\tcursor: 'pointer',\n\tpadding: 0,\n\ttransition: 'transform 180ms ease, color 180ms ease',\n\t'&[data-state=\"open\"]': {\n\t\ttransform: 'rotate(180deg)',\n\t\tcolor: 'var(--accent)',\n\t},\n\t'& svg': { width: '18px', height: '18px' },\n})\n\nconst contentClass = css({\n\tbackground: 'var(--surface)',\n\tborder: '1px solid var(--border)',\n\tborderRadius: '12px',\n\tpadding: '6px',\n\tboxShadow: '0 8px 32px rgba(0,0,0,0.5)',\n\tmaxHeight: '280px',\n\toverflowY: 'auto',\n\tminWidth: '220px',\n\tzIndex: 9999,\n\tmarginTop: '4px',\n\t'&[hidden]': { display: 'none' },\n\t'&::-webkit-scrollbar': { width: '4px' },\n\t'&::-webkit-scrollbar-track': { background: 'transparent' },\n\t'&::-webkit-scrollbar-thumb': {\n\t\tbackground: 'var(--border)',\n\t\tborderRadius: '4px',\n\t},\n})\n\nconst itemClass = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: '10px',\n\tpadding: '10px 12px',\n\tborderRadius: '8px',\n\tcursor: 'pointer',\n\tcolor: 'var(--ink)',\n\tfontSize: '14px',\n\ttransition: 'background 120ms ease',\n\t'&[data-highlighted]': {\n\t\tbackground: 'var(--surface-2)',\n\t},\n\t'&[data-selected]': {\n\t\tcolor: 'var(--accent)',\n\t\tbackground: 'rgba(47, 123, 255, 0.1)',\n\t},\n})\n\nconst itemTextClass = css({\n\tflex: 1,\n\tminWidth: 0,\n})\n\nconst checkClass = css({\n\tflexShrink: 0,\n\twidth: '18px',\n\theight: '18px',\n\tcolor: 'var(--accent)',\n\topacity: 0,\n\ttransition: 'opacity 120ms ease',\n\t'[data-selected] &': { opacity: 1 },\n})\n\nconst emptyClass = css({\n\tpadding: '24px 12px',\n\ttextAlign: 'center',\n\tcolor: 'var(--muted)',\n\tfontSize: '14px',\n})\n\nconst labelClass = css({\n\tdisplay: 'block',\n\tfontSize: '13px',\n\tfontWeight: 600,\n\tcolor: 'var(--muted)',\n\tmarginBottom: '6px',\n})\n\nconst classNames = {\n\tcontrol: controlClass,\n\tinput: inputClass,\n\ttrigger: triggerClass,\n\tcontent: contentClass,\n\titem: itemClass,\n\titemText: itemTextClass,\n\tcheck: checkClass,\n\tempty: emptyClass,\n\tlabel: labelClass,\n}\n\nconst MyFilteredSelect = (props = {})=> <FilteredSelect classNames={classNames} {...props} />\n\nexport default MyFilteredSelect\n"],"mappings":";;;;AA6HA,IAAM0C,aAAa;CAClBC,SAvHoB3C,IAAI;EACxBG,UAAU;EACVC,SAAS;EACTC,YAAY;EACZC,OAAO;EACPC,QAAQ;EACRC,YAAY;EACZC,QAAQ;EACRC,cAAc;EACdC,YAAY;EACZ,kBAAkB,EACjBC,aAAa,gBACd;CACD,CA0GUV;CACT0C,OAzGkB5C,IAAI;EACtBc,MAAM;EACNC,UAAU;EACVR,QAAQ;EACRC,YAAY;EACZC,QAAQ;EACRO,SAAS;EACTC,SAAS;EACTC,OAAO;EACPC,UAAU;EACVC,YAAY;EACZ,kBAAkB,EAAEF,OAAO,eAAe;CAC3C,CA6FQL;CACPgC,SA5FoB7C,IAAI;EACxBsB,YAAY;EACZhB,OAAO;EACPC,QAAQ;EACRH,SAAS;EACTC,YAAY;EACZkB,gBAAgB;EAChBf,YAAY;EACZC,QAAQ;EACRS,OAAO;EACPM,QAAQ;EACRP,SAAS;EACTN,YAAY;EACZ,0BAAwB;GACvBc,WAAW;GACXP,OAAO;EACR;EACA,SAAS;GAAEZ,OAAO;GAAQC,QAAQ;EAAO;CAC1C,CA0EUc;CACTyB,SAzEoB9C,IAAI;EACxBQ,YAAY;EACZC,QAAQ;EACRC,cAAc;EACdO,SAAS;EACTU,WAAW;EACXC,WAAW;EACXC,WAAW;EACXd,UAAU;EACVe,QAAQ;EACRC,WAAW;EACX,aAAa,EAAE3B,SAAS,OAAO;EAC/B,wBAAwB,EAAEE,OAAO,MAAM;EACvC,8BAA8B,EAAEE,YAAY,cAAc;EAC1D,8BAA8B;GAC7BA,YAAY;GACZE,cAAc;EACf;CACD,CAuDUgB;CACTqB,MAtDiB/C,IAAI;EACrBI,SAAS;EACTC,YAAY;EACZ4B,KAAK;EACLhB,SAAS;EACTP,cAAc;EACdc,QAAQ;EACRN,OAAO;EACPC,UAAU;EACVR,YAAY;EACZ,uBAAuB,EACtBH,YAAY,mBACb;EACA,oBAAoB;GACnBU,OAAO;GACPV,YAAY;EACb;CACD,CAqCOwB;CACNgB,UApCqBhD,IAAI;EACzBc,MAAM;EACNC,UAAU;CACX,CAiCWmB;CACVe,OAhCkBjD,IAAI;EACtBsB,YAAY;EACZhB,OAAO;EACPC,QAAQ;EACRW,OAAO;EACPkB,SAAS;EACTzB,YAAY;EACZ,qBAAqB,EAAEyB,SAAS,EAAE;CACnC,CAwBQD;CACPe,OAvBkBlD,IAAI;EACtBiB,SAAS;EACTqB,WAAW;EACXpB,OAAO;EACPC,UAAU;CACX,CAkBQkB;CACPc,OAjBkBnD,IAAI;EACtBI,SAAS;EACTe,UAAU;EACVqB,YAAY;EACZtB,OAAO;EACPuB,cAAc;CACf,CAWQF;AACR;AAEA,IAAMa,oBAAoBC,QAAQ,CAAC,MAACC,IAAArD,gBAAAsD,WAAA,EAAgCb,WAAU,GAAMW,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberInput.js","names":["NumberInput"],"sources":["../../src/components/NumberInput.jsx"],"sourcesContent":["import { NumberInput } from '@plastic-js/ark'\n\nexport default NumberInput\n"],"mappings":";;AAEA,IAAA,sBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","names":["Pagination"],"sources":["../../src/components/Pagination.jsx"],"sourcesContent":["import { Pagination } from '@plastic-js/ark'\n\nexport default Pagination\n"],"mappings":";;AAEA,IAAA,qBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.js","names":["Popover"],"sources":["../../src/components/Popover.jsx"],"sourcesContent":["import { Popover } from '@plastic-js/ark'\n\nexport default Popover\n"],"mappings":";;AAEA,IAAA,kBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.js","names":["Portal"],"sources":["../../src/components/Portal.jsx"],"sourcesContent":["import { Portal } from '@plastic-js/ark'\n\nexport default Portal\n"],"mappings":";;AAEA,IAAA,iBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Presence.js","names":["Presence"],"sources":["../../src/components/Presence.jsx"],"sourcesContent":["import { Presence } from '@plastic-js/ark'\n\nexport default Presence\n"],"mappings":";;AAEA,IAAA,mBAAeA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","names":["Progress"],"sources":["../../src/components/Progress.jsx"],"sourcesContent":["import { Progress } from '@plastic-js/ark'\n\nexport default Progress\n"],"mappings":";;AAEA,IAAA,mBAAeA"}
|