@manakind/ui-core 0.18.0 → 0.20.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 +30 -2
- package/dist/avatar/avatar.css +42 -0
- package/dist/avatar/avatar.css.d.ts +2 -0
- package/dist/avatar/avatar.d.ts +55 -0
- package/dist/avatar/avatar.d.ts.map +1 -0
- package/dist/avatar/avatar.js +41 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +3 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/centered-layout/centered-layout.css +36 -0
- package/dist/centered-layout/centered-layout.css.d.ts +2 -0
- package/dist/centered-layout/centered-layout.d.ts +18 -0
- package/dist/centered-layout/centered-layout.d.ts.map +1 -0
- package/dist/centered-layout/centered-layout.js +16 -0
- package/dist/centered-layout/centered-layout.js.map +1 -0
- package/dist/centered-layout/index.d.ts +3 -0
- package/dist/centered-layout/index.d.ts.map +1 -0
- package/dist/centered-layout/index.js +2 -0
- package/dist/centered-layout/index.js.map +1 -0
- package/dist/divider/divider.css +18 -0
- package/dist/divider/divider.css.d.ts +2 -0
- package/dist/divider/divider.d.ts +26 -0
- package/dist/divider/divider.d.ts.map +1 -0
- package/dist/divider/divider.js +15 -0
- package/dist/divider/divider.js.map +1 -0
- package/dist/divider/index.d.ts +3 -0
- package/dist/divider/index.d.ts.map +1 -0
- package/dist/divider/index.js +2 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/empty-state/empty-state.css +37 -0
- package/dist/empty-state/empty-state.css.d.ts +2 -0
- package/dist/empty-state/empty-state.d.ts +26 -0
- package/dist/empty-state/empty-state.d.ts.map +1 -0
- package/dist/empty-state/empty-state.js +16 -0
- package/dist/empty-state/empty-state.js.map +1 -0
- package/dist/empty-state/index.d.ts +3 -0
- package/dist/empty-state/index.d.ts.map +1 -0
- package/dist/empty-state/index.js +2 -0
- package/dist/empty-state/index.js.map +1 -0
- package/dist/form-layout/form-layout.css +18 -0
- package/dist/form-layout/form-layout.css.d.ts +2 -0
- package/dist/form-layout/form-layout.d.ts +21 -0
- package/dist/form-layout/form-layout.d.ts.map +1 -0
- package/dist/form-layout/form-layout.js +24 -0
- package/dist/form-layout/form-layout.js.map +1 -0
- package/dist/form-layout/index.d.ts +3 -0
- package/dist/form-layout/index.d.ts.map +1 -0
- package/dist/form-layout/index.js +2 -0
- package/dist/form-layout/index.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/layout/layout.css +185 -0
- package/dist/layout/layout.css.d.ts +2 -0
- package/dist/layout/layout.d.ts +105 -0
- package/dist/layout/layout.d.ts.map +1 -0
- package/dist/layout/layout.js +77 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/menu/action-menu.d.ts +120 -0
- package/dist/menu/action-menu.d.ts.map +1 -0
- package/dist/menu/action-menu.js +80 -0
- package/dist/menu/action-menu.js.map +1 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +1 -0
- package/dist/menu/index.js.map +1 -1
- package/dist/menu/menu.css +62 -8
- package/dist/menu/menu.d.ts +1 -1
- package/dist/menu/menu.d.ts.map +1 -1
- package/dist/menu/menu.js +1 -1
- package/dist/menu/menu.js.map +1 -1
- package/dist/page-layout/index.d.ts +3 -0
- package/dist/page-layout/index.d.ts.map +1 -0
- package/dist/page-layout/index.js +2 -0
- package/dist/page-layout/index.js.map +1 -0
- package/dist/page-layout/page-layout.css +81 -0
- package/dist/page-layout/page-layout.css.d.ts +2 -0
- package/dist/page-layout/page-layout.d.ts +43 -0
- package/dist/page-layout/page-layout.d.ts.map +1 -0
- package/dist/page-layout/page-layout.js +42 -0
- package/dist/page-layout/page-layout.js.map +1 -0
- package/dist/section/index.d.ts +3 -0
- package/dist/section/index.d.ts.map +1 -0
- package/dist/section/index.js +2 -0
- package/dist/section/index.js.map +1 -0
- package/dist/section/section.css +31 -0
- package/dist/section/section.css.d.ts +2 -0
- package/dist/section/section.d.ts +31 -0
- package/dist/section/section.d.ts.map +1 -0
- package/dist/section/section.js +19 -0
- package/dist/section/section.js.map +1 -0
- package/dist/show/index.d.ts +3 -0
- package/dist/show/index.d.ts.map +1 -0
- package/dist/show/index.js +2 -0
- package/dist/show/index.js.map +1 -0
- package/dist/show/show.css +67 -0
- package/dist/show/show.css.d.ts +2 -0
- package/dist/show/show.d.ts +36 -0
- package/dist/show/show.d.ts.map +1 -0
- package/dist/show/show.js +23 -0
- package/dist/show/show.js.map +1 -0
- package/dist/skeleton/index.d.ts +3 -0
- package/dist/skeleton/index.d.ts.map +1 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/skeleton/skeleton.css +36 -0
- package/dist/skeleton/skeleton.css.d.ts +2 -0
- package/dist/skeleton/skeleton.d.ts +26 -0
- package/dist/skeleton/skeleton.d.ts.map +1 -0
- package/dist/skeleton/skeleton.js +21 -0
- package/dist/skeleton/skeleton.js.map +1 -0
- package/dist/split-layout/index.d.ts +3 -0
- package/dist/split-layout/index.d.ts.map +1 -0
- package/dist/split-layout/index.js +2 -0
- package/dist/split-layout/index.js.map +1 -0
- package/dist/split-layout/split-layout.css +71 -0
- package/dist/split-layout/split-layout.css.d.ts +2 -0
- package/dist/split-layout/split-layout.d.ts +32 -0
- package/dist/split-layout/split-layout.d.ts.map +1 -0
- package/dist/split-layout/split-layout.js +25 -0
- package/dist/split-layout/split-layout.js.map +1 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +2 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/text.css +128 -0
- package/dist/text/text.css.d.ts +2 -0
- package/dist/text/text.d.ts +78 -0
- package/dist/text/text.d.ts.map +1 -0
- package/dist/text/text.js +56 -0
- package/dist/text/text.js.map +1 -0
- package/dist/visually-hidden/index.d.ts +3 -0
- package/dist/visually-hidden/index.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.js.map +1 -0
- package/dist/visually-hidden/visually-hidden.css +19 -0
- package/dist/visually-hidden/visually-hidden.css.d.ts +2 -0
- package/dist/visually-hidden/visually-hidden.d.ts +15 -0
- package/dist/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/visually-hidden/visually-hidden.js +17 -0
- package/dist/visually-hidden/visually-hidden.js.map +1 -0
- package/dist/wizard-layout/index.d.ts +3 -0
- package/dist/wizard-layout/index.d.ts.map +1 -0
- package/dist/wizard-layout/index.js +2 -0
- package/dist/wizard-layout/index.js.map +1 -0
- package/dist/wizard-layout/wizard-layout.css +52 -0
- package/dist/wizard-layout/wizard-layout.css.d.ts +2 -0
- package/dist/wizard-layout/wizard-layout.d.ts +50 -0
- package/dist/wizard-layout/wizard-layout.d.ts.map +1 -0
- package/dist/wizard-layout/wizard-layout.js +38 -0
- package/dist/wizard-layout/wizard-layout.js.map +1 -0
- package/package.json +114 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/form-layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/form-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
export * from './alert';
|
|
2
|
+
export * from './avatar';
|
|
2
3
|
export * from './badge';
|
|
3
4
|
export * from './button';
|
|
4
5
|
export * from './calendar';
|
|
5
6
|
export * from './card';
|
|
7
|
+
export * from './centered-layout';
|
|
6
8
|
export * from './checkbox';
|
|
7
9
|
export * from './combobox';
|
|
8
10
|
export { cx } from './cx';
|
|
9
11
|
export * from './date-input';
|
|
10
12
|
export * from './dialog';
|
|
13
|
+
export * from './divider';
|
|
14
|
+
export * from './empty-state';
|
|
11
15
|
export { Check as FallbackCheck, ChevronLeft as FallbackChevronLeft, ChevronRight as FallbackChevronRight, Cross as FallbackCross, } from './fallback-glyphs';
|
|
12
16
|
export * from './field';
|
|
17
|
+
export * from './form-layout';
|
|
13
18
|
export * from './icon';
|
|
14
19
|
export * from './illustration';
|
|
20
|
+
export * from './layout';
|
|
15
21
|
export * from './menu';
|
|
22
|
+
export * from './page-layout';
|
|
16
23
|
export * from './popover';
|
|
17
24
|
export * from './progress';
|
|
18
25
|
export * from './reorder-control';
|
|
26
|
+
export * from './section';
|
|
19
27
|
export * from './segment-group';
|
|
20
28
|
export * from './select';
|
|
29
|
+
export * from './show';
|
|
30
|
+
export * from './skeleton';
|
|
31
|
+
export * from './split-layout';
|
|
21
32
|
export * from './switch';
|
|
22
33
|
export * from './tabs';
|
|
34
|
+
export * from './text';
|
|
35
|
+
export * from './visually-hidden';
|
|
36
|
+
export * from './wizard-layout';
|
|
23
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,E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AAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
export * from './alert';
|
|
2
|
+
export * from './avatar';
|
|
2
3
|
export * from './badge';
|
|
3
4
|
export * from './button';
|
|
4
5
|
export * from './calendar';
|
|
5
6
|
export * from './card';
|
|
7
|
+
export * from './centered-layout';
|
|
6
8
|
export * from './checkbox';
|
|
7
9
|
export * from './combobox';
|
|
8
10
|
export { cx } from './cx';
|
|
9
11
|
export * from './date-input';
|
|
10
12
|
export * from './dialog';
|
|
13
|
+
export * from './divider';
|
|
14
|
+
export * from './empty-state';
|
|
11
15
|
export { Check as FallbackCheck, ChevronLeft as FallbackChevronLeft, ChevronRight as FallbackChevronRight, Cross as FallbackCross, } from './fallback-glyphs';
|
|
12
16
|
export * from './field';
|
|
17
|
+
export * from './form-layout';
|
|
13
18
|
export * from './icon';
|
|
14
19
|
export * from './illustration';
|
|
20
|
+
export * from './layout';
|
|
15
21
|
export * from './menu';
|
|
22
|
+
export * from './page-layout';
|
|
16
23
|
export * from './popover';
|
|
17
24
|
export * from './progress';
|
|
18
25
|
export * from './reorder-control';
|
|
26
|
+
export * from './section';
|
|
19
27
|
export * from './segment-group';
|
|
20
28
|
export * from './select';
|
|
29
|
+
export * from './show';
|
|
30
|
+
export * from './skeleton';
|
|
31
|
+
export * from './split-layout';
|
|
21
32
|
export * from './switch';
|
|
22
33
|
export * from './tabs';
|
|
34
|
+
export * from './text';
|
|
35
|
+
export * from './visually-hidden';
|
|
36
|
+
export * from './wizard-layout';
|
|
23
37
|
//# sourceMappingURL=index.js.map
|
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,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,IAAI,aAAa,EACtB,WAAW,IAAI,mBAAmB,EAClC,YAAY,IAAI,oBAAoB,EACpC,KAAK,IAAI,aAAa,GACvB,MAAM,mBAAmB,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,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,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,GACvB,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;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +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';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/*
|
|
3
|
+
* The modifiers every layout primitive shares. `min-width: 0` lets a flex
|
|
4
|
+
* or grid child shrink below its content's width, so a long word inside
|
|
5
|
+
* breaks instead of pushing the row past its box.
|
|
6
|
+
*/
|
|
7
|
+
.ds-layout {
|
|
8
|
+
min-width: 0;
|
|
9
|
+
gap: var(--ds-layout-gap);
|
|
10
|
+
overflow-wrap: anywhere;
|
|
11
|
+
|
|
12
|
+
&.ds-layout--gap-none {
|
|
13
|
+
gap: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.ds-layout--gap-tight {
|
|
17
|
+
gap: var(--ds-layout-gap-tight);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.ds-layout--gap-relaxed {
|
|
21
|
+
gap: var(--ds-layout-gap-relaxed);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.ds-layout--gap-loose {
|
|
25
|
+
gap: var(--ds-layout-gap-loose);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.ds-layout--padding-tight {
|
|
29
|
+
padding: var(--ds-layout-padding-tight);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.ds-layout--padding-normal {
|
|
33
|
+
padding: var(--ds-layout-padding);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.ds-layout--padding-relaxed {
|
|
37
|
+
padding: var(--ds-layout-padding-relaxed);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&.ds-layout--align-start {
|
|
41
|
+
align-items: flex-start;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.ds-layout--align-center {
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.ds-layout--align-end {
|
|
49
|
+
align-items: flex-end;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.ds-layout--align-stretch {
|
|
53
|
+
align-items: stretch;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.ds-layout--align-baseline {
|
|
57
|
+
align-items: baseline;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.ds-layout--justify-start {
|
|
61
|
+
justify-content: flex-start;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.ds-layout--justify-center {
|
|
65
|
+
justify-content: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.ds-layout--justify-end {
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.ds-layout--justify-between {
|
|
73
|
+
justify-content: space-between;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ds-stack {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-inline {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
flex-wrap: wrap;
|
|
86
|
+
align-items: center;
|
|
87
|
+
|
|
88
|
+
&.ds-inline--nowrap {
|
|
89
|
+
flex-wrap: nowrap;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*
|
|
94
|
+
* Self-filling: as many columns of at least the step's width as fit. The
|
|
95
|
+
* `min()` keeps a column from being wider than the grid itself on a
|
|
96
|
+
* viewport narrower than the step, so the grid never overflows a phone.
|
|
97
|
+
*/
|
|
98
|
+
.ds-grid {
|
|
99
|
+
display: grid;
|
|
100
|
+
|
|
101
|
+
&.ds-grid--fill-sm {
|
|
102
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--ds-layout-content-sm), 100%), 1fr));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&.ds-grid--fill-md {
|
|
106
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--ds-layout-content-md), 100%), 1fr));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&.ds-grid--fill-lg {
|
|
110
|
+
grid-template-columns: repeat(auto-fill, minmax(min(var(--ds-layout-content-lg), 100%), 1fr));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Fixed columns. The component writes one private property per breakpoint,
|
|
116
|
+
* all five, each already carried forward from the narrower steps, so each
|
|
117
|
+
* media query reads its own step and nothing is inherited from a grid
|
|
118
|
+
* further out. The breakpoints are the viewport tokens, written as
|
|
119
|
+
* literals because `@media` cannot read a custom property
|
|
120
|
+
* (`check:breakpoints`).
|
|
121
|
+
*/
|
|
122
|
+
.ds-grid--columns {
|
|
123
|
+
--_grid-columns: var(--_grid-columns-base);
|
|
124
|
+
|
|
125
|
+
grid-template-columns: repeat(var(--_grid-columns), minmax(0, 1fr));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (width >= 40rem) {
|
|
129
|
+
.ds-grid--columns {
|
|
130
|
+
--_grid-columns: var(--_grid-columns-sm);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (width >= 48rem) {
|
|
135
|
+
.ds-grid--columns {
|
|
136
|
+
--_grid-columns: var(--_grid-columns-md);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@media (width >= 64rem) {
|
|
141
|
+
.ds-grid--columns {
|
|
142
|
+
--_grid-columns: var(--_grid-columns-lg);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@media (width >= 80rem) {
|
|
147
|
+
.ds-grid--columns {
|
|
148
|
+
--_grid-columns: var(--_grid-columns-xl);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.ds-container {
|
|
153
|
+
box-sizing: border-box;
|
|
154
|
+
width: 100%;
|
|
155
|
+
margin-inline: auto;
|
|
156
|
+
|
|
157
|
+
&.ds-container--sm {
|
|
158
|
+
max-width: var(--ds-layout-content-sm);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&.ds-container--md {
|
|
162
|
+
max-width: var(--ds-layout-content-md);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&.ds-container--lg {
|
|
166
|
+
max-width: var(--ds-layout-content-lg);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.ds-container--xl {
|
|
170
|
+
max-width: var(--ds-layout-content-xl);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.ds-container--padding-tight {
|
|
174
|
+
padding-inline: var(--ds-layout-padding-tight);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.ds-container--padding-normal {
|
|
178
|
+
padding-inline: var(--ds-layout-padding);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&.ds-container--padding-relaxed {
|
|
182
|
+
padding-inline: var(--ds-layout-padding-relaxed);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './layout.css';
|
|
4
|
+
/**
|
|
5
|
+
* The distance between the children of a layout primitive. The words are the
|
|
6
|
+
* semantic `space.gap-*` steps; `none` removes the gap.
|
|
7
|
+
*/
|
|
8
|
+
export type LayoutGap = 'none' | 'tight' | 'normal' | 'relaxed' | 'loose';
|
|
9
|
+
/** The inset of a layout primitive from its edge: the semantic `space.padding-*` steps. */
|
|
10
|
+
export type LayoutPadding = 'none' | 'tight' | 'normal' | 'relaxed';
|
|
11
|
+
/** Cross-axis placement of the children. */
|
|
12
|
+
export type LayoutAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
13
|
+
/** Main-axis distribution of the children. */
|
|
14
|
+
export type LayoutJustify = 'start' | 'center' | 'end' | 'between';
|
|
15
|
+
/** Where a block of content stops growing: the semantic `size.content.*` steps. */
|
|
16
|
+
export type ContentWidth = 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
/** Where a layout changes shape: the semantic `size.viewport.*` steps. */
|
|
18
|
+
export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';
|
|
19
|
+
/** A value per breakpoint, from the narrowest viewport (`base`) up. */
|
|
20
|
+
export type Responsive<T> = Partial<Record<'base' | Breakpoint, T>>;
|
|
21
|
+
interface LayoutModifiers {
|
|
22
|
+
/** Space between the children. Defaults to `normal`. */
|
|
23
|
+
gap?: LayoutGap;
|
|
24
|
+
/** Inset from the primitive's own edge. Defaults to `none`. */
|
|
25
|
+
padding?: LayoutPadding;
|
|
26
|
+
/** Cross-axis placement of the children. */
|
|
27
|
+
align?: LayoutAlign;
|
|
28
|
+
/** Main-axis distribution of the children. */
|
|
29
|
+
justify?: LayoutJustify;
|
|
30
|
+
}
|
|
31
|
+
export interface StackProps extends ComponentProps<typeof ark.div>, LayoutModifiers {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A column of children with one gap between them.
|
|
35
|
+
*
|
|
36
|
+
* The workhorse of page composition: a form's fields, a card's regions, a
|
|
37
|
+
* list of sections. Renders a `div`; pass `asChild` to lay out your own
|
|
38
|
+
* element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic
|
|
39
|
+
* step, so a product never writes a number.
|
|
40
|
+
*/
|
|
41
|
+
export declare function Stack({ gap, padding, align, justify, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export interface InlineProps extends ComponentProps<typeof ark.div>, LayoutModifiers {
|
|
43
|
+
/**
|
|
44
|
+
* Whether the children wrap onto new lines when the row runs out of room.
|
|
45
|
+
* Defaults to `true`; a row that must stay on one line (a toolbar in a
|
|
46
|
+
* sideways scroller) passes `false`.
|
|
47
|
+
*/
|
|
48
|
+
wrap?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A row of children with one gap between them, centred on the cross axis.
|
|
52
|
+
*
|
|
53
|
+
* A title beside its actions, a group of badges, a footer of buttons. Wraps by
|
|
54
|
+
* default, so a long label takes a line of its own instead of squeezing its
|
|
55
|
+
* neighbours. Renders a `div`; pass `asChild` to lay out your own element.
|
|
56
|
+
*/
|
|
57
|
+
export declare function Inline({ gap, padding, align, justify, wrap, className, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
/** How many columns a grid has; `Responsive` for a count per breakpoint. */
|
|
59
|
+
export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6;
|
|
60
|
+
export interface GridProps extends ComponentProps<typeof ark.div>, Omit<LayoutModifiers, 'justify'> {
|
|
61
|
+
/**
|
|
62
|
+
* A fixed number of columns, or a number per breakpoint
|
|
63
|
+
* (`{ base: 1, md: 2, lg: 3 }`). Without it the grid fills itself with as
|
|
64
|
+
* many `minColumnWidth`-wide columns as fit.
|
|
65
|
+
*/
|
|
66
|
+
columns?: GridColumns | Responsive<GridColumns>;
|
|
67
|
+
/**
|
|
68
|
+
* The narrowest a column may be when the grid fills itself: a content
|
|
69
|
+
* width step. Defaults to `sm`. Ignored when `columns` is set.
|
|
70
|
+
*/
|
|
71
|
+
minColumnWidth?: Exclude<ContentWidth, 'xl'>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Children in equal columns.
|
|
75
|
+
*
|
|
76
|
+
* Two modes. Without `columns` the grid is self-filling: as many columns of
|
|
77
|
+
* at least `minColumnWidth` as fit, so a row of cards reflows by itself.
|
|
78
|
+
* With `columns` the count is fixed, or fixed per breakpoint. Rows take the
|
|
79
|
+
* height of their tallest child; pass `align="start"` to stop short cards
|
|
80
|
+
* stretching. Renders a `div`; pass `asChild` to lay out your own element.
|
|
81
|
+
*/
|
|
82
|
+
export declare function Grid({ columns, minColumnWidth, gap, padding, align, className, style, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export interface ContainerProps extends ComponentProps<typeof ark.div> {
|
|
84
|
+
/**
|
|
85
|
+
* Where the content stops growing: a content width step. Defaults to `xl`,
|
|
86
|
+
* the width of a page. A dialog or sign-in card is `md`; a form or a
|
|
87
|
+
* reading column is `lg`.
|
|
88
|
+
*/
|
|
89
|
+
size?: ContentWidth;
|
|
90
|
+
/**
|
|
91
|
+
* Inset from the viewport's edge, applied inline only, so a container never
|
|
92
|
+
* adds vertical rhythm of its own. Defaults to `none`.
|
|
93
|
+
*/
|
|
94
|
+
padding?: LayoutPadding;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A centred column no wider than a content width step.
|
|
98
|
+
*
|
|
99
|
+
* Wraps a page, a form or a reading column so it stops growing at the same
|
|
100
|
+
* width in every product. Renders a `div`; pass `asChild` to make your own
|
|
101
|
+
* element the container (`<Container asChild><main>…</main></Container>`).
|
|
102
|
+
*/
|
|
103
|
+
export declare function Container({ size, padding, className, children, ...props }: ContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +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,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CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,OAAO,EACP,KAAgB,EAChB,OAAO,EACP,IAAW,EACX,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,WAAW,2CAcb;AAED,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhD,MAAM,WAAW,SACf,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,EACpC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAChD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;CAC9C;AAgCD;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,cAAqB,EACrB,GAAG,EACH,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,2CAeX;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAW,EACX,OAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,2CAchB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './layout.css';
|
|
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}`);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A column of children with one gap between them.
|
|
10
|
+
*
|
|
11
|
+
* The workhorse of page composition: a form's fields, a card's regions, a
|
|
12
|
+
* list of sections. Renders a `div`; pass `asChild` to lay out your own
|
|
13
|
+
* element (`<Stack asChild><ul>…</ul></Stack>`). Every distance is a semantic
|
|
14
|
+
* step, so a product never writes a number.
|
|
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 }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A row of children with one gap between them, centred on the cross axis.
|
|
21
|
+
*
|
|
22
|
+
* A title beside its actions, a group of badges, a footer of buttons. Wraps by
|
|
23
|
+
* default, so a long label takes a line of its own instead of squeezing its
|
|
24
|
+
* neighbours. Renders a `div`; pass `asChild` to lay out your own element.
|
|
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 }));
|
|
28
|
+
}
|
|
29
|
+
const COLUMN_VARIABLES = {
|
|
30
|
+
base: '--_grid-columns-base',
|
|
31
|
+
sm: '--_grid-columns-sm',
|
|
32
|
+
md: '--_grid-columns-md',
|
|
33
|
+
lg: '--_grid-columns-lg',
|
|
34
|
+
xl: '--_grid-columns-xl',
|
|
35
|
+
};
|
|
36
|
+
const BREAKPOINTS_ASCENDING = ['base', 'sm', 'md', 'lg', 'xl'];
|
|
37
|
+
/**
|
|
38
|
+
* The column counts as the private custom properties `layout.css` reads, one
|
|
39
|
+
* per breakpoint, every one written: a count carries forward to the wider
|
|
40
|
+
* steps until the map names another, and a map without `base` starts at one
|
|
41
|
+
* column. Writing all five is what keeps a nested grid its own — custom
|
|
42
|
+
* properties inherit, so a step left unset would resolve to the parent
|
|
43
|
+
* grid's count instead of the fallback.
|
|
44
|
+
*/
|
|
45
|
+
function gridColumnStyle(columns) {
|
|
46
|
+
const perBreakpoint = typeof columns === 'number' ? { base: columns } : { base: 1, ...columns };
|
|
47
|
+
const style = {};
|
|
48
|
+
let current = 1;
|
|
49
|
+
for (const breakpoint of BREAKPOINTS_ASCENDING) {
|
|
50
|
+
current = perBreakpoint[breakpoint] ?? current;
|
|
51
|
+
style[COLUMN_VARIABLES[breakpoint]] = current;
|
|
52
|
+
}
|
|
53
|
+
return style;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Children in equal columns.
|
|
57
|
+
*
|
|
58
|
+
* Two modes. Without `columns` the grid is self-filling: as many columns of
|
|
59
|
+
* at least `minColumnWidth` as fit, so a row of cards reflows by itself.
|
|
60
|
+
* With `columns` the count is fixed, or fixed per breakpoint. Rows take the
|
|
61
|
+
* height of their tallest child; pass `align="start"` to stop short cards
|
|
62
|
+
* stretching. Renders a `div`; pass `asChild` to lay out your own element.
|
|
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 }));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A centred column no wider than a content width step.
|
|
69
|
+
*
|
|
70
|
+
* Wraps a page, a form or a reading column so it stops growing at the same
|
|
71
|
+
* width in every product. Renders a `div`; pass `asChild` to make your own
|
|
72
|
+
* element the container (`<Container asChild><main>…</main></Container>`).
|
|
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 }));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +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;AAqC3B,SAAS,eAAe,CAAC,EAAE,GAAG,GAAG,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,EAAmB;IAC5F,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,CAC3C,CAAC;AACJ,CAAC;AAID;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAc;IAC/F,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KACnF,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAWD;;;;;;GAMG;AACH,MAAM,UAAU,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I,CAAC,EACnB,OAAO,EACP,cAAc,GAAG,IAAI,EACrB,GAAG,EACH,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACE;IACV,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,SAAS,EACT,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,cAAc,EAAE,EAChE,eAAe,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EACxC,SAAS,CACV,EACD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,KAC9D,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAgBD;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,MAAM,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACO;IACf,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IACN,SAAS,EAAE,EAAE,CACX,cAAc,EACd,iBAAiB,IAAI,EAAE,EACvB,OAAO,KAAK,MAAM,IAAI,yBAAyB,OAAO,EAAE,EACxD,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { type ElementType, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type IconSource } from '../icon/icon';
|
|
3
|
+
import './menu.css';
|
|
4
|
+
export interface ActionMenuItem {
|
|
5
|
+
/** Stable value reported by `onSelect`. */
|
|
6
|
+
value: string;
|
|
7
|
+
/** Text shown in the menu. Also what typeahead matches against. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Glyph before the label. Decorative: the label says what the item does. */
|
|
10
|
+
icon?: IconSource;
|
|
11
|
+
/**
|
|
12
|
+
* Makes the item a link to this address, rendered through `linkComponent`.
|
|
13
|
+
* Choosing it follows the link, with the keyboard too; `onSelect` still
|
|
14
|
+
* reports its value.
|
|
15
|
+
*/
|
|
16
|
+
href?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Marks the link to the page the user is on: `aria-current="page"`, and
|
|
19
|
+
* the `itemIndicator` glyph after the label so the mark is not colour alone.
|
|
20
|
+
*/
|
|
21
|
+
current?: boolean;
|
|
22
|
+
/** Individually disable this item without removing it. */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether choosing the item closes the menu. Defaults to `true`. Keep an
|
|
26
|
+
* item open when its outcome shows in the `footer`, so a failure appears
|
|
27
|
+
* where the click happened.
|
|
28
|
+
*/
|
|
29
|
+
closeOnSelect?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The props a `linkComponent` receives. A plain `'a'` and a router's link
|
|
33
|
+
* component both accept them; Ark adds the menu item's role, id, state
|
|
34
|
+
* attributes and handlers on top, so the component must pass unknown props
|
|
35
|
+
* and its `ref` on to the anchor it renders.
|
|
36
|
+
*/
|
|
37
|
+
export interface ActionMenuLinkProps {
|
|
38
|
+
href: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
'aria-current'?: 'page';
|
|
42
|
+
}
|
|
43
|
+
export interface ActionMenuProps {
|
|
44
|
+
/**
|
|
45
|
+
* The element that opens the menu: a `<button>`, or a component that
|
|
46
|
+
* passes its props and `ref` on to one, such as `IconButton` or
|
|
47
|
+
* `MenuTrigger`. Ark renders it as the trigger, adding `aria-haspopup`,
|
|
48
|
+
* `aria-expanded`, `aria-controls`, the open and close handlers and
|
|
49
|
+
* `data-state`. Give it an accessible name that says what the menu holds,
|
|
50
|
+
* such as "Account menu" or "Main navigation": the menu takes its name
|
|
51
|
+
* from the trigger.
|
|
52
|
+
*/
|
|
53
|
+
trigger: ReactElement;
|
|
54
|
+
/** The actions and links, in order. */
|
|
55
|
+
items: ActionMenuItem[];
|
|
56
|
+
/** Fired with the item's `value` when one is chosen, a link included. */
|
|
57
|
+
onSelect?: (value: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Content above the items that says whose menu this is, such as the
|
|
60
|
+
* signed-in user's name and email. It names the group of items for
|
|
61
|
+
* assistive technology, so keep it to text and decorative elements.
|
|
62
|
+
*/
|
|
63
|
+
header?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* A line under the items about the last action, such as "Couldn't sign
|
|
66
|
+
* out. Check your connection, then try again." It is announced when it
|
|
67
|
+
* appears, and a press on it leaves the menu open. It is not an item and
|
|
68
|
+
* sits beside the `menu` element, which may own only items, so keep it to
|
|
69
|
+
* text and a decorative glyph rather than an `Alert`.
|
|
70
|
+
*/
|
|
71
|
+
footer?: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Renders an item with an `href`. Defaults to `'a'`; pass a router's link
|
|
74
|
+
* component for client-side navigation.
|
|
75
|
+
*/
|
|
76
|
+
linkComponent?: ElementType<ActionMenuLinkProps>;
|
|
77
|
+
/**
|
|
78
|
+
* Glyph marking the `current` link. Defaults to a plain built-in check so
|
|
79
|
+
* `@manakind/ui-core` renders on its own; products pass their own icon.
|
|
80
|
+
*/
|
|
81
|
+
itemIndicator?: IconSource;
|
|
82
|
+
/** Controlled open state. Pair with `onOpenChange`. */
|
|
83
|
+
open?: boolean;
|
|
84
|
+
/** Fired with the requested state whenever the menu asks to open or close. */
|
|
85
|
+
onOpenChange?: (open: boolean) => void;
|
|
86
|
+
/** Extra class names on the menu's popup: the frame around the items and the footer. */
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A menu of actions and links, opened from a trigger, built on Ark UI's
|
|
91
|
+
* Menu. The counterpart of `Menu`, whose items are mutually exclusive
|
|
92
|
+
* choices: here every item does something or goes somewhere.
|
|
93
|
+
*
|
|
94
|
+
* Ark owns the hard parts: `menu` / `menuitem` semantics, roving highlight
|
|
95
|
+
* with the arrow keys, Home/End, typeahead, Escape and click outside to
|
|
96
|
+
* dismiss, following a link on Enter, and focus returning to the trigger on
|
|
97
|
+
* close. This wrapper contributes the `ds-menu` classes and `--ds-menu-*`
|
|
98
|
+
* bindings it shares with `Menu`, a flat `items` API, and the header and
|
|
99
|
+
* footer slots.
|
|
100
|
+
*
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <ActionMenu
|
|
103
|
+
* trigger={<IconButton icon={MenuGlyph} variant="tertiary" aria-label="Main navigation" />}
|
|
104
|
+
* linkComponent={Link}
|
|
105
|
+
* items={[
|
|
106
|
+
* { value: 'dashboard', label: 'Dashboard', href: '/dashboard', current: true },
|
|
107
|
+
* { value: 'goals', label: 'Goals', href: '/goals' },
|
|
108
|
+
* ]}
|
|
109
|
+
* />
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* Reach for this for an account menu, a row's overflow actions, or a
|
|
113
|
+
* navigation that folds into a button on a phone. A set of choices where
|
|
114
|
+
* exactly one is in effect is a `Menu`; a form field is a `Select`.
|
|
115
|
+
*
|
|
116
|
+
* The popup renders in a portal, at the same `z-index: 60` as Select's
|
|
117
|
+
* listbox, and is mounted only while open, as `Menu`'s is.
|
|
118
|
+
*/
|
|
119
|
+
export declare function ActionMenu({ trigger, items, onSelect, header, footer, linkComponent, itemIndicator, open, onOpenChange, className, }: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
//# sourceMappingURL=action-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-menu.d.ts","sourceRoot":"","sources":["../../src/menu/action-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAGhG,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,YA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