@manakind/ui-core 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/button/button.css +16 -0
- package/dist/button/button.d.ts +10 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +8 -6
- package/dist/button/button.js.map +1 -1
- package/dist/card/card.css +5 -0
- package/dist/card/card.d.ts +11 -2
- package/dist/card/card.d.ts.map +1 -1
- package/dist/card/card.js +2 -2
- package/dist/card/card.js.map +1 -1
- package/dist/card/index.d.ts +1 -1
- package/dist/card/index.d.ts.map +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/combobox/combobox.css +5 -5
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/combobox.js +2 -21
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/dialog/dialog.css +5 -0
- package/dist/dialog/dialog.d.ts +8 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/dialog/dialog.js +2 -2
- package/dist/dialog/dialog.js.map +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/group-items.d.ts +15 -0
- package/dist/group-items.d.ts.map +1 -0
- package/dist/group-items.js +25 -0
- package/dist/group-items.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/layout.css +134 -0
- package/dist/layout/layout.d.ts +66 -4
- package/dist/layout/layout.d.ts.map +1 -1
- package/dist/layout/layout.js +58 -10
- package/dist/layout/layout.js.map +1 -1
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/link.css +40 -0
- package/dist/link/link.css.d.ts +2 -0
- package/dist/link/link.d.ts +27 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +17 -0
- package/dist/link/link.js.map +1 -0
- package/dist/scroll-area/index.d.ts +3 -0
- package/dist/scroll-area/index.d.ts.map +1 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/scroll-area/index.js.map +1 -0
- package/dist/scroll-area/scroll-area.css +26 -0
- package/dist/scroll-area/scroll-area.css.d.ts +2 -0
- package/dist/scroll-area/scroll-area.d.ts +26 -0
- package/dist/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area/scroll-area.js +16 -0
- package/dist/scroll-area/scroll-area.js.map +1 -0
- package/dist/section/section.d.ts +8 -2
- package/dist/section/section.d.ts.map +1 -1
- package/dist/section/section.js +2 -2
- package/dist/section/section.js.map +1 -1
- package/dist/segment-group/segment-group.css +5 -0
- package/dist/segment-group/segment-group.d.ts +6 -1
- package/dist/segment-group/segment-group.d.ts.map +1 -1
- package/dist/segment-group/segment-group.js +2 -2
- package/dist/segment-group/segment-group.js.map +1 -1
- package/dist/select/select.css +49 -0
- package/dist/select/select.d.ts +26 -4
- package/dist/select/select.d.ts.map +1 -1
- package/dist/select/select.js +22 -5
- package/dist/select/select.js.map +1 -1
- package/dist/spinner/index.d.ts +3 -0
- package/dist/spinner/index.d.ts.map +1 -0
- package/dist/spinner/index.js +2 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/spinner/spinner.css +36 -0
- package/dist/spinner/spinner.css.d.ts +2 -0
- package/dist/spinner/spinner.d.ts +25 -0
- package/dist/spinner/spinner.d.ts.map +1 -0
- package/dist/spinner/spinner.js +17 -0
- package/dist/spinner/spinner.js.map +1 -0
- package/dist/sticky/index.d.ts +3 -0
- package/dist/sticky/index.d.ts.map +1 -0
- package/dist/sticky/index.js +2 -0
- package/dist/sticky/index.js.map +1 -0
- package/dist/sticky/sticky.css +92 -0
- package/dist/sticky/sticky.css.d.ts +2 -0
- package/dist/sticky/sticky.d.ts +47 -0
- package/dist/sticky/sticky.d.ts.map +1 -0
- package/dist/sticky/sticky.js +20 -0
- package/dist/sticky/sticky.js.map +1 -0
- package/dist/text/text.css +20 -0
- package/dist/text/text.d.ts +13 -5
- package/dist/text/text.d.ts.map +1 -1
- package/dist/text/text.js +25 -6
- package/dist/text/text.js.map +1 -1
- package/package.json +34 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './scroll-area.css';
|
|
4
|
+
import { cx } from '../cx';
|
|
5
|
+
/**
|
|
6
|
+
* A box whose content scrolls inside it instead of widening the page.
|
|
7
|
+
*
|
|
8
|
+
* A tree or a grid wider than its card scrolls sideways; a list that must
|
|
9
|
+
* not outgrow its panel scrolls down. The box is sized by its parent (a
|
|
10
|
+
* dialog body, a popover, a Frame): the scroll area only keeps its content
|
|
11
|
+
* inside. Renders a `div`; pass `asChild` to scroll your own element.
|
|
12
|
+
*/
|
|
13
|
+
export function ScrollArea({ axis = 'y', label, className, children, ...props }) {
|
|
14
|
+
return (_jsx(ark.div, { role: label ? 'region' : undefined, "aria-label": label, tabIndex: label ? 0 : undefined, className: cx('ds-scroll-area', `ds-scroll-area--${axis}`, className), ...props, children: children }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=scroll-area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.js","sourceRoot":"","sources":["../../src/scroll-area/scroll-area.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAiB3B;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC9F,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBACtB,KAAK,EACjB,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC/B,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,mBAAmB,IAAI,EAAE,EAAE,SAAS,CAAC,KACjE,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ark } from '@ark-ui/react/factory';
|
|
2
|
-
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { type ComponentProps, type ReactNode, type Ref } from 'react';
|
|
3
3
|
import './section.css';
|
|
4
4
|
import { type HeadingLevel } from '../text/text';
|
|
5
5
|
/**
|
|
@@ -18,6 +18,12 @@ export interface SectionProps extends Omit<ComponentProps<typeof ark.section>, '
|
|
|
18
18
|
description?: ReactNode;
|
|
19
19
|
/** Controls beside the title: a "See all" link, a filter. */
|
|
20
20
|
actions?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The heading element, for moving focus to the region after a change
|
|
23
|
+
* inside it (a deletion that removed the focused row). The heading takes
|
|
24
|
+
* `tabIndex={-1}` so it can take focus without entering the tab order.
|
|
25
|
+
*/
|
|
26
|
+
titleRef?: Ref<HTMLHeadingElement>;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
29
|
* A titled region of a page.
|
|
@@ -27,5 +33,5 @@ export interface SectionProps extends Omit<ComponentProps<typeof ark.section>, '
|
|
|
27
33
|
* title and description with the actions beside them; the children follow
|
|
28
34
|
* at the section's own gap, tighter than the page's.
|
|
29
35
|
*/
|
|
30
|
-
export declare function Section({ title, titleLevel, description, actions, className, children, ...props }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function Section({ title, titleLevel, description, actions, titleRef, className, children, ...props }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
31
37
|
//# sourceMappingURL=section.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/section/section.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/section/section.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAS,MAAM,OAAO,CAAC;AAC7E,OAAO,eAAe,CAAC;AAEvB,OAAO,EAAW,KAAK,YAAY,EAAQ,MAAM,cAAc,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrE,mFAAmF;IACnF,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,kCAAkC;IAClC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,kBAAkB,CAAC,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,UAAc,EACd,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,YAAY,2CA2Bd"}
|
package/dist/section/section.js
CHANGED
|
@@ -12,8 +12,8 @@ import { Heading, Text } from '../text/text';
|
|
|
12
12
|
* title and description with the actions beside them; the children follow
|
|
13
13
|
* at the section's own gap, tighter than the page's.
|
|
14
14
|
*/
|
|
15
|
-
export function Section({ title, titleLevel = 2, description, actions, className, children, ...props }) {
|
|
15
|
+
export function Section({ title, titleLevel = 2, description, actions, titleRef, className, children, ...props }) {
|
|
16
16
|
const titleId = useId();
|
|
17
|
-
return (_jsxs(ark.section, { "aria-labelledby": titleId, className: cx('ds-section', className), ...props, children: [_jsxs("div", { className: "ds-section__header", children: [_jsxs("div", { className: "ds-section__heading", children: [_jsx(Heading, { level: titleLevel, size: "xl", id: titleId, className: "ds-section__title", children: title }), description ? (_jsx(Text, { tone: "muted", className: "ds-section__description", children: description })) : null] }), actions ? _jsx("div", { className: "ds-section__actions", children: actions }) : null] }), children] }));
|
|
17
|
+
return (_jsxs(ark.section, { "aria-labelledby": titleId, className: cx('ds-section', className), ...props, children: [_jsxs("div", { className: "ds-section__header", children: [_jsxs("div", { className: "ds-section__heading", children: [_jsx(Heading, { level: titleLevel, size: "xl", id: titleId, ref: titleRef, tabIndex: titleRef ? -1 : undefined, className: "ds-section__title", children: title }), description ? (_jsx(Text, { tone: "muted", className: "ds-section__description", children: description })) : null] }), actions ? _jsx("div", { className: "ds-section__actions", children: actions }) : null] }), children] }));
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=section.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.js","sourceRoot":"","sources":["../../src/section/section.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"section.js","sourceRoot":"","sources":["../../src/section/section.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAiD,KAAK,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAqB,IAAI,EAAE,MAAM,cAAc,CAAC;AA2BhE;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EACL,UAAU,GAAG,CAAC,EACd,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACK;IACb,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,OAAO,CACL,MAAC,GAAG,CAAC,OAAO,uBAAkB,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,KAAM,KAAK,aACtF,eAAK,SAAS,EAAC,oBAAoB,aACjC,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,OAAO,IACN,KAAK,EAAE,UAAU,EACjB,IAAI,EAAC,IAAI,EACT,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACnC,SAAS,EAAC,mBAAmB,YAE5B,KAAK,GACE,EACT,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,yBAAyB,YACnD,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,OAAO,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,qBAAqB,YAAE,OAAO,GAAO,CAAC,CAAC,CAAC,IAAI,IAClE,EACL,QAAQ,IACG,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -106,6 +106,11 @@
|
|
|
106
106
|
* width, so only a word wider than the whole track breaks inside its
|
|
107
107
|
* segment, as the long-words rule asks of every component.
|
|
108
108
|
*/
|
|
109
|
+
&.ds-segment-group--full-width {
|
|
110
|
+
display: flex;
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
109
114
|
&.ds-segment-group--fit-content {
|
|
110
115
|
& .ds-segment-group__track {
|
|
111
116
|
display: flex;
|
|
@@ -59,6 +59,11 @@ export type SegmentGroupProps = SegmentGroupName & {
|
|
|
59
59
|
* short items (six t-shirt sizes) that has to fit a phone.
|
|
60
60
|
*/
|
|
61
61
|
density?: 'default' | 'dense';
|
|
62
|
+
/**
|
|
63
|
+
* Whether the group takes the whole width of its row, the track with it:
|
|
64
|
+
* a state or effort choice in a form, level with the fields above it.
|
|
65
|
+
*/
|
|
66
|
+
fullWidth?: boolean;
|
|
62
67
|
/** Disable every segment. The checked one keeps showing which is set. */
|
|
63
68
|
disabled?: boolean;
|
|
64
69
|
/** Name for native form participation through the hidden radio inputs. */
|
|
@@ -93,6 +98,6 @@ export type SegmentGroupProps = SegmentGroupName & {
|
|
|
93
98
|
* want a `Select`. Panels that change with the choice are `Tabs`; a segment
|
|
94
99
|
* group changes a value, not what is on the page.
|
|
95
100
|
*/
|
|
96
|
-
export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, fit, density, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, fit, density, fullWidth, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
97
102
|
export {};
|
|
98
103
|
//# sourceMappingURL=segment-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,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|
|
1
|
+
{"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,KAAK,gBAAgB,GACjB;IACE,oEAAoE;IACpE,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2FAA2F;IAC3F,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,qDAAqD;IACrD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,GAAa,EACb,OAAmB,EACnB,SAAiB,EACjB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,iBAAiB,2CAuEnB"}
|
|
@@ -30,7 +30,7 @@ import { cx } from '../cx';
|
|
|
30
30
|
* want a `Select`. Panels that change with the choice are `Tabs`; a segment
|
|
31
31
|
* group changes a value, not what is on the page.
|
|
32
32
|
*/
|
|
33
|
-
export function SegmentGroup({ label, items, value, defaultValue, onValueChange, size = 'md', fit = 'equal', density = 'default', disabled, name, className, 'aria-label': ariaLabel, }) {
|
|
33
|
+
export function SegmentGroup({ label, items, value, defaultValue, onValueChange, size = 'md', fit = 'equal', density = 'default', fullWidth = false, disabled, name, className, 'aria-label': ariaLabel, }) {
|
|
34
34
|
const rootRef = useRef(null);
|
|
35
35
|
/*
|
|
36
36
|
* Zag reports `null` only when the value is cleared through its API, which
|
|
@@ -59,6 +59,6 @@ export function SegmentGroup({ label, items, value, defaultValue, onValueChange,
|
|
|
59
59
|
const visibleLabel = label &&
|
|
60
60
|
(ariaLabel ? (_jsx("span", { className: "ds-segment-group__label", children: label })) : (_jsx(ArkSegmentGroup.Label, { className: "ds-segment-group__label", children: label })));
|
|
61
61
|
const renderItem = (item) => (_jsxs(ArkSegmentGroup.Item, { value: item.value, disabled: item.disabled, className: "ds-segment-group__item", children: [_jsx(ArkSegmentGroup.ItemText, { className: "ds-segment-group__item-text", children: item.label }), _jsx(ArkSegmentGroup.ItemHiddenInput, {})] }, item.value));
|
|
62
|
-
return (_jsxs(ArkSegmentGroup.Root, { ref: rootRef, className: cx('ds-segment-group', `ds-segment-group--${size}`, fit === 'content' && 'ds-segment-group--fit-content', density === 'dense' && 'ds-segment-group--dense', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, disabled: disabled, name: name, orientation: "horizontal", "aria-label": ariaLabel, children: [visibleLabel, _jsx("div", { className: "ds-segment-group__track", children: items.map(renderItem) })] }));
|
|
62
|
+
return (_jsxs(ArkSegmentGroup.Root, { ref: rootRef, className: cx('ds-segment-group', `ds-segment-group--${size}`, fit === 'content' && 'ds-segment-group--fit-content', density === 'dense' && 'ds-segment-group--dense', fullWidth && 'ds-segment-group--full-width', className), value: value, defaultValue: defaultValue, onValueChange: handleValueChange, disabled: disabled, name: name, orientation: "horizontal", "aria-label": ariaLabel, children: [visibleLabel, _jsx("div", { className: "ds-segment-group__track", children: items.map(renderItem) })] }));
|
|
63
63
|
}
|
|
64
64
|
//# sourceMappingURL=segment-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-group.js","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"segment-group.js","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA+E3B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,K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AAG,KAR9B,IAAI,CAAC,KAAK,CASM,CACxB,CAAC;IAEF,OAAO,CACL,MAAC,eAAe,CAAC,IAAI,IACnB,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,kBAAkB,EAClB,qBAAqB,IAAI,EAAE,EAC3B,GAAG,KAAK,SAAS,IAAI,+BAA+B,EACpD,OAAO,KAAK,OAAO,IAAI,yBAAyB,EAChD,SAAS,IAAI,8BAA8B,EAC3C,SAAS,CACV,EACD,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,iBAAiB,EAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,WAAW,EAAC,YAAY,gBACZ,SAAS,aAEpB,YAAY,EACb,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,GAAO,IACjD,CACxB,CAAC;AACJ,CAAC"}
|
package/dist/select/select.css
CHANGED
|
@@ -93,6 +93,55 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
.ds-select__item-content {
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: var(--ds-select-item-gap);
|
|
100
|
+
max-width: 100%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* A long label wraps beside the icon instead of squeezing it, as in Menu. */
|
|
104
|
+
.ds-select__item-icon {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-select__item-text {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ds-select__item-description {
|
|
116
|
+
color: var(--ds-field-hint-text);
|
|
117
|
+
font-size: var(--ds-field-hint-font-size);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
* A highlighted row takes the highlighted text colour, which the hint
|
|
122
|
+
* colour was never measured against; the description follows the row.
|
|
123
|
+
*/
|
|
124
|
+
.ds-select__item[data-highlighted] .ds-select__item-description {
|
|
125
|
+
color: inherit;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/*
|
|
129
|
+
* A group of options under its heading, set apart from the group above by
|
|
130
|
+
* more space than separates two options, so the groups read as groups.
|
|
131
|
+
*/
|
|
132
|
+
.ds-select__group + .ds-select__group,
|
|
133
|
+
.ds-select__item + .ds-select__group {
|
|
134
|
+
margin-block-start: var(--ds-select-group-gap);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ds-select__group-label {
|
|
138
|
+
display: block;
|
|
139
|
+
padding: var(--ds-select-item-padding-block) var(--ds-select-item-padding-inline);
|
|
140
|
+
color: var(--ds-select-group-label-text);
|
|
141
|
+
font-size: var(--ds-select-group-label-font-size);
|
|
142
|
+
font-weight: var(--ds-select-group-label-font-weight);
|
|
143
|
+
}
|
|
144
|
+
|
|
96
145
|
/*
|
|
97
146
|
* Ark renders an ItemIndicator inside every item and leaves visibility to
|
|
98
147
|
* CSS. Without this, every option shows a checkmark.
|
package/dist/select/select.d.ts
CHANGED
|
@@ -7,6 +7,26 @@ export interface SelectItem {
|
|
|
7
7
|
value: string;
|
|
8
8
|
/** Text shown in the list and in the trigger once chosen. */
|
|
9
9
|
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional secondary line under the label in the list, shown muted, such as
|
|
12
|
+
* the category a project is filed under. Part of the option's name. On a
|
|
13
|
+
* highlighted row it takes the row's text colour, which the muted colour
|
|
14
|
+
* was never measured against.
|
|
15
|
+
*/
|
|
16
|
+
description?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Decorative mark before the label, in the list and in the trigger once
|
|
19
|
+
* chosen: a category's colour dot or its glyph. The label carries the
|
|
20
|
+
* meaning, so mark it `aria-hidden` or decorative.
|
|
21
|
+
*/
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The group the option is listed under, by its heading. Options sharing a
|
|
25
|
+
* group are listed together under it, groups in the order they first
|
|
26
|
+
* appear; options without one (or with an empty name) are listed before
|
|
27
|
+
* any group. Same rule as `ComboboxItem.group`.
|
|
28
|
+
*/
|
|
29
|
+
group?: string;
|
|
10
30
|
/** Individually disable this option without removing it. */
|
|
11
31
|
disabled?: boolean;
|
|
12
32
|
}
|
|
@@ -84,9 +104,10 @@ export interface SelectProps {
|
|
|
84
104
|
/**
|
|
85
105
|
* Render an option's content. Defaults to its `label`.
|
|
86
106
|
*
|
|
87
|
-
* The escape hatch for
|
|
88
|
-
* you return must still convey the option in text; do not return
|
|
89
|
-
* an icon alone.
|
|
107
|
+
* The escape hatch for rows that `icon` and `description` don't cover.
|
|
108
|
+
* Whatever you return must still convey the option in text; do not return
|
|
109
|
+
* colour or an icon alone. It replaces the label, icon and description in
|
|
110
|
+
* the list, not in the trigger.
|
|
90
111
|
*/
|
|
91
112
|
renderItem?: (item: SelectItem) => ReactNode;
|
|
92
113
|
/**
|
|
@@ -124,7 +145,8 @@ export interface SelectProps {
|
|
|
124
145
|
* ```
|
|
125
146
|
*
|
|
126
147
|
* Give it a `label` or an `aria-label` — a select with neither is announced
|
|
127
|
-
* as an unnamed combobox.
|
|
148
|
+
* as an unnamed combobox. Options can carry a leading `icon`, a muted
|
|
149
|
+
* `description` line and a `group` heading; for multi-select, compose Ark's
|
|
128
150
|
* anatomy directly in a product package rather than widening this API.
|
|
129
151
|
*
|
|
130
152
|
* The listbox renders in a portal, so it escapes ancestor `overflow: hidden`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAoC,MAAM,OAAO,CAAC;AACzE,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,cAAc,CAAC;
|
|
1
|
+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;IAC9D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,CAAC;IAC7C;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,gGAAgG;IAChG,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,QAAQ,EACR,OAAe,EACf,WAAwB,EACxB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,UAAU,EACV,SAAwB,EACxB,aAAqB,EACrB,YAAY,EAAE,SAAS,GACxB,EAAE,WAAW,2CAqHb"}
|
package/dist/select/select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Portal } from '@ark-ui/react/portal';
|
|
3
3
|
import { Select as ArkSelect, createListCollection } from '@ark-ui/react/select';
|
|
4
4
|
import { useCallback, useContext, useMemo } from 'react';
|
|
@@ -7,6 +7,17 @@ import { PortalContainerContext } from '../portal-container';
|
|
|
7
7
|
import './select.css';
|
|
8
8
|
import { cx } from '../cx';
|
|
9
9
|
import { Check, ChevronRight } from '../fallback-glyphs';
|
|
10
|
+
import { groupItems } from '../group-items';
|
|
11
|
+
function ItemContent({ item }) {
|
|
12
|
+
return (_jsxs("span", { className: "ds-select__item-content", children: [item.icon && _jsx("span", { className: "ds-select__item-icon", children: item.icon }), _jsxs("span", { className: "ds-select__item-text", children: [_jsx("span", { children: item.label }), item.description && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "ds-select__item-description", children: item.description })] }))] })] }));
|
|
13
|
+
}
|
|
14
|
+
// The trigger shows a chosen option's icon too. Without one it returns
|
|
15
|
+
// nothing, so Ark falls back to the label or the placeholder.
|
|
16
|
+
function chosenWithIcon(item) {
|
|
17
|
+
if (!item?.icon)
|
|
18
|
+
return undefined;
|
|
19
|
+
return (_jsxs("span", { className: "ds-select__item-content", children: [_jsx("span", { className: "ds-select__item-icon", children: item.icon }), _jsx("span", { children: item.label })] }));
|
|
20
|
+
}
|
|
10
21
|
/**
|
|
11
22
|
* Single-select dropdown, built on Ark UI.
|
|
12
23
|
*
|
|
@@ -26,7 +37,8 @@ import { Check, ChevronRight } from '../fallback-glyphs';
|
|
|
26
37
|
* ```
|
|
27
38
|
*
|
|
28
39
|
* Give it a `label` or an `aria-label` — a select with neither is announced
|
|
29
|
-
* as an unnamed combobox.
|
|
40
|
+
* as an unnamed combobox. Options can carry a leading `icon`, a muted
|
|
41
|
+
* `description` line and a `group` heading; for multi-select, compose Ark's
|
|
30
42
|
* anatomy directly in a product package rather than widening this API.
|
|
31
43
|
*
|
|
32
44
|
* The listbox renders in a portal, so it escapes ancestor `overflow: hidden`
|
|
@@ -37,12 +49,15 @@ import { Check, ChevronRight } from '../fallback-glyphs';
|
|
|
37
49
|
* assistive tech.
|
|
38
50
|
*/
|
|
39
51
|
export function Select({ items, label, placeholder, value, defaultValue, onValueChange, size = 'md', disabled, loading = false, loadingText = 'Loading…', invalid, name, className, renderItem, indicator = ChevronRight, itemIndicator = Check, 'aria-label': ariaLabel, }) {
|
|
52
|
+
// The collection holds the options in drawn order, so arrows, typeahead and
|
|
53
|
+
// the hidden native select all follow the list on screen.
|
|
54
|
+
const groups = useMemo(() => groupItems(items), [items]);
|
|
40
55
|
const collection = useMemo(() => createListCollection({
|
|
41
|
-
items,
|
|
56
|
+
items: groups.flatMap((group) => group.items),
|
|
42
57
|
itemToValue: (item) => item.value,
|
|
43
58
|
itemToString: (item) => item.label,
|
|
44
59
|
isItemDisabled: (item) => item.disabled ?? false,
|
|
45
|
-
}), [
|
|
60
|
+
}), [groups]);
|
|
46
61
|
/*
|
|
47
62
|
* A controlled value that no longer matches an option resolves to empty, so
|
|
48
63
|
* the trigger and the form agree about it.
|
|
@@ -71,6 +86,8 @@ export function Select({ items, label, placeholder, value, defaultValue, onValue
|
|
|
71
86
|
}, [defaultValue, items]);
|
|
72
87
|
const portalContainer = useContext(PortalContainerContext);
|
|
73
88
|
const handleValueChange = useCallback((details) => onValueChange?.(details.value[0]), [onValueChange]);
|
|
74
|
-
|
|
89
|
+
const renderOption = (item) => (_jsxs(ArkSelect.Item, { item: item, className: "ds-select__item", children: [_jsx(ArkSelect.ItemText, { children: renderItem ? renderItem(item) : _jsx(ItemContent, { item: item }) }), _jsx(ArkSelect.ItemIndicator, { className: "ds-select__item-indicator", children: _jsx(Icon, { source: itemIndicator, size: "sm", decorative: true }) })] }, item.value));
|
|
90
|
+
const renderGroup = (group) => group.label === undefined ? (group.items.map(renderOption)) : (_jsxs(ArkSelect.ItemGroup, { className: "ds-select__group", children: [_jsx(ArkSelect.ItemGroupLabel, { className: "ds-select__group-label", children: group.label }), group.items.map(renderOption)] }, group.label));
|
|
91
|
+
return (_jsxs(ArkSelect.Root, { collection: collection, className: cx('ds-select', `ds-select--${size}`, className), value: controlledValue, defaultValue: initialValue, onValueChange: handleValueChange, disabled: disabled || loading, invalid: invalid, name: name, positioning: { sameWidth: true }, children: [label && _jsx(ArkSelect.Label, { className: "ds-select__label", children: label }), _jsx(ArkSelect.Control, { children: _jsxs(ArkSelect.Trigger, { className: "ds-select__trigger", "aria-label": ariaLabel, "aria-busy": loading || undefined, children: [_jsx(ArkSelect.Context, { children: (select) => (_jsx(ArkSelect.ValueText, { placeholder: loading ? loadingText : placeholder, className: "ds-select__value-text", children: chosenWithIcon(select.selectedItems[0]) })) }), _jsx(ArkSelect.Indicator, { className: "ds-select__indicator", children: _jsx(Icon, { source: indicator, size: "sm", decorative: true }) })] }) }), _jsx(Portal, { container: portalContainer, children: _jsx(ArkSelect.Positioner, { children: _jsx(ArkSelect.Content, { className: "ds-select__content", children: groups.map(renderGroup) }) }) }), _jsx(ArkSelect.HiddenSelect, {})] }));
|
|
75
92
|
}
|
|
76
93
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAkB,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAkB,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAA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,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spinner/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/spinner/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* A ring with one open quarter. Button draws its own: that one sizes to
|
|
4
|
+
* the label's em and takes the label's colour, which the spinner keys
|
|
5
|
+
* (a fixed colour and three diameters) do not express. The stroke here is
|
|
6
|
+
* a tenth of the diameter so each size keeps the same proportion.
|
|
7
|
+
*/
|
|
8
|
+
.ds-spinner {
|
|
9
|
+
--_spinner-size: var(--ds-spinner-size-md);
|
|
10
|
+
|
|
11
|
+
position: relative;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
flex-shrink: 0;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
width: var(--_spinner-size);
|
|
16
|
+
height: var(--_spinner-size);
|
|
17
|
+
border: calc(var(--_spinner-size) / 10) solid var(--ds-spinner-color);
|
|
18
|
+
border-right-color: transparent;
|
|
19
|
+
border-radius: 50%;
|
|
20
|
+
animation: ds-spinner-spin 600ms linear infinite;
|
|
21
|
+
|
|
22
|
+
&.ds-spinner--sm {
|
|
23
|
+
--_spinner-size: var(--ds-spinner-size-sm);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.ds-spinner--lg {
|
|
27
|
+
--_spinner-size: var(--ds-spinner-size-lg);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes ds-spinner-spin {
|
|
32
|
+
to {
|
|
33
|
+
transform: rotate(360deg);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import './spinner.css';
|
|
3
|
+
/** The spinner's diameter: inside a control (sm), beside text (md), on its own in a region (lg). */
|
|
4
|
+
export type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface SpinnerProps extends ComponentProps<'div'> {
|
|
6
|
+
/** Defaults to `md`. */
|
|
7
|
+
size?: SpinnerSize;
|
|
8
|
+
/**
|
|
9
|
+
* What is loading, announced once as a status ("Loading goals"). Without
|
|
10
|
+
* it the spinner is hidden from assistive technology, for a region that
|
|
11
|
+
* already says it is busy (`aria-busy`) or a button that is `loading`.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The turning ring that says something is on its way.
|
|
17
|
+
*
|
|
18
|
+
* For a route or region still loading with nothing to show yet; a region
|
|
19
|
+
* that has a shape to promise uses `Skeleton` instead, and a button its own
|
|
20
|
+
* `loading`. The ring takes the spinner colour from the contract and keeps
|
|
21
|
+
* turning under `prefers-reduced-motion`, since a still ring would say the
|
|
22
|
+
* wait is over.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Spinner({ size, label, className, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,eAAe,CAAC;AAIvB,oGAAoG;AACpG,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,KAAK,CAAC;IACzD,wBAAwB;IACxB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAW,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,2CAWhF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import './spinner.css';
|
|
3
|
+
import { cx } from '../cx';
|
|
4
|
+
import { VisuallyHidden } from '../visually-hidden/visually-hidden';
|
|
5
|
+
/**
|
|
6
|
+
* The turning ring that says something is on its way.
|
|
7
|
+
*
|
|
8
|
+
* For a route or region still loading with nothing to show yet; a region
|
|
9
|
+
* that has a shape to promise uses `Skeleton` instead, and a button its own
|
|
10
|
+
* `loading`. The ring takes the spinner colour from the contract and keeps
|
|
11
|
+
* turning under `prefers-reduced-motion`, since a still ring would say the
|
|
12
|
+
* wait is over.
|
|
13
|
+
*/
|
|
14
|
+
export function Spinner({ size = 'md', label, className, ...props }) {
|
|
15
|
+
return (_jsx("div", { role: label ? 'status' : undefined, "aria-hidden": label ? undefined : 'true', className: cx('ds-spinner', `ds-spinner--${size}`, className), ...props, children: label ? _jsx(VisuallyHidden, { children: label }) : null }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/spinner/spinner.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAgBpE;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC/E,OAAO,CACL,cACE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,iBACrB,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EACvC,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,eAAe,IAAI,EAAE,EAAE,SAAS,CAAC,KACzD,KAAK,YAER,KAAK,CAAC,CAAC,CAAC,KAAC,cAAc,cAAE,KAAK,GAAkB,CAAC,CAAC,CAAC,IAAI,GACpD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sticky/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sticky/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* The inset from the edge is a private property so the scroll variant can
|
|
4
|
+
* subtract it from the viewport's height. `z-index: 40` is the `sticky`
|
|
5
|
+
* layer (ds-config/scripts/stacking.ts).
|
|
6
|
+
*/
|
|
7
|
+
.ds-sticky {
|
|
8
|
+
--_sticky-inset: 0px;
|
|
9
|
+
--_sticky-clearance: var(--ds-sticky-offset-bottom);
|
|
10
|
+
|
|
11
|
+
position: sticky;
|
|
12
|
+
z-index: 40;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
overflow-wrap: anywhere;
|
|
16
|
+
|
|
17
|
+
&.ds-sticky--top {
|
|
18
|
+
top: var(--_sticky-inset);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.ds-sticky--bottom {
|
|
22
|
+
--_sticky-clearance: var(--ds-sticky-offset-top);
|
|
23
|
+
|
|
24
|
+
bottom: var(--_sticky-inset);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.ds-sticky--top.ds-sticky--offset {
|
|
28
|
+
--_sticky-inset: var(--ds-sticky-offset-top);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.ds-sticky--bottom.ds-sticky--offset {
|
|
32
|
+
--_sticky-inset: var(--ds-sticky-offset-bottom);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
* Room for the element itself: the viewport less its inset from the
|
|
37
|
+
* edge it holds to and the chrome's clearance at the other edge.
|
|
38
|
+
*/
|
|
39
|
+
&.ds-sticky--scroll {
|
|
40
|
+
max-height: calc(100dvh - var(--_sticky-inset) - var(--_sticky-clearance));
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.ds-sticky--surface-canvas {
|
|
45
|
+
padding-block: var(--ds-sticky-padding-block);
|
|
46
|
+
background-color: var(--ds-sticky-canvas-bg);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.ds-sticky--surface-raised {
|
|
50
|
+
padding-block: var(--ds-sticky-padding-block);
|
|
51
|
+
background-color: var(--ds-sticky-raised-bg);
|
|
52
|
+
box-shadow: var(--ds-sticky-raised-shadow);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.ds-sticky--surface-raised.ds-sticky--top {
|
|
56
|
+
border-bottom: 1px solid var(--ds-sticky-raised-border);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.ds-sticky--surface-raised.ds-sticky--bottom {
|
|
60
|
+
border-top: 1px solid var(--ds-sticky-raised-border);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
* Below the step it sticks from, the element stays in the flow. The
|
|
66
|
+
* breakpoints are the viewport tokens, written as literals because
|
|
67
|
+
* `@media` cannot read a custom property (`check:breakpoints`).
|
|
68
|
+
*/
|
|
69
|
+
@media (width < 40rem) {
|
|
70
|
+
.ds-sticky--from-sm {
|
|
71
|
+
position: static;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (width < 48rem) {
|
|
76
|
+
.ds-sticky--from-md {
|
|
77
|
+
position: static;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (width < 64rem) {
|
|
82
|
+
.ds-sticky--from-lg {
|
|
83
|
+
position: static;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (width < 80rem) {
|
|
88
|
+
.ds-sticky--from-xl {
|
|
89
|
+
position: static;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|