@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
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,EACtB,GAAG,IAAI,WAAW,GACnB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { Breakpoint, ContainerProps, ContentWidth, GridColumns, GridProps, InlineProps, LayoutAlign, LayoutGap, LayoutJustify, LayoutPadding, Responsive, StackProps, } from './layout';
|
|
2
|
-
export { Container, Grid, Inline, Stack } from './layout';
|
|
1
|
+
export type { Breakpoint, ContainerAlign, ContainerProps, ContentWidth, ControlWidth, FrameProps, FrameWidth, GridColumns, GridProps, InlineProps, LayoutAlign, LayoutGap, LayoutJustify, LayoutPadding, LayoutSurface, Responsive, SpacerProps, StackProps, } from './layout';
|
|
2
|
+
export { Container, Frame, Grid, Inline, Spacer, Stack } from './layout';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,aAAa,EACb,UAAU,EACV,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/layout/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Container, Grid, Inline, Stack } from './layout';
|
|
1
|
+
export { Container, Frame, Grid, Inline, Spacer, Stack } from './layout';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/layout/layout.css
CHANGED
|
@@ -72,6 +72,35 @@
|
|
|
72
72
|
&.ds-layout--justify-between {
|
|
73
73
|
justify-content: space-between;
|
|
74
74
|
}
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
* A surface sizes from its border box, so a padded panel held to a
|
|
78
|
+
* width or a column stays that wide with the border and inset inside.
|
|
79
|
+
*/
|
|
80
|
+
&.ds-layout--surface-outlined,
|
|
81
|
+
&.ds-layout--surface-subtle,
|
|
82
|
+
&.ds-layout--surface-raised,
|
|
83
|
+
&.ds-layout--surface-dashed {
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
border-radius: var(--ds-layout-surface-radius);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&.ds-layout--surface-outlined {
|
|
89
|
+
border: 1px solid var(--ds-layout-surface-border);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.ds-layout--surface-subtle {
|
|
93
|
+
background-color: var(--ds-layout-surface-subtle-bg);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.ds-layout--surface-raised {
|
|
97
|
+
border: 1px solid var(--ds-layout-surface-border);
|
|
98
|
+
background-color: var(--ds-layout-surface-raised-bg);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&.ds-layout--surface-dashed {
|
|
102
|
+
border: 2px dashed var(--ds-layout-surface-border);
|
|
103
|
+
}
|
|
75
104
|
}
|
|
76
105
|
|
|
77
106
|
.ds-stack {
|
|
@@ -79,6 +108,39 @@
|
|
|
79
108
|
flex-direction: column;
|
|
80
109
|
}
|
|
81
110
|
|
|
111
|
+
/*
|
|
112
|
+
* Divided: a hairline on every child after the first, with the gap above
|
|
113
|
+
* the line as the stack's own gap and the same distance below it as the
|
|
114
|
+
* child's inset, so the line sits in the middle. The distance is a
|
|
115
|
+
* private property the stack writes per gap step rather than the shared
|
|
116
|
+
* gap, so a layout primitive that is itself a child reads the dividing
|
|
117
|
+
* stack's step, not its own.
|
|
118
|
+
*/
|
|
119
|
+
.ds-stack--divided {
|
|
120
|
+
--_divided-gap: var(--ds-layout-gap);
|
|
121
|
+
|
|
122
|
+
&.ds-layout--gap-none {
|
|
123
|
+
--_divided-gap: 0px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&.ds-layout--gap-tight {
|
|
127
|
+
--_divided-gap: var(--ds-layout-gap-tight);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.ds-layout--gap-relaxed {
|
|
131
|
+
--_divided-gap: var(--ds-layout-gap-relaxed);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.ds-layout--gap-loose {
|
|
135
|
+
--_divided-gap: var(--ds-layout-gap-loose);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
& > * + * {
|
|
139
|
+
border-top: 1px solid var(--ds-divider-color);
|
|
140
|
+
padding-top: var(--_divided-gap);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
82
144
|
.ds-inline {
|
|
83
145
|
display: flex;
|
|
84
146
|
flex-direction: row;
|
|
@@ -181,5 +243,77 @@
|
|
|
181
243
|
&.ds-container--padding-relaxed {
|
|
182
244
|
padding-inline: var(--ds-layout-padding-relaxed);
|
|
183
245
|
}
|
|
246
|
+
|
|
247
|
+
&.ds-container--align-start {
|
|
248
|
+
margin-inline-start: 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/*
|
|
253
|
+
* A frame's width is the private property the component writes per
|
|
254
|
+
* breakpoint, each already carried forward, read by the media queries the
|
|
255
|
+
* way Grid's column counts are. The control steps are read from the
|
|
256
|
+
* contract here, once, and the component names the private step, so the
|
|
257
|
+
* stylesheet stays the only reader of `--ds-*`. `max-width: 100%` keeps a
|
|
258
|
+
* control step from pushing past a row narrower than the step;
|
|
259
|
+
* `min-width: 0` lets the frame shrink below its content in a row that
|
|
260
|
+
* stays on one line.
|
|
261
|
+
*/
|
|
262
|
+
.ds-frame {
|
|
263
|
+
--_frame-control-sm: var(--ds-layout-control-sm);
|
|
264
|
+
--_frame-control-md: var(--ds-layout-control-md);
|
|
265
|
+
--_frame-control-lg: var(--ds-layout-control-lg);
|
|
266
|
+
|
|
267
|
+
box-sizing: border-box;
|
|
268
|
+
min-width: 0;
|
|
269
|
+
max-width: 100%;
|
|
270
|
+
|
|
271
|
+
&.ds-frame--grow {
|
|
272
|
+
flex-grow: 1;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&.ds-frame--no-shrink {
|
|
276
|
+
flex-shrink: 0;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/*
|
|
281
|
+
* Flat, not nested under `.ds-frame`: the media blocks below are flat too,
|
|
282
|
+
* and at a higher specificity this rule would outrank every one of them.
|
|
283
|
+
*/
|
|
284
|
+
.ds-frame--width {
|
|
285
|
+
--_frame-width: var(--_frame-width-base);
|
|
286
|
+
|
|
287
|
+
width: var(--_frame-width);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
@media (width >= 40rem) {
|
|
291
|
+
.ds-frame--width {
|
|
292
|
+
--_frame-width: var(--_frame-width-sm);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@media (width >= 48rem) {
|
|
297
|
+
.ds-frame--width {
|
|
298
|
+
--_frame-width: var(--_frame-width-md);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@media (width >= 64rem) {
|
|
303
|
+
.ds-frame--width {
|
|
304
|
+
--_frame-width: var(--_frame-width-lg);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@media (width >= 80rem) {
|
|
309
|
+
.ds-frame--width {
|
|
310
|
+
--_frame-width: var(--_frame-width-xl);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Takes the room between its neighbours; nothing is drawn. */
|
|
315
|
+
.ds-spacer {
|
|
316
|
+
flex: 1 1 0;
|
|
317
|
+
align-self: stretch;
|
|
184
318
|
}
|
|
185
319
|
}
|
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
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E,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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UAAU,CAAC,CAAC;QACvC,IAAI,IAAI;YAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC;IAC/C,CAAC;IACD,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CAAC,EACpB,KAAK,EACL,IAAI,GAAG,KAAK,EACZ,MAAM,GAAG,IAAI,EACb,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACG;IACX,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,UAAU,EACV,KAAK,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"}
|