@bysages/react 0.2.0 → 0.2.2
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/index.d.mts +280 -52
- package/dist/index.mjs +401 -83
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -34,6 +34,7 @@ import { Format as Format$1 } from "@ark-ui/react/format";
|
|
|
34
34
|
import { Frame as Frame$1 } from "@ark-ui/react/frame";
|
|
35
35
|
import { Highlight as Highlight$1 } from "@ark-ui/react/highlight";
|
|
36
36
|
import { HoverCard as HoverCard$1 } from "@ark-ui/react/hover-card";
|
|
37
|
+
import { getIcon } from "@bysages/icons";
|
|
37
38
|
import { ImageCropper as ImageCropper$1 } from "@ark-ui/react/image-cropper";
|
|
38
39
|
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/react/json-tree-view";
|
|
39
40
|
import { Listbox as Listbox$1 } from "@ark-ui/react/listbox";
|
|
@@ -242,7 +243,7 @@ function useMentions(options, textarea, handlers) {
|
|
|
242
243
|
* its own anatomy (the textarea rides where the host puts it) and the
|
|
243
244
|
* vessel still points at the right place. Shares the detection state
|
|
244
245
|
* with the host through `useMentions`. */
|
|
245
|
-
function MentionsVessel({ open = false, matches = [], active = 0, anchor = null, onInsert, onActiveChange, onOpenChange }) {
|
|
246
|
+
function MentionsVessel({ size = "md", open = false, matches = [], active = 0, anchor = null, onInsert, onActiveChange, onOpenChange }) {
|
|
246
247
|
return /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
247
248
|
open,
|
|
248
249
|
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
@@ -255,6 +256,7 @@ function MentionsVessel({ open = false, matches = [], active = 0, anchor = null,
|
|
|
255
256
|
children: /* @__PURE__ */ jsx("div", {
|
|
256
257
|
"data-scope": "mentions",
|
|
257
258
|
"data-part": "popup",
|
|
259
|
+
"data-size": size,
|
|
258
260
|
children: matches.map((entry, index) => /* @__PURE__ */ jsx("div", {
|
|
259
261
|
"data-scope": "mentions",
|
|
260
262
|
"data-part": "option",
|
|
@@ -268,7 +270,7 @@ function MentionsVessel({ open = false, matches = [], active = 0, anchor = null,
|
|
|
268
270
|
}) }) })
|
|
269
271
|
});
|
|
270
272
|
}
|
|
271
|
-
function Mentions({ items = [], value, trigger = "@", placeholder, autoresize = false, invalid = false, onValueChange, children, ...rest }) {
|
|
273
|
+
function Mentions({ items = [], value, trigger = "@", placeholder, autoresize = false, invalid = false, size = "md", onValueChange, children, ...rest }) {
|
|
272
274
|
const [internal, setInternal] = useState("");
|
|
273
275
|
const fieldRef = useRef(null);
|
|
274
276
|
const el = () => fieldRef.current;
|
|
@@ -293,6 +295,7 @@ function Mentions({ items = [], value, trigger = "@", placeholder, autoresize =
|
|
|
293
295
|
...rest,
|
|
294
296
|
"data-scope": "mentions",
|
|
295
297
|
"data-part": "root",
|
|
298
|
+
"data-size": size,
|
|
296
299
|
children: [
|
|
297
300
|
/* @__PURE__ */ jsx(Field.Textarea, {
|
|
298
301
|
ref: fieldRef,
|
|
@@ -307,6 +310,7 @@ function Mentions({ items = [], value, trigger = "@", placeholder, autoresize =
|
|
|
307
310
|
"data-part": "textarea"
|
|
308
311
|
}),
|
|
309
312
|
/* @__PURE__ */ jsx(MentionsVessel, {
|
|
313
|
+
size,
|
|
310
314
|
open: mentions.open,
|
|
311
315
|
matches: mentions.matches,
|
|
312
316
|
active: mentions.active,
|
|
@@ -544,12 +548,52 @@ async function clickCodeCopy(event, copyLabel, copiedLabel) {
|
|
|
544
548
|
}, REVERT_MS);
|
|
545
549
|
}
|
|
546
550
|
//#endregion
|
|
551
|
+
//#region src/components/ai-response/tables.ts
|
|
552
|
+
/** Wide tables ride a scrolling lane instead of bursting the column.
|
|
553
|
+
* The lane is a plain div: the table-as-scroll-container form is what
|
|
554
|
+
* ate the mouse wheel over plain tables. Idempotent, so it can run
|
|
555
|
+
* after every stream patch. */
|
|
556
|
+
const lanes = /* @__PURE__ */ new Set();
|
|
557
|
+
let laneObserver;
|
|
558
|
+
/** A lane's verdict must follow its box — the panel around it can
|
|
559
|
+
* resize at any moment, so each lane stays observed and re-decided
|
|
560
|
+
* whenever its width changes. */
|
|
561
|
+
function watchLane(lane) {
|
|
562
|
+
if (lanes.has(lane)) return;
|
|
563
|
+
lanes.add(lane);
|
|
564
|
+
laneObserver ??= new ResizeObserver(() => {
|
|
565
|
+
for (const lane of lanes) {
|
|
566
|
+
if (!lane.isConnected) {
|
|
567
|
+
laneObserver.unobserve(lane);
|
|
568
|
+
lanes.delete(lane);
|
|
569
|
+
continue;
|
|
570
|
+
}
|
|
571
|
+
lane.toggleAttribute("data-scrollable", lane.scrollWidth > lane.clientWidth);
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
laneObserver.observe(lane);
|
|
575
|
+
}
|
|
576
|
+
function wrapResponseTables(root) {
|
|
577
|
+
for (const table of root.querySelectorAll("table")) {
|
|
578
|
+
if (table.parentElement?.hasAttribute("data-table-scroll")) continue;
|
|
579
|
+
const lane = document.createElement("div");
|
|
580
|
+
lane.setAttribute("data-table-scroll", "");
|
|
581
|
+
table.replaceWith(lane);
|
|
582
|
+
lane.append(table);
|
|
583
|
+
}
|
|
584
|
+
for (const lane of root.querySelectorAll("[data-table-scroll]")) {
|
|
585
|
+
lane.toggleAttribute("data-scrollable", lane.scrollWidth > lane.clientWidth);
|
|
586
|
+
watchLane(lane);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
//#endregion
|
|
547
590
|
//#region src/components/ai-response/index.tsx
|
|
548
591
|
function Response({ content, highlighter, copyLabel = "Copy code", copiedLabel = "Copied", ...rest }) {
|
|
549
592
|
const root = useRef(null);
|
|
550
593
|
useEffect(() => {
|
|
551
594
|
const host = root.current;
|
|
552
595
|
if (host) decorateCodeCopy(host, copyLabel);
|
|
596
|
+
if (host) wrapResponseTables(host);
|
|
553
597
|
}, [
|
|
554
598
|
content,
|
|
555
599
|
highlighter,
|
|
@@ -870,11 +914,20 @@ const Alert = Object.assign(AlertRoot, {
|
|
|
870
914
|
injectComponentStyle("alert");
|
|
871
915
|
//#endregion
|
|
872
916
|
//#region src/components/angle-slider/index.tsx
|
|
917
|
+
function AngleSliderRoot({ size = "md", ...rest }) {
|
|
918
|
+
return /* @__PURE__ */ jsx(AngleSlider$1.Root, {
|
|
919
|
+
...rest,
|
|
920
|
+
"data-size": size
|
|
921
|
+
});
|
|
922
|
+
}
|
|
873
923
|
/** Ark's AngleSlider, dressed in the paper-and-ink system: a flat paper dial
|
|
874
924
|
* the thumb sweeps as a pigment needle over hairline degree ticks. The API
|
|
875
925
|
* is Ark's own — Root, Label, ValueText, Control, Thumb, MarkerGroup,
|
|
876
926
|
* Marker, HiddenInput. */
|
|
877
|
-
const AngleSlider =
|
|
927
|
+
const AngleSlider = {
|
|
928
|
+
...AngleSlider$1,
|
|
929
|
+
Root: AngleSliderRoot
|
|
930
|
+
};
|
|
878
931
|
injectComponentStyle("angle-slider");
|
|
879
932
|
//#endregion
|
|
880
933
|
//#region src/components/aspect-ratio/index.tsx
|
|
@@ -892,7 +945,7 @@ function AspectRatio({ ratio = "1 / 1", ...rest }) {
|
|
|
892
945
|
injectComponentStyle("aspect-ratio");
|
|
893
946
|
//#endregion
|
|
894
947
|
//#region src/components/autocomplete/index.tsx
|
|
895
|
-
function AutoComplete({ value = "", items = [], placeholder, filter, onValueChange, ...rest }) {
|
|
948
|
+
function AutoComplete({ value = "", items = [], placeholder, filter, size = "md", onValueChange, ...rest }) {
|
|
896
949
|
const { collection, filter: filterItems } = useListCollection$1({
|
|
897
950
|
initialItems: items,
|
|
898
951
|
filter: (item, input) => filter ? filter(item, input) : item.toLowerCase().includes(input.toLowerCase())
|
|
@@ -902,6 +955,7 @@ function AutoComplete({ value = "", items = [], placeholder, filter, onValueChan
|
|
|
902
955
|
collection,
|
|
903
956
|
inputValue: value,
|
|
904
957
|
allowCustomValue: true,
|
|
958
|
+
"data-size": size,
|
|
905
959
|
onValueChange: (details) => {
|
|
906
960
|
const [first] = details.value;
|
|
907
961
|
if (first != null) onValueChange?.(first);
|
|
@@ -930,11 +984,12 @@ const Avatar = Object.assign({}, Avatar$1, { Root: AvatarRoot });
|
|
|
930
984
|
injectComponentStyle("avatar");
|
|
931
985
|
//#endregion
|
|
932
986
|
//#region src/components/avatar-group/index.tsx
|
|
933
|
-
function AvatarGroup({ children, ...rest }) {
|
|
987
|
+
function AvatarGroup({ size, children, ...rest }) {
|
|
934
988
|
return /* @__PURE__ */ jsx("div", {
|
|
935
989
|
...rest,
|
|
936
990
|
"data-scope": "avatar-group",
|
|
937
991
|
"data-part": "root",
|
|
992
|
+
"data-size": size,
|
|
938
993
|
children
|
|
939
994
|
});
|
|
940
995
|
}
|
|
@@ -1323,7 +1378,7 @@ const checkGlyph$2 = /* @__PURE__ */ jsx("svg", {
|
|
|
1323
1378
|
"aria-hidden": "true",
|
|
1324
1379
|
children: /* @__PURE__ */ jsx("path", { d: "m5 12.5 5 5L19 7" })
|
|
1325
1380
|
});
|
|
1326
|
-
function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigger, filterable = false, multiple = false, disabled = false, onValueChange, ...rest }) {
|
|
1381
|
+
function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigger, filterable = false, multiple = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
1327
1382
|
const id = useId();
|
|
1328
1383
|
const locale = useLocaleContext();
|
|
1329
1384
|
const env = useEnvironmentContext();
|
|
@@ -1453,6 +1508,7 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
1453
1508
|
return /* @__PURE__ */ jsxs("div", {
|
|
1454
1509
|
...rest,
|
|
1455
1510
|
...api.getRootProps(),
|
|
1511
|
+
"data-size": size,
|
|
1456
1512
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1457
1513
|
...api.getControlProps(),
|
|
1458
1514
|
children: /* @__PURE__ */ jsxs("button", {
|
|
@@ -1474,6 +1530,7 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
1474
1530
|
...api.getPositionerProps(),
|
|
1475
1531
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1476
1532
|
...api.getContentProps(),
|
|
1533
|
+
"data-size": size,
|
|
1477
1534
|
children: [filterable ? /* @__PURE__ */ jsx("div", {
|
|
1478
1535
|
"data-part": "search",
|
|
1479
1536
|
children: /* @__PURE__ */ jsx(Input, {
|
|
@@ -1509,11 +1566,20 @@ const Carousel = Carousel$1;
|
|
|
1509
1566
|
injectComponentStyle("carousel");
|
|
1510
1567
|
//#endregion
|
|
1511
1568
|
//#region src/components/checkbox/index.tsx
|
|
1569
|
+
function CheckboxRoot({ size = "md", ...rest }) {
|
|
1570
|
+
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
1571
|
+
...rest,
|
|
1572
|
+
"data-size": size
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1512
1575
|
/** Ark's Checkbox, dressed in the paper-and-ink system: a square-cut seal
|
|
1513
1576
|
* that fills flat with primary ink when ticked, the mark springing into
|
|
1514
1577
|
* place. The API is Ark's own — Root, Label, Control, Indicator,
|
|
1515
1578
|
* HiddenInput. */
|
|
1516
|
-
const Checkbox =
|
|
1579
|
+
const Checkbox = {
|
|
1580
|
+
...Checkbox$1,
|
|
1581
|
+
Root: CheckboxRoot
|
|
1582
|
+
};
|
|
1517
1583
|
injectComponentStyle("checkbox");
|
|
1518
1584
|
//#endregion
|
|
1519
1585
|
//#region src/components/checkbox-group/index.tsx
|
|
@@ -1535,8 +1601,9 @@ const checkGlyph$1 = /* @__PURE__ */ jsx("svg", {
|
|
|
1535
1601
|
* the field context, so the invalid and disabled states a Form routes to
|
|
1536
1602
|
* its name dress every box at once.
|
|
1537
1603
|
*/
|
|
1538
|
-
function CheckboxGroup({ value = [], options, layout = "vertical", invalid = false, disabled = false, onValueChange, ...rest }) {
|
|
1604
|
+
function CheckboxGroup({ value = [], options, layout = "vertical", size = "md", invalid = false, disabled = false, onValueChange, ...rest }) {
|
|
1539
1605
|
const field = useFieldContext();
|
|
1606
|
+
const uid = useId();
|
|
1540
1607
|
const selected = new Set(value);
|
|
1541
1608
|
const isInvalid = invalid || field?.invalid === true;
|
|
1542
1609
|
const isDisabled = disabled || field?.disabled === true;
|
|
@@ -1554,6 +1621,11 @@ function CheckboxGroup({ value = [], options, layout = "vertical", invalid = fal
|
|
|
1554
1621
|
"data-layout": layout,
|
|
1555
1622
|
"data-invalid": isInvalid ? "" : void 0,
|
|
1556
1623
|
children: options.map((option) => /* @__PURE__ */ jsxs(Checkbox$1.Root, {
|
|
1624
|
+
ids: {
|
|
1625
|
+
label: `${uid}:${option.value}:label`,
|
|
1626
|
+
hiddenInput: `${uid}:${option.value}:input`
|
|
1627
|
+
},
|
|
1628
|
+
"data-size": size,
|
|
1557
1629
|
checked: selected.has(option.value),
|
|
1558
1630
|
invalid: isInvalid,
|
|
1559
1631
|
disabled: isDisabled || option.disabled === true,
|
|
@@ -1584,14 +1656,25 @@ function Chip({ value, max, tone = "ink", variant = "solid", ...rest }) {
|
|
|
1584
1656
|
injectComponentStyle("chip");
|
|
1585
1657
|
//#endregion
|
|
1586
1658
|
//#region src/components/clipboard/index.tsx
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1659
|
+
function ClipboardRoot({ size = "md", ...rest }) {
|
|
1660
|
+
return /* @__PURE__ */ jsx(Clipboard$1.Root, {
|
|
1661
|
+
...rest,
|
|
1662
|
+
"data-size": size
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
const Clipboard = {
|
|
1666
|
+
...Clipboard$1,
|
|
1667
|
+
Root: ClipboardRoot
|
|
1668
|
+
};
|
|
1592
1669
|
injectComponentStyle("clipboard");
|
|
1593
1670
|
//#endregion
|
|
1594
1671
|
//#region src/components/color-picker/index.tsx
|
|
1672
|
+
function ColorPickerRoot({ size = "md", ...rest }) {
|
|
1673
|
+
return /* @__PURE__ */ jsx(ColorPicker$1.Root, {
|
|
1674
|
+
...rest,
|
|
1675
|
+
"data-size": size
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1595
1678
|
/** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
|
|
1596
1679
|
* on the paper, opening into an area and channel sliders where pigment is
|
|
1597
1680
|
* picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
|
|
@@ -1600,16 +1683,24 @@ injectComponentStyle("clipboard");
|
|
|
1600
1683
|
* ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
|
|
1601
1684
|
* SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
|
|
1602
1685
|
* FormatSelect, HiddenInput, Context. */
|
|
1603
|
-
const ColorPicker =
|
|
1686
|
+
const ColorPicker = {
|
|
1687
|
+
...ColorPicker$1,
|
|
1688
|
+
Root: ColorPickerRoot
|
|
1689
|
+
};
|
|
1604
1690
|
injectComponentStyle("color-picker");
|
|
1605
1691
|
//#endregion
|
|
1606
1692
|
//#region src/components/combobox/index.tsx
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1693
|
+
function ComboboxRoot(props) {
|
|
1694
|
+
const { size = "md", ...rest } = props;
|
|
1695
|
+
return /* @__PURE__ */ jsx(Combobox$1.Root, {
|
|
1696
|
+
...rest,
|
|
1697
|
+
"data-size": size
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
const Combobox = {
|
|
1701
|
+
...Combobox$1,
|
|
1702
|
+
Root: ComboboxRoot
|
|
1703
|
+
};
|
|
1613
1704
|
injectComponentStyle("combobox");
|
|
1614
1705
|
//#endregion
|
|
1615
1706
|
//#region src/components/command/index.tsx
|
|
@@ -1834,21 +1925,39 @@ function Container({ size = "readable", padding = true, ...rest }) {
|
|
|
1834
1925
|
injectComponentStyle("container");
|
|
1835
1926
|
//#endregion
|
|
1836
1927
|
//#region src/components/date-input/index.tsx
|
|
1928
|
+
function DateInputRoot({ size = "md", ...rest }) {
|
|
1929
|
+
return /* @__PURE__ */ jsx(DateInput$1.Root, {
|
|
1930
|
+
...rest,
|
|
1931
|
+
"data-size": size
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1837
1934
|
/** Ark's DateInput, dressed in the paper-and-ink system: a segmented
|
|
1838
1935
|
* field where the focused segment takes the flat ink fill. The API is
|
|
1839
1936
|
* Ark's own — Root, Label, Control, SegmentGroup, Segment, SegmentContext,
|
|
1840
1937
|
* HiddenInput. */
|
|
1841
|
-
const DateInput =
|
|
1938
|
+
const DateInput = {
|
|
1939
|
+
...DateInput$1,
|
|
1940
|
+
Root: DateInputRoot
|
|
1941
|
+
};
|
|
1842
1942
|
injectComponentStyle("date-input");
|
|
1843
1943
|
//#endregion
|
|
1844
1944
|
//#region src/components/date-picker/index.tsx
|
|
1945
|
+
function DatePickerRoot({ size = "md", ...rest }) {
|
|
1946
|
+
return /* @__PURE__ */ jsx(DatePicker$1.Root, {
|
|
1947
|
+
...rest,
|
|
1948
|
+
"data-size": size
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1845
1951
|
/** Ark's DatePicker, dressed in the paper-and-ink system: the popup
|
|
1846
1952
|
* dissolves in on elevation, selected days take the flat ink fill, and
|
|
1847
1953
|
* range middles run subtle with cut corners. The API is Ark's own —
|
|
1848
1954
|
* Root, Label, Control, Input, Trigger, ClearTrigger, Positioner,
|
|
1849
1955
|
* Content, View, ViewControl, ViewTrigger, RangeText, PrevTrigger,
|
|
1850
1956
|
* NextTrigger, Table*, MonthSelect, YearSelect, PresetTrigger. */
|
|
1851
|
-
const DatePicker =
|
|
1957
|
+
const DatePicker = {
|
|
1958
|
+
...DatePicker$1,
|
|
1959
|
+
Root: DatePickerRoot
|
|
1960
|
+
};
|
|
1852
1961
|
injectComponentStyle("date-picker");
|
|
1853
1962
|
//#endregion
|
|
1854
1963
|
//#region src/components/descriptions/index.tsx
|
|
@@ -1906,7 +2015,7 @@ injectComponentStyle("drawer");
|
|
|
1906
2015
|
* grows past `max`, and the group always keeps one row: an entry list
|
|
1907
2016
|
* that emptied itself would leave the reader no place to type.
|
|
1908
2017
|
*/
|
|
1909
|
-
function DynamicInput({ value, min = 0, max, placeholder, addLabel = "Add entry", disabled = false, invalid = false, onValueChange, children: _children, ...rest }) {
|
|
2018
|
+
function DynamicInput({ value, min = 0, max, placeholder, addLabel = "Add entry", disabled = false, invalid = false, size = "md", onValueChange, children: _children, ...rest }) {
|
|
1910
2019
|
const values = value ?? [""];
|
|
1911
2020
|
const update = (index, next) => {
|
|
1912
2021
|
const rows = values.slice();
|
|
@@ -1934,10 +2043,12 @@ function DynamicInput({ value, min = 0, max, placeholder, addLabel = "Add entry"
|
|
|
1934
2043
|
placeholder,
|
|
1935
2044
|
disabled,
|
|
1936
2045
|
invalid,
|
|
2046
|
+
size,
|
|
1937
2047
|
onValueChange: (next) => update(index, next)
|
|
1938
2048
|
}), /* @__PURE__ */ jsx(Button, {
|
|
1939
2049
|
variant: "ghost",
|
|
1940
2050
|
square: true,
|
|
2051
|
+
size,
|
|
1941
2052
|
disabled: disabled || !canRemove,
|
|
1942
2053
|
"aria-label": `Remove entry ${index + 1}`,
|
|
1943
2054
|
onClick: () => remove(index),
|
|
@@ -1948,6 +2059,7 @@ function DynamicInput({ value, min = 0, max, placeholder, addLabel = "Add entry"
|
|
|
1948
2059
|
"data-part": "add",
|
|
1949
2060
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
1950
2061
|
variant: "ghost",
|
|
2062
|
+
size,
|
|
1951
2063
|
disabled: disabled || !canAdd,
|
|
1952
2064
|
onClick: () => add(),
|
|
1953
2065
|
children: ["+", addLabel]
|
|
@@ -1973,11 +2085,16 @@ function crossIcon() {
|
|
|
1973
2085
|
injectComponentStyle("dynamic-input");
|
|
1974
2086
|
//#endregion
|
|
1975
2087
|
//#region src/components/editable/index.tsx
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
2088
|
+
function EditableRoot({ size = "md", ...rest }) {
|
|
2089
|
+
return /* @__PURE__ */ jsx(Editable$1.Root, {
|
|
2090
|
+
...rest,
|
|
2091
|
+
"data-size": size
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
const Editable = {
|
|
2095
|
+
...Editable$1,
|
|
2096
|
+
Root: EditableRoot
|
|
2097
|
+
};
|
|
1981
2098
|
injectComponentStyle("editable");
|
|
1982
2099
|
//#endregion
|
|
1983
2100
|
//#region src/components/ellipsis/index.tsx
|
|
@@ -2033,13 +2150,22 @@ const Fieldset = Fieldset$1;
|
|
|
2033
2150
|
injectComponentStyle("fieldset");
|
|
2034
2151
|
//#endregion
|
|
2035
2152
|
//#region src/components/file-upload/index.tsx
|
|
2153
|
+
function FileUploadRoot({ size = "md", ...rest }) {
|
|
2154
|
+
return /* @__PURE__ */ jsx(FileUpload$1.Root, {
|
|
2155
|
+
...rest,
|
|
2156
|
+
"data-size": size
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2036
2159
|
/** Ark's FileUpload, dressed in the paper-and-ink system: a dashed
|
|
2037
2160
|
* dropzone that floods with subtle light on drag-over, and accepted files
|
|
2038
2161
|
* as loose hairline slips. The API is Ark's own — Root, Label, Trigger,
|
|
2039
2162
|
* Dropzone, HiddenInput, ItemGroup, Item, ItemName, ItemSizeText,
|
|
2040
2163
|
* ItemPreview, ItemPreviewImage, ItemDeleteTrigger, ClearTrigger,
|
|
2041
2164
|
* Context. */
|
|
2042
|
-
const FileUpload =
|
|
2165
|
+
const FileUpload = {
|
|
2166
|
+
...FileUpload$1,
|
|
2167
|
+
Root: FileUploadRoot
|
|
2168
|
+
};
|
|
2043
2169
|
injectComponentStyle("file-upload");
|
|
2044
2170
|
//#endregion
|
|
2045
2171
|
//#region src/components/float-button/index.tsx
|
|
@@ -2055,7 +2181,7 @@ const FLOAT_BUTTON_CONTEXT = createContext(null);
|
|
|
2055
2181
|
* (vessels here: round); this family owns only the mooring, the fan
|
|
2056
2182
|
* and the fold.
|
|
2057
2183
|
*/
|
|
2058
|
-
function Root$7({ open: openProp, placement = "bottom-end", onOpenChange, children, ...rest }) {
|
|
2184
|
+
function Root$7({ open: openProp, placement = "bottom-end", size, onOpenChange, children, ...rest }) {
|
|
2059
2185
|
const [inner, setInner] = useState(false);
|
|
2060
2186
|
const open = openProp !== void 0 ? openProp : inner;
|
|
2061
2187
|
const setOpen = (value) => {
|
|
@@ -2065,6 +2191,7 @@ function Root$7({ open: openProp, placement = "bottom-end", onOpenChange, childr
|
|
|
2065
2191
|
return /* @__PURE__ */ jsx(FLOAT_BUTTON_CONTEXT.Provider, {
|
|
2066
2192
|
value: {
|
|
2067
2193
|
open,
|
|
2194
|
+
size: size ?? "lg",
|
|
2068
2195
|
toggle: () => setOpen(!open),
|
|
2069
2196
|
close: () => setOpen(false)
|
|
2070
2197
|
},
|
|
@@ -2078,12 +2205,17 @@ function Root$7({ open: openProp, placement = "bottom-end", onOpenChange, childr
|
|
|
2078
2205
|
})
|
|
2079
2206
|
});
|
|
2080
2207
|
}
|
|
2208
|
+
const STEP_DOWN = {
|
|
2209
|
+
lg: "md",
|
|
2210
|
+
md: "sm",
|
|
2211
|
+
sm: "sm"
|
|
2212
|
+
};
|
|
2081
2213
|
function Trigger({ label, children }) {
|
|
2082
2214
|
const context = useContext(FLOAT_BUTTON_CONTEXT);
|
|
2083
2215
|
return /* @__PURE__ */ jsx(Button, {
|
|
2084
2216
|
variant: "solid",
|
|
2085
2217
|
square: true,
|
|
2086
|
-
size: "lg",
|
|
2218
|
+
size: context?.size ?? "lg",
|
|
2087
2219
|
onClick: () => context?.toggle(),
|
|
2088
2220
|
"aria-label": label || "Actions",
|
|
2089
2221
|
"aria-expanded": context ? context.open : false,
|
|
@@ -2098,7 +2230,7 @@ function Item$2({ label, disabled = false, onClick, children }) {
|
|
|
2098
2230
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
2099
2231
|
variant: "outline",
|
|
2100
2232
|
square: true,
|
|
2101
|
-
size: "md",
|
|
2233
|
+
size: context ? STEP_DOWN[context.size] : "md",
|
|
2102
2234
|
disabled,
|
|
2103
2235
|
"aria-label": label,
|
|
2104
2236
|
onClick: () => {
|
|
@@ -2137,6 +2269,11 @@ const FormContext = createContext(null);
|
|
|
2137
2269
|
function issueName(issue) {
|
|
2138
2270
|
return (issue.path ?? []).map((segment) => typeof segment === "object" ? segment.key : segment).join(".");
|
|
2139
2271
|
}
|
|
2272
|
+
/** A field owns the issues that live at its name or deeper inside it
|
|
2273
|
+
* ("topics.0" belongs to the "topics" field). */
|
|
2274
|
+
function inScope(name, scope) {
|
|
2275
|
+
return name === scope || name.startsWith(scope + ".");
|
|
2276
|
+
}
|
|
2140
2277
|
/**
|
|
2141
2278
|
* The validation scheduler: one error map, a submit that validates
|
|
2142
2279
|
* before it fires, live re-validation on the events the `validateOn`
|
|
@@ -2152,7 +2289,7 @@ function Form({ state, schema, validate, validateOn = [
|
|
|
2152
2289
|
], disabled = false, onSubmit, onError, ref, children, ...rest }) {
|
|
2153
2290
|
const [errors, setErrors] = useState(() => /* @__PURE__ */ new Map());
|
|
2154
2291
|
const run = useRef(0);
|
|
2155
|
-
async function runValidate() {
|
|
2292
|
+
async function runValidate(scope) {
|
|
2156
2293
|
const seq = ++run.current;
|
|
2157
2294
|
const next = /* @__PURE__ */ new Map();
|
|
2158
2295
|
if (validate) for (const error of await validate(state)) next.set(error.name, error.message);
|
|
@@ -2163,7 +2300,13 @@ function Form({ state, schema, validate, validateOn = [
|
|
|
2163
2300
|
if (!next.has(name)) next.set(name, issue.message);
|
|
2164
2301
|
}
|
|
2165
2302
|
}
|
|
2166
|
-
if (
|
|
2303
|
+
if (scope != null) setErrors((prev) => {
|
|
2304
|
+
const merged = /* @__PURE__ */ new Map();
|
|
2305
|
+
for (const [name, message] of prev) if (!inScope(name, scope)) merged.set(name, message);
|
|
2306
|
+
for (const [name, message] of next) if (inScope(name, scope)) merged.set(name, message);
|
|
2307
|
+
return merged;
|
|
2308
|
+
});
|
|
2309
|
+
if (seq === run.current && scope == null) setErrors(next);
|
|
2167
2310
|
return next;
|
|
2168
2311
|
}
|
|
2169
2312
|
function clear(name) {
|
|
@@ -2213,8 +2356,9 @@ function Form({ state, schema, validate, validateOn = [
|
|
|
2213
2356
|
if (!validateOn.includes(kind)) return;
|
|
2214
2357
|
const target = event.target;
|
|
2215
2358
|
if (!target || !("value" in target)) return;
|
|
2359
|
+
const scope = target.closest?.("[data-form-field]")?.getAttribute("data-form-field") ?? void 0;
|
|
2216
2360
|
clearTimeout(timer.current);
|
|
2217
|
-
timer.current = setTimeout(() => void runValidate(), kind === "blur" ? 0 : 300);
|
|
2361
|
+
timer.current = setTimeout(() => void runValidate(scope), kind === "blur" ? 0 : 300);
|
|
2218
2362
|
}
|
|
2219
2363
|
return /* @__PURE__ */ jsx(FormContext.Provider, {
|
|
2220
2364
|
value: {
|
|
@@ -2320,7 +2464,9 @@ const HoverCard = HoverCard$1;
|
|
|
2320
2464
|
injectComponentStyle("hover-card");
|
|
2321
2465
|
//#endregion
|
|
2322
2466
|
//#region src/components/icon/index.tsx
|
|
2323
|
-
function Icon({ size = "inherit", label, children, ...rest }) {
|
|
2467
|
+
function Icon({ size = "inherit", label, name, children, ...rest }) {
|
|
2468
|
+
const glyph = name && children == null ? getIcon(name) : void 0;
|
|
2469
|
+
if (name && children == null && !glyph) console.error(`[icons] unknown icon name "${name}" — extend packages/icons/icons.config.json and rerun the generator`);
|
|
2324
2470
|
return /* @__PURE__ */ jsx("span", {
|
|
2325
2471
|
...rest,
|
|
2326
2472
|
role: label != null ? "img" : void 0,
|
|
@@ -2329,7 +2475,12 @@ function Icon({ size = "inherit", label, children, ...rest }) {
|
|
|
2329
2475
|
"data-scope": "icon",
|
|
2330
2476
|
"data-part": "root",
|
|
2331
2477
|
"data-size": size,
|
|
2332
|
-
children
|
|
2478
|
+
children: children ?? (glyph ? /* @__PURE__ */ jsx("svg", {
|
|
2479
|
+
viewBox: `0 0 ${glyph.width ?? 24} ${glyph.height ?? 24}`,
|
|
2480
|
+
fill: "currentColor",
|
|
2481
|
+
"aria-hidden": "true",
|
|
2482
|
+
dangerouslySetInnerHTML: { __html: glyph.body }
|
|
2483
|
+
}) : null)
|
|
2333
2484
|
});
|
|
2334
2485
|
}
|
|
2335
2486
|
injectComponentStyle("icon");
|
|
@@ -2751,12 +2902,17 @@ const List = Object.assign(Root$4, {
|
|
|
2751
2902
|
injectComponentStyle("list");
|
|
2752
2903
|
//#endregion
|
|
2753
2904
|
//#region src/components/listbox/index.tsx
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2905
|
+
function ListboxRoot(props) {
|
|
2906
|
+
const { size = "md", ...rest } = props;
|
|
2907
|
+
return /* @__PURE__ */ jsx(Listbox$1.Root, {
|
|
2908
|
+
...rest,
|
|
2909
|
+
"data-size": size
|
|
2910
|
+
});
|
|
2911
|
+
}
|
|
2912
|
+
const Listbox = {
|
|
2913
|
+
...Listbox$1,
|
|
2914
|
+
Root: ListboxRoot
|
|
2915
|
+
};
|
|
2760
2916
|
injectComponentStyle("listbox");
|
|
2761
2917
|
//#endregion
|
|
2762
2918
|
//#region src/components/marquee/index.tsx
|
|
@@ -2793,12 +2949,35 @@ function Masonry({ columns = 3, gap = "md", ...rest }) {
|
|
|
2793
2949
|
injectComponentStyle("masonry");
|
|
2794
2950
|
//#endregion
|
|
2795
2951
|
//#region src/components/menu/index.tsx
|
|
2952
|
+
/** The row rung rides the context because Ark's Root renders no DOM of
|
|
2953
|
+
* its own — the vessel (Content) is the element the rung can land on,
|
|
2954
|
+
* and the Portal breaks CSS ancestry between the two. */
|
|
2955
|
+
const MenuSizeContext = createContext("md");
|
|
2956
|
+
function MenuRoot({ size = "md", ...rest }) {
|
|
2957
|
+
return /* @__PURE__ */ jsx(MenuSizeContext.Provider, {
|
|
2958
|
+
value: size,
|
|
2959
|
+
children: /* @__PURE__ */ jsx(Menu$1.Root, { ...rest })
|
|
2960
|
+
});
|
|
2961
|
+
}
|
|
2962
|
+
function MenuContent(props) {
|
|
2963
|
+
const size = useContext(MenuSizeContext);
|
|
2964
|
+
return /* @__PURE__ */ jsx(Menu$1.Content, {
|
|
2965
|
+
...props,
|
|
2966
|
+
"data-size": size
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2796
2969
|
/** Ark's Menu, dressed in the paper-and-ink system: a quiet paper vessel on
|
|
2797
2970
|
* elevation, hover as light on the row, checked items as the flat ink fill.
|
|
2798
|
-
* The
|
|
2971
|
+
* The parts — Root, Trigger, ContextTrigger, Indicator, Positioner,
|
|
2799
2972
|
* Content, Item, ItemText, ItemIndicator, ItemGroup, ItemGroupLabel,
|
|
2800
|
-
* TriggerItem, Separator, Arrow, ArrowTip.
|
|
2801
|
-
|
|
2973
|
+
* TriggerItem, Separator, Arrow, ArrowTip. Ark's namespace is frozen —
|
|
2974
|
+
* spread copies the members so Root and Content can be the sized
|
|
2975
|
+
* wrappers while the rest stay Ark's own parts. */
|
|
2976
|
+
const Menu = {
|
|
2977
|
+
...Menu$1,
|
|
2978
|
+
Root: MenuRoot,
|
|
2979
|
+
Content: MenuContent
|
|
2980
|
+
};
|
|
2802
2981
|
injectComponentStyle("menu");
|
|
2803
2982
|
//#endregion
|
|
2804
2983
|
//#region src/components/menubar/index.tsx
|
|
@@ -2854,7 +3033,7 @@ const Track = ({ ...rest }) => /* @__PURE__ */ jsx("span", {
|
|
|
2854
3033
|
"data-part": "range"
|
|
2855
3034
|
})
|
|
2856
3035
|
});
|
|
2857
|
-
const Root$3 = ({ value, min = 0, max = 100, level = "normal", label, children, ...rest }) => {
|
|
3036
|
+
const Root$3 = ({ value, min = 0, max = 100, level = "normal", size = "md", label, children, ...rest }) => {
|
|
2858
3037
|
const span = max - min;
|
|
2859
3038
|
const ratio = span > 0 ? Math.min(Math.max((value - min) / span, 0), 1) : 0;
|
|
2860
3039
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -2866,6 +3045,7 @@ const Root$3 = ({ value, min = 0, max = 100, level = "normal", label, children,
|
|
|
2866
3045
|
"aria-label": label ?? rest["aria-label"],
|
|
2867
3046
|
"data-scope": "meter",
|
|
2868
3047
|
"data-part": "root",
|
|
3048
|
+
"data-size": size,
|
|
2869
3049
|
"data-level": level !== "normal" ? level : void 0,
|
|
2870
3050
|
style: {
|
|
2871
3051
|
...rest.style,
|
|
@@ -2895,36 +3075,72 @@ const NavigationMenu = NavigationMenu$1;
|
|
|
2895
3075
|
injectComponentStyle("navigation-menu");
|
|
2896
3076
|
//#endregion
|
|
2897
3077
|
//#region src/components/number-input/index.tsx
|
|
3078
|
+
function NumberInputRoot({ size = "md", ...rest }) {
|
|
3079
|
+
return /* @__PURE__ */ jsx(NumberInput$1.Root, {
|
|
3080
|
+
...rest,
|
|
3081
|
+
"data-size": size
|
|
3082
|
+
});
|
|
3083
|
+
}
|
|
2898
3084
|
/** Ark's NumberInput, dressed in the paper-and-ink system: the stepper
|
|
2899
3085
|
* rides inside the field as one seal split by a hairline, numbers set in
|
|
2900
3086
|
* tabular figures. The API is Ark's own — Root, Label, Control, Input,
|
|
2901
3087
|
* ValueText, IncrementTrigger, DecrementTrigger, Scrubber. */
|
|
2902
|
-
const NumberInput =
|
|
3088
|
+
const NumberInput = {
|
|
3089
|
+
...NumberInput$1,
|
|
3090
|
+
Root: NumberInputRoot
|
|
3091
|
+
};
|
|
2903
3092
|
injectComponentStyle("number-input");
|
|
2904
3093
|
//#endregion
|
|
2905
3094
|
//#region src/components/pagination/index.tsx
|
|
3095
|
+
function PaginationRoot({ size = "md", ...rest }) {
|
|
3096
|
+
return /* @__PURE__ */ jsx(Pagination$1.Root, {
|
|
3097
|
+
...rest,
|
|
3098
|
+
"data-size": size
|
|
3099
|
+
});
|
|
3100
|
+
}
|
|
2906
3101
|
/**
|
|
2907
3102
|
* Pagination — paged navigation.
|
|
2908
3103
|
*
|
|
2909
3104
|
* Parts: Root, Item (page seals), Ellipsis, PrevTrigger, NextTrigger,
|
|
2910
3105
|
* FirstTrigger, LastTrigger. Items carry data-selected.
|
|
2911
3106
|
*/
|
|
2912
|
-
const Pagination =
|
|
3107
|
+
const Pagination = {
|
|
3108
|
+
...Pagination$1,
|
|
3109
|
+
Root: PaginationRoot
|
|
3110
|
+
};
|
|
2913
3111
|
injectComponentStyle("pagination");
|
|
2914
3112
|
//#endregion
|
|
2915
3113
|
//#region src/components/password-input/index.tsx
|
|
3114
|
+
function PasswordInputRoot({ size = "md", ...rest }) {
|
|
3115
|
+
return /* @__PURE__ */ jsx(PasswordInput$1.Root, {
|
|
3116
|
+
...rest,
|
|
3117
|
+
"data-size": size
|
|
3118
|
+
});
|
|
3119
|
+
}
|
|
2916
3120
|
/** Ark's PasswordInput, dressed in the paper-and-ink system: the reveal
|
|
2917
3121
|
* eye sits quiet at the field's edge and swaps in place — no shift, no
|
|
2918
3122
|
* noise. The API is Ark's own — Root, Label, Control, Input, Indicator,
|
|
2919
3123
|
* VisibilityTrigger. */
|
|
2920
|
-
const PasswordInput =
|
|
3124
|
+
const PasswordInput = {
|
|
3125
|
+
...PasswordInput$1,
|
|
3126
|
+
Root: PasswordInputRoot
|
|
3127
|
+
};
|
|
2921
3128
|
injectComponentStyle("password-input");
|
|
2922
3129
|
//#endregion
|
|
2923
3130
|
//#region src/components/pin-input/index.tsx
|
|
3131
|
+
function PinInputRoot({ size = "md", ...rest }) {
|
|
3132
|
+
return /* @__PURE__ */ jsx(PinInput$1.Root, {
|
|
3133
|
+
...rest,
|
|
3134
|
+
"data-size": size
|
|
3135
|
+
});
|
|
3136
|
+
}
|
|
2924
3137
|
/** Ark's PinInput, dressed in the paper-and-ink system: one character per
|
|
2925
3138
|
* square-cut seal, centered ink in tabular figures. The API is Ark's own —
|
|
2926
3139
|
* Root, Label, Control, Input, HiddenInput. */
|
|
2927
|
-
const PinInput =
|
|
3140
|
+
const PinInput = {
|
|
3141
|
+
...PinInput$1,
|
|
3142
|
+
Root: PinInputRoot
|
|
3143
|
+
};
|
|
2928
3144
|
injectComponentStyle("pin-input");
|
|
2929
3145
|
//#endregion
|
|
2930
3146
|
//#region src/components/popconfirm/index.tsx
|
|
@@ -2973,11 +3189,20 @@ const Popover = Popover$1;
|
|
|
2973
3189
|
injectComponentStyle("popover");
|
|
2974
3190
|
//#endregion
|
|
2975
3191
|
//#region src/components/progress/index.tsx
|
|
3192
|
+
function ProgressRoot({ size = "md", ...rest }) {
|
|
3193
|
+
return /* @__PURE__ */ jsx(Progress$1.Root, {
|
|
3194
|
+
...rest,
|
|
3195
|
+
"data-size": size
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
2976
3198
|
/** Ark's Progress, dressed in the paper-and-ink system: a quiet hairline
|
|
2977
3199
|
* groove that the primary ink fills at the machine's pace. The API is
|
|
2978
3200
|
* Ark's own — Root, Label, ValueText, Track, Range, View, Circle,
|
|
2979
3201
|
* CircleTrack, CircleRange. */
|
|
2980
|
-
const Progress =
|
|
3202
|
+
const Progress = {
|
|
3203
|
+
...Progress$1,
|
|
3204
|
+
Root: ProgressRoot
|
|
3205
|
+
};
|
|
2981
3206
|
injectComponentStyle("progress");
|
|
2982
3207
|
//#endregion
|
|
2983
3208
|
//#region src/components/progress-group/index.tsx
|
|
@@ -3042,19 +3267,37 @@ const QrCode = QrCode$1;
|
|
|
3042
3267
|
injectComponentStyle("qr-code");
|
|
3043
3268
|
//#endregion
|
|
3044
3269
|
//#region src/components/radio-group/index.tsx
|
|
3270
|
+
function RadioGroupRoot({ size = "md", ...rest }) {
|
|
3271
|
+
return /* @__PURE__ */ jsx(RadioGroup$1.Root, {
|
|
3272
|
+
...rest,
|
|
3273
|
+
"data-size": size
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3045
3276
|
/** Ark's RadioGroup, dressed in the paper-and-ink system: a column of
|
|
3046
3277
|
* full-circle seals that fill flat with primary ink when chosen, the dot
|
|
3047
3278
|
* punched through as paper. The API is Ark's own — Root, Label, Item,
|
|
3048
3279
|
* ItemText, ItemControl, Indicator, ItemHiddenInput. */
|
|
3049
|
-
const RadioGroup =
|
|
3280
|
+
const RadioGroup = {
|
|
3281
|
+
...RadioGroup$1,
|
|
3282
|
+
Root: RadioGroupRoot
|
|
3283
|
+
};
|
|
3050
3284
|
injectComponentStyle("radio-group");
|
|
3051
3285
|
//#endregion
|
|
3052
3286
|
//#region src/components/rating-group/index.tsx
|
|
3287
|
+
function RatingGroupRoot({ size = "md", ...rest }) {
|
|
3288
|
+
return /* @__PURE__ */ jsx(RatingGroup$1.Root, {
|
|
3289
|
+
...rest,
|
|
3290
|
+
"data-size": size
|
|
3291
|
+
});
|
|
3292
|
+
}
|
|
3053
3293
|
/** Ark's RatingGroup, dressed in the paper-and-ink system: a row of quiet
|
|
3054
3294
|
* seals whose glyphs take the primary pigment as they light up. The API is
|
|
3055
3295
|
* Ark's own — Root, Label, Control, Item, HiddenInput (plus the Context and
|
|
3056
3296
|
* ItemContext render helpers). */
|
|
3057
|
-
const RatingGroup =
|
|
3297
|
+
const RatingGroup = {
|
|
3298
|
+
...RatingGroup$1,
|
|
3299
|
+
Root: RatingGroupRoot
|
|
3300
|
+
};
|
|
3058
3301
|
injectComponentStyle("rating-group");
|
|
3059
3302
|
//#endregion
|
|
3060
3303
|
//#region src/components/scroll-area/index.tsx
|
|
@@ -3065,20 +3308,33 @@ const ScrollArea = ScrollArea$1;
|
|
|
3065
3308
|
injectComponentStyle("scroll-area");
|
|
3066
3309
|
//#endregion
|
|
3067
3310
|
//#region src/components/segment-group/index.tsx
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3311
|
+
function SegmentGroupRoot({ size = "md", ...rest }) {
|
|
3312
|
+
return /* @__PURE__ */ jsx(SegmentGroup$1.Root, {
|
|
3313
|
+
...rest,
|
|
3314
|
+
"data-size": size
|
|
3315
|
+
});
|
|
3316
|
+
}
|
|
3317
|
+
/** SegmentGroup, dressed in the paper-and-ink system: a hairline tray
|
|
3318
|
+
* where one flat ink plate travels beneath the checked seal. The parts - Root, Label, Indicator, Item, ItemText, ItemControl,
|
|
3071
3319
|
* ItemHiddenInput. */
|
|
3072
|
-
const SegmentGroup =
|
|
3320
|
+
const SegmentGroup = {
|
|
3321
|
+
...SegmentGroup$1,
|
|
3322
|
+
Root: SegmentGroupRoot
|
|
3323
|
+
};
|
|
3073
3324
|
injectComponentStyle("segment-group");
|
|
3074
3325
|
//#endregion
|
|
3075
3326
|
//#region src/components/select/index.tsx
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3327
|
+
function SelectRoot(props) {
|
|
3328
|
+
const { size = "md", ...rest } = props;
|
|
3329
|
+
return /* @__PURE__ */ jsx(Select$1.Root, {
|
|
3330
|
+
...rest,
|
|
3331
|
+
"data-size": size
|
|
3332
|
+
});
|
|
3333
|
+
}
|
|
3334
|
+
const Select = {
|
|
3335
|
+
...Select$1,
|
|
3336
|
+
Root: SelectRoot
|
|
3337
|
+
};
|
|
3082
3338
|
injectComponentStyle("select");
|
|
3083
3339
|
//#endregion
|
|
3084
3340
|
//#region src/components/separator/index.tsx
|
|
@@ -3113,11 +3369,20 @@ function Skeleton({ ...rest }) {
|
|
|
3113
3369
|
injectComponentStyle("skeleton");
|
|
3114
3370
|
//#endregion
|
|
3115
3371
|
//#region src/components/slider/index.tsx
|
|
3372
|
+
function SliderRoot({ size = "md", ...rest }) {
|
|
3373
|
+
return /* @__PURE__ */ jsx(Slider$1.Root, {
|
|
3374
|
+
...rest,
|
|
3375
|
+
"data-size": size
|
|
3376
|
+
});
|
|
3377
|
+
}
|
|
3116
3378
|
/** Ark's Slider, dressed in the paper-and-ink system: a recessed track the
|
|
3117
3379
|
* primary ink runs along, a paper-seal thumb, and hairline tick markers.
|
|
3118
3380
|
* The API is Ark's own — Root, Label, ValueText, Control, Track, Range,
|
|
3119
3381
|
* Thumb, MarkerGroup, Marker, DraggingIndicator, HiddenInput. */
|
|
3120
|
-
const Slider =
|
|
3382
|
+
const Slider = {
|
|
3383
|
+
...Slider$1,
|
|
3384
|
+
Root: SliderRoot
|
|
3385
|
+
};
|
|
3121
3386
|
injectComponentStyle("slider");
|
|
3122
3387
|
//#endregion
|
|
3123
3388
|
//#region src/components/split-button/index.tsx
|
|
@@ -3320,6 +3585,12 @@ const Stat = Object.assign(Root$1, {
|
|
|
3320
3585
|
injectComponentStyle("stat");
|
|
3321
3586
|
//#endregion
|
|
3322
3587
|
//#region src/components/steps/index.tsx
|
|
3588
|
+
function StepsRoot({ size = "md", ...rest }) {
|
|
3589
|
+
return /* @__PURE__ */ jsx(Steps$1.Root, {
|
|
3590
|
+
...rest,
|
|
3591
|
+
"data-size": size
|
|
3592
|
+
});
|
|
3593
|
+
}
|
|
3323
3594
|
/**
|
|
3324
3595
|
* Steps — linear progress through a sequence.
|
|
3325
3596
|
*
|
|
@@ -3327,7 +3598,10 @@ injectComponentStyle("stat");
|
|
|
3327
3598
|
* PrevTrigger, NextTrigger, Progress. Indicator and Separator carry
|
|
3328
3599
|
* data-complete / data-current / data-incomplete.
|
|
3329
3600
|
*/
|
|
3330
|
-
const Steps =
|
|
3601
|
+
const Steps = {
|
|
3602
|
+
...Steps$1,
|
|
3603
|
+
Root: StepsRoot
|
|
3604
|
+
};
|
|
3331
3605
|
injectComponentStyle("steps");
|
|
3332
3606
|
//#endregion
|
|
3333
3607
|
//#region src/components/swap/index.tsx
|
|
@@ -3339,30 +3613,57 @@ const Swap = Swap$1;
|
|
|
3339
3613
|
injectComponentStyle("swap");
|
|
3340
3614
|
//#endregion
|
|
3341
3615
|
//#region src/components/switch/index.tsx
|
|
3616
|
+
function SwitchRoot({ size = "md", ...rest }) {
|
|
3617
|
+
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
3618
|
+
...rest,
|
|
3619
|
+
"data-size": size
|
|
3620
|
+
});
|
|
3621
|
+
}
|
|
3342
3622
|
/** Ark's Switch, dressed in the paper-and-ink system: a track that rests
|
|
3343
3623
|
* in the inset shade of the paper and fills flat with primary ink when on,
|
|
3344
3624
|
* the thumb sliding on the spring. The API is Ark's own — Root, Label,
|
|
3345
3625
|
* Control, Thumb, HiddenInput. */
|
|
3346
|
-
const Switch =
|
|
3626
|
+
const Switch = {
|
|
3627
|
+
...Switch$1,
|
|
3628
|
+
Root: SwitchRoot
|
|
3629
|
+
};
|
|
3347
3630
|
injectComponentStyle("switch");
|
|
3348
3631
|
//#endregion
|
|
3349
3632
|
//#region src/components/tabs/index.tsx
|
|
3633
|
+
function TabsRoot({ size = "md", ...rest }) {
|
|
3634
|
+
return /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
3635
|
+
...rest,
|
|
3636
|
+
"data-size": size
|
|
3637
|
+
});
|
|
3638
|
+
}
|
|
3350
3639
|
/**
|
|
3351
3640
|
* Tabs — tabbed navigation.
|
|
3352
3641
|
*
|
|
3353
3642
|
* Parts: Root, List, Trigger, Content, Indicator (machine-positioned ink
|
|
3354
3643
|
* bar on the list rule).
|
|
3355
3644
|
*/
|
|
3356
|
-
const Tabs =
|
|
3645
|
+
const Tabs = {
|
|
3646
|
+
...Tabs$1,
|
|
3647
|
+
Root: TabsRoot
|
|
3648
|
+
};
|
|
3357
3649
|
injectComponentStyle("tabs");
|
|
3358
3650
|
//#endregion
|
|
3359
3651
|
//#region src/components/tags-input/index.tsx
|
|
3652
|
+
function TagsInputRoot({ size = "md", ...rest }) {
|
|
3653
|
+
return /* @__PURE__ */ jsx(TagsInput$1.Root, {
|
|
3654
|
+
...rest,
|
|
3655
|
+
"data-size": size
|
|
3656
|
+
});
|
|
3657
|
+
}
|
|
3360
3658
|
/** Ark's TagsInput, dressed in the paper-and-ink system: one field vessel
|
|
3361
3659
|
* whose chips rest as quiet ink and lift only a tone when edited. The API
|
|
3362
3660
|
* is Ark's own — Root, Label, Control, Input, ClearTrigger, Item,
|
|
3363
3661
|
* ItemPreview, ItemText, ItemInput, ItemDeleteTrigger, HiddenInput,
|
|
3364
3662
|
* Context. */
|
|
3365
|
-
const TagsInput =
|
|
3663
|
+
const TagsInput = {
|
|
3664
|
+
...TagsInput$1,
|
|
3665
|
+
Root: TagsInputRoot
|
|
3666
|
+
};
|
|
3366
3667
|
injectComponentStyle("tags-input");
|
|
3367
3668
|
//#endregion
|
|
3368
3669
|
//#region src/components/table/index.tsx
|
|
@@ -3570,21 +3871,24 @@ function DataTable(rawProps) {
|
|
|
3570
3871
|
const rows = table.getRowModel().rows;
|
|
3571
3872
|
/** The declared row height is the density-scale baseline; the live
|
|
3572
3873
|
* scale comes off the document so the virtual window matches what CSS
|
|
3573
|
-
* actually renders.
|
|
3574
|
-
|
|
3874
|
+
* actually renders. It is read once and re-read only when the density
|
|
3875
|
+
* or scene attribute moves — estimateSize runs on every scroll frame. */
|
|
3876
|
+
let densityScale = 1;
|
|
3877
|
+
const readDensityScale = () => {
|
|
3575
3878
|
const value = Number(getComputedStyle(document.documentElement).getPropertyValue("--bs-density-scale"));
|
|
3576
|
-
|
|
3879
|
+
densityScale = Number.isFinite(value) && value > 0 ? value : 1;
|
|
3577
3880
|
};
|
|
3578
3881
|
const virtualizer = useVirtualizer({
|
|
3579
3882
|
count: rows.length,
|
|
3580
3883
|
getScrollElement: () => viewport.current,
|
|
3581
|
-
estimateSize: () => rowHeight * densityScale
|
|
3884
|
+
estimateSize: () => rowHeight * densityScale,
|
|
3582
3885
|
getItemKey: (index) => rows[index]?.id ?? index,
|
|
3583
3886
|
overscan: 8
|
|
3584
3887
|
});
|
|
3585
3888
|
const [, rerender] = useReducer((count) => count + 1, 0);
|
|
3586
3889
|
useEffect(() => {
|
|
3587
3890
|
if (!virtual) return;
|
|
3891
|
+
readDensityScale();
|
|
3588
3892
|
const observer = new MutationObserver(rerender);
|
|
3589
3893
|
observer.observe(document.documentElement, {
|
|
3590
3894
|
attributes: true,
|
|
@@ -4148,10 +4452,19 @@ const Typography = Object.assign(Display, {
|
|
|
4148
4452
|
injectComponentStyle("typography");
|
|
4149
4453
|
//#endregion
|
|
4150
4454
|
//#region src/components/toggle-group/index.tsx
|
|
4455
|
+
function ToggleGroupRoot({ size = "md", ...rest }) {
|
|
4456
|
+
return /* @__PURE__ */ jsx(ToggleGroup$1.Root, {
|
|
4457
|
+
...rest,
|
|
4458
|
+
"data-size": size
|
|
4459
|
+
});
|
|
4460
|
+
}
|
|
4151
4461
|
/** Ark's ToggleGroup, dressed in the paper-and-ink system: a hairline tray
|
|
4152
4462
|
* of quiet seals where the pressed item takes the flat ink fill. The API is
|
|
4153
4463
|
* Ark's own — Root, Item. */
|
|
4154
|
-
const ToggleGroup =
|
|
4464
|
+
const ToggleGroup = {
|
|
4465
|
+
...ToggleGroup$1,
|
|
4466
|
+
Root: ToggleGroupRoot
|
|
4467
|
+
};
|
|
4155
4468
|
injectComponentStyle("toggle-group");
|
|
4156
4469
|
//#endregion
|
|
4157
4470
|
//#region src/components/tooltip/index.tsx
|
|
@@ -4353,7 +4666,7 @@ function TreeSelectRow({ node, indexPath }) {
|
|
|
4353
4666
|
})
|
|
4354
4667
|
});
|
|
4355
4668
|
}
|
|
4356
|
-
function TreeSelect({ value, data, placeholder = "Select…", filterable = false, disabled = false, onValueChange, ...rest }) {
|
|
4669
|
+
function TreeSelect({ value, data, placeholder = "Select…", filterable = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
4357
4670
|
const [open, setOpen] = useState(false);
|
|
4358
4671
|
const [query, setQuery] = useState("");
|
|
4359
4672
|
const filterFns = useFilter({ sensitivity: "base" });
|
|
@@ -4421,6 +4734,7 @@ function TreeSelect({ value, data, placeholder = "Select…", filterable = false
|
|
|
4421
4734
|
type: "button",
|
|
4422
4735
|
"data-scope": "tree-select",
|
|
4423
4736
|
"data-part": "control",
|
|
4737
|
+
"data-size": size,
|
|
4424
4738
|
"data-open": open ? "" : void 0,
|
|
4425
4739
|
"data-placeholder": label == null ? "" : void 0,
|
|
4426
4740
|
disabled,
|
|
@@ -4429,6 +4743,7 @@ function TreeSelect({ value, data, placeholder = "Select…", filterable = false
|
|
|
4429
4743
|
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, { children: /* @__PURE__ */ jsxs(Popover$1.Content, {
|
|
4430
4744
|
"data-scope": "tree-select",
|
|
4431
4745
|
"data-part": "content",
|
|
4746
|
+
"data-size": size,
|
|
4432
4747
|
children: [filterable ? /* @__PURE__ */ jsx("div", {
|
|
4433
4748
|
"data-scope": "tree-select",
|
|
4434
4749
|
"data-part": "search",
|
|
@@ -4465,14 +4780,17 @@ injectComponentStyle("tree-select");
|
|
|
4465
4780
|
injectComponentStyle("tree-view");
|
|
4466
4781
|
//#endregion
|
|
4467
4782
|
//#region src/components/tree-view/index.tsx
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
const TreeView =
|
|
4783
|
+
function TreeViewRoot(props) {
|
|
4784
|
+
const { size = "md", ...rest } = props;
|
|
4785
|
+
return /* @__PURE__ */ jsx(TreeView$1.Root, {
|
|
4786
|
+
...rest,
|
|
4787
|
+
"data-size": size
|
|
4788
|
+
});
|
|
4789
|
+
}
|
|
4790
|
+
const TreeView = {
|
|
4791
|
+
...TreeView$1,
|
|
4792
|
+
Root: TreeViewRoot
|
|
4793
|
+
};
|
|
4476
4794
|
injectComponentStyle("tree-view");
|
|
4477
4795
|
//#endregion
|
|
4478
4796
|
//#region src/components/watermark/index.tsx
|