@manakind/ui-core 0.22.0 → 0.23.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/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/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/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
package/dist/layout/layout.d.ts
CHANGED
|
@@ -18,6 +18,15 @@ export type ContentWidth = 'sm' | 'md' | 'lg' | 'xl';
|
|
|
18
18
|
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';
|
|
19
19
|
/** A value per breakpoint, from the narrowest viewport (`base`) up. */
|
|
20
20
|
export type Responsive<T> = Partial<Record<'base' | Breakpoint, T>>;
|
|
21
|
+
/** The width a control takes in a row when it is not left to the row: the semantic `control.width.*` steps. */
|
|
22
|
+
export type ControlWidth = 'sm' | 'md' | 'lg';
|
|
23
|
+
/**
|
|
24
|
+
* The surface drawn behind a layout primitive's children. `outlined` is a
|
|
25
|
+
* hairline border; `subtle` a tinted fill; `raised` the raised fill with a
|
|
26
|
+
* border; `dashed` a dashed border for a drop target or an empty slot. All
|
|
27
|
+
* take the surface radius; pair with `padding` for the inset.
|
|
28
|
+
*/
|
|
29
|
+
export type LayoutSurface = 'outlined' | 'subtle' | 'raised' | 'dashed';
|
|
21
30
|
interface LayoutModifiers {
|
|
22
31
|
/** Space between the children. Defaults to `normal`. */
|
|
23
32
|
gap?: LayoutGap;
|
|
@@ -27,8 +36,16 @@ interface LayoutModifiers {
|
|
|
27
36
|
align?: LayoutAlign;
|
|
28
37
|
/** Main-axis distribution of the children. */
|
|
29
38
|
justify?: LayoutJustify;
|
|
39
|
+
/** A surface behind the children: a row, a panel, a drop target. */
|
|
40
|
+
surface?: LayoutSurface;
|
|
30
41
|
}
|
|
31
42
|
export interface StackProps extends ComponentProps<typeof ark.div>, LayoutModifiers {
|
|
43
|
+
/**
|
|
44
|
+
* A hairline between each pair of children, centred in the gap. A list of
|
|
45
|
+
* rows that read as one column: the quarters of a review, a settings
|
|
46
|
+
* dialog's sections.
|
|
47
|
+
*/
|
|
48
|
+
divided?: boolean;
|
|
32
49
|
}
|
|
33
50
|
/**
|
|
34
51
|
* A column of children with one gap between them.
|
|
@@ -38,7 +55,7 @@ export interface StackProps extends ComponentProps<typeof ark.div>, LayoutModifi
|
|
|
38
55
|
* element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic
|
|
39
56
|
* step, so a product never writes a number.
|
|
40
57
|
*/
|
|
41
|
-
export declare function Stack({ gap, padding, align, justify, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare function Stack({ gap, padding, align, justify, surface, divided, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
42
59
|
export interface InlineProps extends ComponentProps<typeof ark.div>, LayoutModifiers {
|
|
43
60
|
/**
|
|
44
61
|
* Whether the children wrap onto new lines when the row runs out of room.
|
|
@@ -54,7 +71,7 @@ export interface InlineProps extends ComponentProps<typeof ark.div>, LayoutModif
|
|
|
54
71
|
* default, so a long label takes a line of its own instead of squeezing its
|
|
55
72
|
* neighbours. Renders a `div`; pass `asChild` to lay out your own element.
|
|
56
73
|
*/
|
|
57
|
-
export declare function Inline({ gap, padding, align, justify, wrap, className, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
export declare function Inline({ gap, padding, align, justify, surface, wrap, className, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
|
|
58
75
|
/** How many columns a grid has; `Responsive` for a count per breakpoint. */
|
|
59
76
|
export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6;
|
|
60
77
|
export interface GridProps extends ComponentProps<typeof ark.div>, Omit<LayoutModifiers, 'justify'> {
|
|
@@ -79,7 +96,9 @@ export interface GridProps extends ComponentProps<typeof ark.div>, Omit<LayoutMo
|
|
|
79
96
|
* height of their tallest child; pass `align="start"` to stop short cards
|
|
80
97
|
* stretching. Renders a `div`; pass `asChild` to lay out your own element.
|
|
81
98
|
*/
|
|
82
|
-
export declare function Grid({ columns, minColumnWidth, gap, padding, align, className, style, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
export declare function Grid({ columns, minColumnWidth, gap, padding, align, surface, className, style, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
/** Where a column sits in a wider parent: centred, or at the start. */
|
|
101
|
+
export type ContainerAlign = 'center' | 'start';
|
|
83
102
|
export interface ContainerProps extends ComponentProps<typeof ark.div> {
|
|
84
103
|
/**
|
|
85
104
|
* Where the content stops growing: a content width step. Defaults to `xl`,
|
|
@@ -92,6 +111,12 @@ export interface ContainerProps extends ComponentProps<typeof ark.div> {
|
|
|
92
111
|
* adds vertical rhythm of its own. Defaults to `none`.
|
|
93
112
|
*/
|
|
94
113
|
padding?: LayoutPadding;
|
|
114
|
+
/**
|
|
115
|
+
* Where the column sits when its parent is wider: centred by default, or
|
|
116
|
+
* at the start for a width held inside a left-aligned page (a detail's
|
|
117
|
+
* one card, a tab list held to a control's width).
|
|
118
|
+
*/
|
|
119
|
+
align?: ContainerAlign;
|
|
95
120
|
}
|
|
96
121
|
/**
|
|
97
122
|
* A centred column no wider than a content width step.
|
|
@@ -100,6 +125,43 @@ export interface ContainerProps extends ComponentProps<typeof ark.div> {
|
|
|
100
125
|
* width in every product. Renders a `div`; pass `asChild` to make your own
|
|
101
126
|
* element the container (`<Container asChild><main>…</main></Container>`).
|
|
102
127
|
*/
|
|
103
|
-
export declare function Container({ size, padding, className, children, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
128
|
+
export declare function Container({ size, padding, align, className, children, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
129
|
+
/** A frame's width: a control step, or the whole row. */
|
|
130
|
+
export type FrameWidth = ControlWidth | 'full';
|
|
131
|
+
export interface FrameProps extends ComponentProps<typeof ark.div> {
|
|
132
|
+
/**
|
|
133
|
+
* How wide the frame is: a control width step, `full` for the whole row,
|
|
134
|
+
* or one per breakpoint (`{ base: 'full', sm: 'md' }`: the whole row on a
|
|
135
|
+
* phone, a filter's width from `sm`). Without it the frame is as wide as
|
|
136
|
+
* its content.
|
|
137
|
+
*/
|
|
138
|
+
width?: FrameWidth | Responsive<FrameWidth>;
|
|
139
|
+
/** Whether the frame takes the room left in its row or column. */
|
|
140
|
+
grow?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Whether the frame gives up width when its row runs short. Defaults to
|
|
143
|
+
* `true`; a logo or a glyph that must keep its size passes `false`.
|
|
144
|
+
*/
|
|
145
|
+
shrink?: boolean;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* A sized slot in a row or column.
|
|
149
|
+
*
|
|
150
|
+
* What a child of a Stack or Inline says about its own size when the row
|
|
151
|
+
* should not decide: a filter select held to a control width, a search
|
|
152
|
+
* field that takes the rest of the toolbar (`grow`), a logo that never
|
|
153
|
+
* squeezes (`shrink={false}`), an alert that takes a line of its own in a
|
|
154
|
+
* wrapping row (`width="full"`). Renders a `div`; pass `asChild` to size
|
|
155
|
+
* your own element.
|
|
156
|
+
*/
|
|
157
|
+
export declare function Frame({ width, grow, shrink, className, style, children, ...props }: FrameProps): import("react/jsx-runtime").JSX.Element;
|
|
158
|
+
export type SpacerProps = ComponentProps<'div'>;
|
|
159
|
+
/**
|
|
160
|
+
* The room between two groups in a row or column: everything after it is
|
|
161
|
+
* pushed to the far end. A form's delete button at the start with its
|
|
162
|
+
* save and cancel at the end; a row's controls pushed past its text.
|
|
163
|
+
* Takes no part in the accessibility tree.
|
|
164
|
+
*/
|
|
165
|
+
export declare function Spacer({ className, ...props }: SpacerProps): import("react/jsx-runtime").JSX.Element;
|
|
104
166
|
export {};
|
|
105
167
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,cAAc,CAAC;AAGtB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1E,2FAA2F;AAC3F,MAAM,MAAM,aAAa,GAAG,MAAM,GA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E,cAAc,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAW,EACX,OAAgB,EAChB,KAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,2CAehB;AAED,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;IAChE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5C,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA+BD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,IAAY,EACZ,MAAa,EACb,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,2CAgBZ;AAED,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAE1D"}
|
package/dist/layout/layout.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ark } from '@ark-ui/react/factory';
|
|
3
3
|
import './layout.css';
|
|
4
4
|
import { cx } from '../cx';
|
|
5
|
-
function modifierClasses({ gap = 'normal', padding = 'none', align, justify }) {
|
|
6
|
-
return cx('ds-layout', gap !== 'normal' && `ds-layout--gap-${gap}`, padding !== 'none' && `ds-layout--padding-${padding}`, align && `ds-layout--align-${align}`, justify && `ds-layout--justify-${justify}`);
|
|
5
|
+
function modifierClasses({ gap = 'normal', padding = 'none', align, justify, surface, }) {
|
|
6
|
+
return cx('ds-layout', gap !== 'normal' && `ds-layout--gap-${gap}`, padding !== 'none' && `ds-layout--padding-${padding}`, align && `ds-layout--align-${align}`, justify && `ds-layout--justify-${justify}`, surface && `ds-layout--surface-${surface}`);
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* A column of children with one gap between them.
|
|
@@ -13,8 +13,8 @@ function modifierClasses({ gap = 'normal', padding = 'none', align, justify }) {
|
|
|
13
13
|
* element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic
|
|
14
14
|
* step, so a product never writes a number.
|
|
15
15
|
*/
|
|
16
|
-
export function Stack({ gap, padding, align, justify, className, children, ...props }) {
|
|
17
|
-
return (_jsx(ark.div, { className: cx('ds-stack', modifierClasses({ gap, padding, align, justify }), className), ...props, children: children }));
|
|
16
|
+
export function Stack({ gap, padding, align, justify, surface, divided = false, className, children, ...props }) {
|
|
17
|
+
return (_jsx(ark.div, { className: cx('ds-stack', divided && 'ds-stack--divided', modifierClasses({ gap, padding, align, justify, surface }), className), ...props, children: children }));
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* A row of children with one gap between them, centred on the cross axis.
|
|
@@ -23,8 +23,8 @@ export function Stack({ gap, padding, align, justify, className, children, ...pr
|
|
|
23
23
|
* default, so a long label takes a line of its own instead of squeezing its
|
|
24
24
|
* neighbours. Renders a `div`; pass `asChild` to lay out your own element.
|
|
25
25
|
*/
|
|
26
|
-
export function Inline({ gap, padding, align = 'center', justify, wrap = true, className, children, ...props }) {
|
|
27
|
-
return (_jsx(ark.div, { className: cx('ds-inline', !wrap && 'ds-inline--nowrap', modifierClasses({ gap, padding, align, justify }), className), ...props, children: children }));
|
|
26
|
+
export function Inline({ gap, padding, align = 'center', justify, surface, wrap = true, className, children, ...props }) {
|
|
27
|
+
return (_jsx(ark.div, { className: cx('ds-inline', !wrap && 'ds-inline--nowrap', modifierClasses({ gap, padding, align, justify, surface }), className), ...props, children: children }));
|
|
28
28
|
}
|
|
29
29
|
const COLUMN_VARIABLES = {
|
|
30
30
|
base: '--_grid-columns-base',
|
|
@@ -61,8 +61,8 @@ function gridColumnStyle(columns) {
|
|
|
61
61
|
* height of their tallest child; pass `align="start"` to stop short cards
|
|
62
62
|
* stretching. Renders a `div`; pass `asChild` to lay out your own element.
|
|
63
63
|
*/
|
|
64
|
-
export function Grid({ columns, minColumnWidth = 'sm', gap, padding, align, className, style, children, ...props }) {
|
|
65
|
-
return (_jsx(ark.div, { className: cx('ds-grid', columns ? 'ds-grid--columns' : `ds-grid--fill-${minColumnWidth}`, modifierClasses({ gap, padding, align }), className), style: columns ? { ...gridColumnStyle(columns), ...style } : style, ...props, children: children }));
|
|
64
|
+
export function Grid({ columns, minColumnWidth = 'sm', gap, padding, align, surface, className, style, children, ...props }) {
|
|
65
|
+
return (_jsx(ark.div, { className: cx('ds-grid', columns ? 'ds-grid--columns' : `ds-grid--fill-${minColumnWidth}`, modifierClasses({ gap, padding, align, surface }), className), style: columns ? { ...gridColumnStyle(columns), ...style } : style, ...props, children: children }));
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
68
|
* A centred column no wider than a content width step.
|
|
@@ -71,7 +71,55 @@ export function Grid({ columns, minColumnWidth = 'sm', gap, padding, align, clas
|
|
|
71
71
|
* width in every product. Renders a `div`; pass `asChild` to make your own
|
|
72
72
|
* element the container (`<Container asChild><main>…</main></Container>`).
|
|
73
73
|
*/
|
|
74
|
-
export function Container({ size = 'xl', padding = 'none', className, children, ...props }) {
|
|
75
|
-
return (_jsx(ark.div, { className: cx('ds-container', `ds-container--${size}`, padding !== 'none' && `ds-container--padding-${padding}`, className), ...props, children: children }));
|
|
74
|
+
export function Container({ size = 'xl', padding = 'none', align = 'center', className, children, ...props }) {
|
|
75
|
+
return (_jsx(ark.div, { className: cx('ds-container', `ds-container--${size}`, padding !== 'none' && `ds-container--padding-${padding}`, align === 'start' && 'ds-container--align-start', className), ...props, children: children }));
|
|
76
|
+
}
|
|
77
|
+
const WIDTH_VARIABLES = {
|
|
78
|
+
base: '--_frame-width-base',
|
|
79
|
+
sm: '--_frame-width-sm',
|
|
80
|
+
md: '--_frame-width-md',
|
|
81
|
+
lg: '--_frame-width-lg',
|
|
82
|
+
xl: '--_frame-width-xl',
|
|
83
|
+
};
|
|
84
|
+
const widthValue = (width) => width === 'full' ? '100%' : `var(--_frame-control-${width})`;
|
|
85
|
+
/**
|
|
86
|
+
* The width as the private properties `layout.css` reads, one per
|
|
87
|
+
* breakpoint, every one written and carried forward from the narrower
|
|
88
|
+
* steps, for the reason {@link gridColumnStyle} gives: a step left unset
|
|
89
|
+
* would inherit from a frame further out.
|
|
90
|
+
*/
|
|
91
|
+
function frameWidthStyle(width) {
|
|
92
|
+
const perBreakpoint = typeof width === 'string' ? { base: width } : width;
|
|
93
|
+
const style = {};
|
|
94
|
+
let current = 'auto';
|
|
95
|
+
for (const breakpoint of BREAKPOINTS_ASCENDING) {
|
|
96
|
+
const step = perBreakpoint[breakpoint];
|
|
97
|
+
if (step)
|
|
98
|
+
current = widthValue(step);
|
|
99
|
+
style[WIDTH_VARIABLES[breakpoint]] = current;
|
|
100
|
+
}
|
|
101
|
+
return style;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A sized slot in a row or column.
|
|
105
|
+
*
|
|
106
|
+
* What a child of a Stack or Inline says about its own size when the row
|
|
107
|
+
* should not decide: a filter select held to a control width, a search
|
|
108
|
+
* field that takes the rest of the toolbar (`grow`), a logo that never
|
|
109
|
+
* squeezes (`shrink={false}`), an alert that takes a line of its own in a
|
|
110
|
+
* wrapping row (`width="full"`). Renders a `div`; pass `asChild` to size
|
|
111
|
+
* your own element.
|
|
112
|
+
*/
|
|
113
|
+
export function Frame({ width, grow = false, shrink = true, className, style, children, ...props }) {
|
|
114
|
+
return (_jsx(ark.div, { className: cx('ds-frame', width && 'ds-frame--width', grow && 'ds-frame--grow', !shrink && 'ds-frame--no-shrink', className), style: width ? { ...frameWidthStyle(width), ...style } : style, ...props, children: children }));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The room between two groups in a row or column: everything after it is
|
|
118
|
+
* pushed to the far end. A form's delete button at the start with its
|
|
119
|
+
* save and cancel at the end; a row's controls pushed past its text.
|
|
120
|
+
* Takes no part in the accessibility tree.
|
|
121
|
+
*/
|
|
122
|
+
export function Spacer({ className, ...props }) {
|
|
123
|
+
return _jsx("div", { "aria-hidden": "true", className: cx('ds-spacer', className), ...props });
|
|
76
124
|
}
|
|
77
125
|
//# sourceMappingURL=layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/layout/layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkD3B,SAAS,eAAe,CAAC,EACvB,GAAG,GAAG,QAAQ,EACd,OAAO,GAAG,MAAM,EAChB,KAAK,EACL,OAAO,EACP,OAAO,GACS;IAChB,OAAO,EAAE,CACP,WAAW,EACX,GAAG,KAAK,QAAQ,IAAI,kBAAkB,GAAG,EAAE,EAC3C,OAAO,KAAK,MAAM,IAAI,sBAAsB,OAAO,EAAE,EACrD,KAAK,IAAI,oBAAoB,KAAK,EAAE,EACpC,OAAO,IAAI,sBAAsB,OAAO,EAAE,EAC1C,OAAO,IAAI,sBAAsB,OAAO,EAAE,CAC3C,CAAC;AACJ,CAAC;AAWD;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,GAAG,EACH,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP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AK,IAAI,iBAAiB,EAC1B,IAAI,IAAI,gBAAgB,EACxB,CAAC,MAAM,IAAI,qBAAqB,EAChC,SAAS,CACV,EACD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,KAC1D,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAe;IACzD,OAAO,6BAAiB,MAAM,EAAC,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/link/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* One colour, at rest and under the pointer: the link colour clears AA on
|
|
4
|
+
* the card and the canvas, and a lighter hover step would not. The hover
|
|
5
|
+
* is the underline thickening instead.
|
|
6
|
+
*/
|
|
7
|
+
.ds-link {
|
|
8
|
+
color: var(--ds-link-text);
|
|
9
|
+
font: inherit;
|
|
10
|
+
text-decoration: underline;
|
|
11
|
+
text-decoration-thickness: 1px;
|
|
12
|
+
text-underline-offset: 0.2em;
|
|
13
|
+
border-radius: 2px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
overflow-wrap: anywhere;
|
|
16
|
+
transition: text-decoration-thickness 150ms cubic-bezier(0, 0, 0.2, 1);
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
text-decoration-thickness: 2px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.ds-link--tone-inherit {
|
|
23
|
+
color: inherit;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:focus-visible {
|
|
27
|
+
outline: 2px solid var(--ds-link-focus-ring);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.ds-link--underline-hover {
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
|
|
34
|
+
&:hover,
|
|
35
|
+
&:focus-visible {
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './link.css';
|
|
4
|
+
/** The link's colour: the link colour, or the text it sits in. */
|
|
5
|
+
export type LinkTone = 'default' | 'inherit';
|
|
6
|
+
/** When the link is underlined. `always` is the default, since colour alone does not mark a link in running text. */
|
|
7
|
+
export type LinkUnderline = 'always' | 'hover';
|
|
8
|
+
export interface LinkProps extends ComponentProps<typeof ark.a> {
|
|
9
|
+
/** Defaults to `default`. */
|
|
10
|
+
tone?: LinkTone;
|
|
11
|
+
/**
|
|
12
|
+
* Defaults to `always`. `hover` is for a link whose place already says it
|
|
13
|
+
* is one, such as a row's title in a list, never for a link in a sentence.
|
|
14
|
+
*/
|
|
15
|
+
underline?: LinkUnderline;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A text link: a destination in a sentence, a list or a footnote.
|
|
19
|
+
*
|
|
20
|
+
* Renders an `a`; for a router's link, pass `asChild` and the link as the
|
|
21
|
+
* only child, which keeps its `href`, prefetch and handlers
|
|
22
|
+
* (`<Link asChild><NextLink href="/goals">Goals</NextLink></Link>`). An
|
|
23
|
+
* action that navigates and looks like a button is `Button asChild` instead;
|
|
24
|
+
* a card's one destination is `CardLink`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Link({ tone, underline, className, children, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,YAAY,CAAC;AAGpB,kEAAkE;AAClE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7C,qHAAqH;AACrH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC7D,6BAA6B;IAC7B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAgB,EAChB,SAAoB,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,2CAcX"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './link.css';
|
|
4
|
+
import { cx } from '../cx';
|
|
5
|
+
/**
|
|
6
|
+
* A text link: a destination in a sentence, a list or a footnote.
|
|
7
|
+
*
|
|
8
|
+
* Renders an `a`; for a router's link, pass `asChild` and the link as the
|
|
9
|
+
* only child, which keeps its `href`, prefetch and handlers
|
|
10
|
+
* (`<Link asChild><NextLink href="/goals">Goals</NextLink></Link>`). An
|
|
11
|
+
* action that navigates and looks like a button is `Button asChild` instead;
|
|
12
|
+
* a card's one destination is `CardLink`.
|
|
13
|
+
*/
|
|
14
|
+
export function Link({ tone = 'default', underline = 'always', className, children, ...props }) {
|
|
15
|
+
return (_jsx(ark.a, { className: cx('ds-link', tone !== 'default' && `ds-link--tone-${tone}`, underline !== 'always' && `ds-link--underline-${underline}`, className), ...props, children: children }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/link/link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAkB3B;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,QAAQ,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACE;IACV,OAAO,CACL,KAAC,GAAG,CAAC,CAAC,IACJ,SAAS,EAAE,EAAE,CACX,SAAS,EACT,IAAI,KAAK,SAAS,IAAI,iBAAiB,IAAI,EAAE,EAC7C,SAAS,KAAK,QAAQ,IAAI,sBAAsB,SAAS,EAAE,EAC3D,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACH,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scroll-area/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scroll-area/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* `min-height: 0` / `min-width: 0` let the box shrink below its content
|
|
4
|
+
* inside a flex or grid parent, which is what makes the content scroll
|
|
5
|
+
* instead of the parent growing. A sideways scroller hides the other
|
|
6
|
+
* axis, as the long-words rule asks of every one.
|
|
7
|
+
*/
|
|
8
|
+
.ds-scroll-area {
|
|
9
|
+
min-width: 0;
|
|
10
|
+
min-height: 0;
|
|
11
|
+
|
|
12
|
+
&.ds-scroll-area--y {
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.ds-scroll-area--x {
|
|
17
|
+
overflow-x: auto;
|
|
18
|
+
overflow-y: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:focus-visible {
|
|
22
|
+
outline: 2px solid var(--ds-link-focus-ring);
|
|
23
|
+
outline-offset: 2px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './scroll-area.css';
|
|
4
|
+
/** The axis a scroll area scrolls along. */
|
|
5
|
+
export type ScrollAxis = 'x' | 'y';
|
|
6
|
+
export interface ScrollAreaProps extends ComponentProps<typeof ark.div> {
|
|
7
|
+
/** `y` (the default) scrolls a column that outgrows its box; `x` a row that outgrows its width. */
|
|
8
|
+
axis?: ScrollAxis;
|
|
9
|
+
/**
|
|
10
|
+
* The region's name. A scroller with nothing focusable inside cannot be
|
|
11
|
+
* reached from the keyboard, so naming it makes it a focusable region
|
|
12
|
+
* that the arrow keys scroll; leave it out when a control inside takes
|
|
13
|
+
* focus already.
|
|
14
|
+
*/
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A box whose content scrolls inside it instead of widening the page.
|
|
19
|
+
*
|
|
20
|
+
* A tree or a grid wider than its card scrolls sideways; a list that must
|
|
21
|
+
* not outgrow its panel scrolls down. The box is sized by its parent (a
|
|
22
|
+
* dialog body, a popover, a Frame): the scroll area only keeps its content
|
|
23
|
+
* inside. Renders a `div`; pass `asChild` to scroll your own element.
|
|
24
|
+
*/
|
|
25
|
+
export declare function ScrollArea({ axis, label, className, children, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../src/scroll-area/scroll-area.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,mBAAmB,CAAC;AAG3B,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC;AAEnC,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;IACrE,mGAAmG;IACnG,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAU,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAY/F"}
|
|
@@ -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,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,GA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'../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,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAI,GAAG,IAAI,EACX,GAAG,GAAG,OAAO,EACb,OAAO,GAAG,SAAS,EACnB,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACL;IAClB,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE7C;;;;;;;;;OASG;IACH,MAAM,iBAAiB,GAAG,CAAC,OAAiC,EAAE,EAAE;QAC9D,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI;YAAE,aAAa,EAAE,CAAC,OAAO,CAAC,KA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