@manakind/ui-core 0.19.0 → 0.21.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 +34 -5
- package/dist/breadcrumb/breadcrumb.css +47 -0
- package/dist/breadcrumb/breadcrumb.css.d.ts +2 -0
- package/dist/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb/breadcrumb.js +21 -0
- package/dist/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +3 -0
- package/dist/breadcrumb/index.d.ts.map +1 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/breadcrumb/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/combobox/combobox.css +17 -0
- package/dist/combobox/combobox.d.ts +7 -0
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/combobox.js +25 -3
- package/dist/combobox/combobox.js.map +1 -1
- package/dist/date-input/date-input.d.ts +5 -3
- package/dist/date-input/date-input.d.ts.map +1 -1
- package/dist/date-input/date-input.js +13 -2
- package/dist/date-input/date-input.js.map +1 -1
- 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 +15 -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/link-component.d.ts +12 -0
- package/dist/link-component.d.ts.map +1 -0
- package/dist/link-component.js +2 -0
- package/dist/link-component.js.map +1 -0
- package/dist/menu/action-menu.d.ts +2 -4
- package/dist/menu/action-menu.d.ts.map +1 -1
- package/dist/menu/action-menu.js.map +1 -1
- package/dist/menu/menu.css +1 -1
- package/dist/menu/menu.d.ts +6 -0
- 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/segment-group/segment-group.css +31 -0
- package/dist/segment-group/segment-group.d.ts +14 -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/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,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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CAAC,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC;IAChD,CAAC;IACD,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,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,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What a component that renders links passes the product's link component
|
|
4
|
+
* (a router's `Link`, say): an anchor's essentials. Shared, so one adapter in
|
|
5
|
+
* a product types against every component that takes a `linkComponent`.
|
|
6
|
+
*/
|
|
7
|
+
export interface LinkComponentProps {
|
|
8
|
+
href: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=link-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-component.d.ts","sourceRoot":"","sources":["../src/link-component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-component.js","sourceRoot":"","sources":["../src/link-component.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ElementType, type ReactElement, type ReactNode } from 'react';
|
|
2
2
|
import { type IconSource } from '../icon/icon';
|
|
3
|
+
import type { LinkComponentProps } from '../link-component';
|
|
3
4
|
import './menu.css';
|
|
4
5
|
export interface ActionMenuItem {
|
|
5
6
|
/** Stable value reported by `onSelect`. */
|
|
@@ -34,10 +35,7 @@ export interface ActionMenuItem {
|
|
|
34
35
|
* attributes and handlers on top, so the component must pass unknown props
|
|
35
36
|
* and its `ref` on to the anchor it renders.
|
|
36
37
|
*/
|
|
37
|
-
export interface ActionMenuLinkProps {
|
|
38
|
-
href: string;
|
|
39
|
-
className?: string;
|
|
40
|
-
children?: ReactNode;
|
|
38
|
+
export interface ActionMenuLinkProps extends LinkComponentProps {
|
|
41
39
|
'aria-current'?: 'page';
|
|
42
40
|
}
|
|
43
41
|
export interface ActionMenuProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu.d.ts","sourceRoot":"","sources":["../../src/menu/action-menu.tsx"],"names":[],"mappings":"AAEA,OA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AS,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACjD;;;OAGG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,uDAAuD;IACvD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA4CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAM,EACN,aAAmB,EACnB,aAAqB,EACrB,IAAI,EACJ,YAAY,EACZ,SAAS,GACV,EAAE,eAAe,2CAiEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-menu.js","sourceRoot":"","sources":["../../src/menu/action-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAuD,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChG,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"action-menu.js","sourceRoot":"","sources":["../../src/menu/action-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAuD,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChG,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Aa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,IAHvB,IAAI,CAAC,KAAK,CAIf,CACH,CAAC,CAAC;IACH,MAAM,IAAI,GACR,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CACrB,IAAI,CACL,CAAC,CAAC,CAAC,CACF,MAAC,OAAO,CAAC,SAAS,eAChB,KAAC,OAAO,CAAC,cAAc,IAAC,SAAS,EAAC,iBAAiB,YAAE,MAAM,GAA0B,EACpF,IAAI,IACa,CACrB,CAAC;IAEJ,OAAO,CACL,MAAC,OAAO,CAAC,IAAI,IACX,SAAS,QACT,aAAa,QACb,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,aAEpC,KAAC,OAAO,CAAC,OAAO,IAAC,OAAO,kBAAE,OAAO,GAAmB,EAEpD,KAAC,MAAM,IAAC,SAAS,EAAE,eAAe,YAChC,KAAC,OAAO,CAAC,UAAU,cACjB,eAAK,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,aAC7C,KAAC,OAAO,CAAC,OAAO,IAAC,SAAS,EAAC,kBAAkB,YAAE,IAAI,GAAmB,EACtE,cAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAC,iBAAiB,eAAW,QAAQ,YAChE,MAAM,GACH,IACF,GACa,GACd,IACI,CAChB,CAAC;AACJ,CAAC"}
|
package/dist/menu/menu.css
CHANGED
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
/* The glyph and label of
|
|
143
|
+
/* The glyph and label of a Menu or ActionMenu item, kept together ahead of the indicator. */
|
|
144
144
|
.ds-menu__item-body {
|
|
145
145
|
display: inline-flex;
|
|
146
146
|
align-items: center;
|
package/dist/menu/menu.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export interface MenuItem<V extends string = string> {
|
|
|
8
8
|
label: string;
|
|
9
9
|
/** Individually disable this choice without removing it. */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Glyph before the label, supplied by the product, as on an ActionMenu
|
|
13
|
+
* item: the mark a choice also carries on its trigger. Decorative; the
|
|
14
|
+
* label carries the meaning.
|
|
15
|
+
*/
|
|
16
|
+
icon?: IconSource;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
13
19
|
* Generic over the value type, so a union of choices (`'draft' | 'live'`)
|
package/dist/menu/menu.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/menu/menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAA2B,MAAM,OAAO,CAAC;AAGxF,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjD,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC;IACT,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../src/menu/menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAA2B,MAAM,OAAO,CAAC;AAGxF,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjD,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC;IACT,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAClD;;;;;;;;;;OAUG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB;;;;OAIG;IACH,KAAK,EAAE,CAAC,CAAC;IACT;;;;OAIG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAClC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC9E;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,SAAwB,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAOlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAC9C,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EACb,aAAqB,EACrB,SAAS,GACV,EAAE,SAAS,CAAC,CAAC,CAAC,2CAyDd"}
|
package/dist/menu/menu.js
CHANGED
|
@@ -74,6 +74,6 @@ export function Menu({ trigger, label, items, value, onValueChange, itemIndicato
|
|
|
74
74
|
onValueChange(chosen.value);
|
|
75
75
|
}, [items, value, onValueChange]);
|
|
76
76
|
const portalContainer = useContext(PortalContainerContext);
|
|
77
|
-
return (_jsxs(ArkMenu.Root, { lazyMount: true, unmountOnExit: true, children: [_jsx(ArkMenu.Trigger, { asChild: true, children: trigger }), _jsx(Portal, { container: portalContainer, children: _jsx(ArkMenu.Positioner, { children: _jsx("div", { className: cx('ds-menu__popup', className), children: _jsx(ArkMenu.Content, { className: "ds-menu__content", children: _jsxs(ArkMenu.RadioItemGroup, { value: value, onValueChange: handleValueChange, children: [_jsx(ArkMenu.ItemGroupLabel, { className: "ds-menu__label", children: label }), items.map((item) => (_jsxs(ArkMenu.RadioItem, { value: item.value, valueText: item.label, disabled: item.disabled, className: "ds-menu__item", children: [_jsx(ArkMenu.ItemText, { children: item.label }), _jsx(ArkMenu.ItemIndicator, { className: "ds-menu__item-indicator", children: _jsx(Icon, { source: itemIndicator, size: "sm", decorative: true }) })] }, item.value)))] }) }) }) }) })] }));
|
|
77
|
+
return (_jsxs(ArkMenu.Root, { lazyMount: true, unmountOnExit: true, children: [_jsx(ArkMenu.Trigger, { asChild: true, children: trigger }), _jsx(Portal, { container: portalContainer, children: _jsx(ArkMenu.Positioner, { children: _jsx("div", { className: cx('ds-menu__popup', className), children: _jsx(ArkMenu.Content, { className: "ds-menu__content", children: _jsxs(ArkMenu.RadioItemGroup, { value: value, onValueChange: handleValueChange, children: [_jsx(ArkMenu.ItemGroupLabel, { className: "ds-menu__label", children: label }), items.map((item) => (_jsxs(ArkMenu.RadioItem, { value: item.value, valueText: item.label, disabled: item.disabled, className: "ds-menu__item", children: [_jsxs("span", { className: "ds-menu__item-body", children: [item.icon && (_jsx(Icon, { source: item.icon, size: "sm", decorative: true, className: "ds-menu__item-icon" })), _jsx(ArkMenu.ItemText, { children: item.label })] }), _jsx(ArkMenu.ItemIndicator, { className: "ds-menu__item-indicator", children: _jsx(Icon, { source: itemIndicator, size: "sm", decorative: true }) })] }, item.value)))] }) }) }) }) })] }));
|
|
78
78
|
}
|
|
79
79
|
//# sourceMappingURL=menu.js.map
|
package/dist/menu/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/menu/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAA0C,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/menu/menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAA0C,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,YAAY,CAAC;AA6EpB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,SAAS,GAAG,YAAY,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACS;IACjB,OAAO,CACL,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,EAAE,CAAC,kBAAk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cAAc,IAAC,SAAS,EAAC,gBAAgB,YAAE,KAAK,GAA0B,EAClF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,MAAC,OAAO,CAAC,SAAS,IAEhB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,SAAS,EAAE,IAAI,CAAC,KAAK,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAC,eAAe,aAEzB,gBAAM,SAAS,EAAC,oBAAoB,aACjC,IAAI,CAAC,IAAI,IAAI,CACZ,KAAC,IAAI,IACH,MAAM,EAAE,IAAI,CAAC,IAAI,EACjB,IAAI,EAAC,IAAI,EACT,UAAU,QACV,SAAS,EAAC,oBAAoB,GAC9B,CACH,EACD,KAAC,OAAO,CAAC,QAAQ,cAAE,IAAI,CAAC,KAAK,GAAoB,IAC5C,EACP,KAAC,OAAO,CAAC,aAAa,IAAC,SAAS,EAAC,yBAAyB,YACxD,KAAC,IAAI,IAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAC,IAAI,EAAC,UAAU,SAAG,GAC9B,KAnBnB,IAAI,CAAC,KAAK,CAoBG,CACrB,CAAC,IACqB,GACT,GACd,GACa,GACd,IACI,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page-layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page-layout/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ds-page {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--ds-page-gap);
|
|
7
|
+
width: 100%;
|
|
8
|
+
margin-inline: auto;
|
|
9
|
+
padding-block: var(--ds-page-padding-block);
|
|
10
|
+
padding-inline: var(--ds-page-padding-inline);
|
|
11
|
+
min-width: 0;
|
|
12
|
+
overflow-wrap: anywhere;
|
|
13
|
+
|
|
14
|
+
&.ds-page--sm {
|
|
15
|
+
max-width: var(--ds-layout-content-sm);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.ds-page--md {
|
|
19
|
+
max-width: var(--ds-layout-content-md);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.ds-page--lg {
|
|
23
|
+
max-width: var(--ds-layout-content-lg);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.ds-page--xl {
|
|
27
|
+
max-width: var(--ds-layout-content-xl);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
* Title over description, actions beneath both on a narrow viewport: a
|
|
33
|
+
* plain column, so a part left out leaves no row and no gap behind. From
|
|
34
|
+
* `md` the header is a grid whose rows are only the parts present: the
|
|
35
|
+
* title in row one, the description in the row after it, the actions in
|
|
36
|
+
* the second column of row one. No template areas, because an explicit
|
|
37
|
+
* empty row keeps its gutter.
|
|
38
|
+
*/
|
|
39
|
+
.ds-page__header {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: var(--ds-page-header-gap);
|
|
43
|
+
min-width: 0;
|
|
44
|
+
|
|
45
|
+
& .ds-page__actions {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: var(--ds-layout-gap);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
* `fit-content(50%)`, not `auto`: an auto track grows to its max-content, so
|
|
55
|
+
* one long unbroken label in the actions would take the whole header and
|
|
56
|
+
* squeeze the title to nothing. Capped at half, the label breaks instead.
|
|
57
|
+
*/
|
|
58
|
+
@media (width >= 48rem) {
|
|
59
|
+
.ds-page__header {
|
|
60
|
+
display: grid;
|
|
61
|
+
grid-template-columns: minmax(0, 1fr) fit-content(50%);
|
|
62
|
+
column-gap: var(--ds-layout-gap-relaxed);
|
|
63
|
+
|
|
64
|
+
& .ds-page__title {
|
|
65
|
+
grid-column: 1;
|
|
66
|
+
grid-row: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
& .ds-page__description {
|
|
70
|
+
grid-column: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
& .ds-page__actions {
|
|
74
|
+
grid-column: 2;
|
|
75
|
+
grid-row: 1;
|
|
76
|
+
align-self: start;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import './page-layout.css';
|
|
4
|
+
import type { ContentWidth } from '../layout/layout';
|
|
5
|
+
import { type HeadingProps, type TextProps } from '../text/text';
|
|
6
|
+
export interface PageLayoutProps extends ComponentProps<typeof ark.div> {
|
|
7
|
+
/**
|
|
8
|
+
* Where the page's content stops growing. Defaults to `xl`, a full page; a
|
|
9
|
+
* settings page or a reading page is `lg`.
|
|
10
|
+
*/
|
|
11
|
+
size?: ContentWidth;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The template every page composes: a centred column with the page's inset
|
|
15
|
+
* and the rhythm between its regions.
|
|
16
|
+
*
|
|
17
|
+
* Children are the page's regions, usually a {@link PageHeader} and then
|
|
18
|
+
* {@link Section}s, separated by `--ds-page-gap`. The inset from the viewport
|
|
19
|
+
* is `--ds-page-padding-inline` and `--ds-page-padding-block`. Renders a
|
|
20
|
+
* `div`; pass `asChild` to make the page a landmark
|
|
21
|
+
* (`<PageLayout asChild><main>…</main></PageLayout>`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function PageLayout({ size, className, children, ...props }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type PageHeaderProps = ComponentProps<typeof ark.header>;
|
|
25
|
+
/**
|
|
26
|
+
* The top of a page: its {@link PageTitle}, an optional {@link PageDescription}
|
|
27
|
+
* and optional {@link PageActions}. The title and description stack; the
|
|
28
|
+
* actions sit beside them from `md` up and under them on a narrower viewport.
|
|
29
|
+
*/
|
|
30
|
+
export declare function PageHeader({ className, children, ...props }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export type PageTitleProps = Omit<HeadingProps, 'level'>;
|
|
32
|
+
/**
|
|
33
|
+
* The page's one `h1`. Takes a `ref` for focus management after a route
|
|
34
|
+
* change or a removal, like any heading.
|
|
35
|
+
*/
|
|
36
|
+
export declare function PageTitle({ className, children, ...props }: PageTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export type PageDescriptionProps = TextProps;
|
|
38
|
+
/** Muted supporting copy under the title. */
|
|
39
|
+
export declare function PageDescription({ className, children, ...props }: PageDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export type PageActionsProps = ComponentProps<typeof ark.div>;
|
|
41
|
+
/** The page's primary controls, a wrapping row aligned to the end. */
|
|
42
|
+
export declare function PageActions({ className, children, ...props }: PageActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
//# sourceMappingURL=page-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-layout.d.ts","sourceRoot":"","sources":["../../src/page-layout/page-layout.tsx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EAAE,EAAE,gBAAgB,2CAM9E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import './page-layout.css';
|
|
4
|
+
import { cx } from '../cx';
|
|
5
|
+
import { Heading, Text } from '../text/text';
|
|
6
|
+
/**
|
|
7
|
+
* The template every page composes: a centred column with the page's inset
|
|
8
|
+
* and the rhythm between its regions.
|
|
9
|
+
*
|
|
10
|
+
* Children are the page's regions, usually a {@link PageHeader} and then
|
|
11
|
+
* {@link Section}s, separated by `--ds-page-gap`. The inset from the viewport
|
|
12
|
+
* is `--ds-page-padding-inline` and `--ds-page-padding-block`. Renders a
|
|
13
|
+
* `div`; pass `asChild` to make the page a landmark
|
|
14
|
+
* (`<PageLayout asChild><main>…</main></PageLayout>`).
|
|
15
|
+
*/
|
|
16
|
+
export function PageLayout({ size = 'xl', className, children, ...props }) {
|
|
17
|
+
return (_jsx(ark.div, { className: cx('ds-page', `ds-page--${size}`, className), ...props, children: children }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The top of a page: its {@link PageTitle}, an optional {@link PageDescription}
|
|
21
|
+
* and optional {@link PageActions}. The title and description stack; the
|
|
22
|
+
* actions sit beside them from `md` up and under them on a narrower viewport.
|
|
23
|
+
*/
|
|
24
|
+
export function PageHeader({ className, children, ...props }) {
|
|
25
|
+
return (_jsx(ark.header, { className: cx('ds-page__header', className), ...props, children: children }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The page's one `h1`. Takes a `ref` for focus management after a route
|
|
29
|
+
* change or a removal, like any heading.
|
|
30
|
+
*/
|
|
31
|
+
export function PageTitle({ className, children, ...props }) {
|
|
32
|
+
return (_jsx(Heading, { level: 1, className: cx('ds-page__title', className), ...props, children: children }));
|
|
33
|
+
}
|
|
34
|
+
/** Muted supporting copy under the title. */
|
|
35
|
+
export function PageDescription({ className, children, ...props }) {
|
|
36
|
+
return (_jsx(Text, { tone: "muted", className: cx('ds-page__description', className), ...props, children: children }));
|
|
37
|
+
}
|
|
38
|
+
/** The page's primary controls, a wrapping row aligned to the end. */
|
|
39
|
+
export function PageActions({ className, children, ...props }) {
|
|
40
|
+
return (_jsx(ark.div, { className: cx('ds-page__actions', className), ...props, children: children }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=page-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-layout.js","sourceRoot":"","sources":["../../src/page-layout/page-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAqB,IAAI,EAAkB,MAAM,cAAc,CAAC;AAUhF;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IACxF,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,YAAY,IAAI,EAAE,EAAE,SAAS,CAAC,KAAM,KAAK,YACxE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAmB;IAC3E,OAAO,CACL,KAAC,GAAG,CAAC,MAAM,IAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC/D,QAAQ,GACE,CACd,CAAC;AACJ,CAAC;AAID;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;IACzE,OAAO,CACL,KAAC,OAAO,IAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAM,KAAK,YACrE,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAID,6CAA6C;AAC7C,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAwB;IACrF,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC3E,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC;AAID,sEAAsE;AACtE,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IAC7E,OAAO,CACL,KAAC,GAAG,CAAC,GAAG,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,YAC7D,QAAQ,GACD,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.ds-section {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--ds-section-gap);
|
|
6
|
+
min-width: 0;
|
|
7
|
+
overflow-wrap: anywhere;
|
|
8
|
+
|
|
9
|
+
& .ds-section__header {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
gap: var(--ds-layout-gap);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
& .ds-section__heading {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--ds-section-header-gap);
|
|
21
|
+
min-width: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& .ds-section__actions {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: var(--ds-layout-gap);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ark } from '@ark-ui/react/factory';
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
3
|
+
import './section.css';
|
|
4
|
+
import { type HeadingLevel } from '../text/text';
|
|
5
|
+
/**
|
|
6
|
+
* No `asChild`: the region renders its own header beside `children`, and Ark's
|
|
7
|
+
* `asChild` clones exactly one element, so it would render nothing.
|
|
8
|
+
*/
|
|
9
|
+
export interface SectionProps extends Omit<ComponentProps<typeof ark.section>, 'title' | 'asChild'> {
|
|
10
|
+
/** The section's heading, which also names the region for assistive technology. */
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The heading level of `title`. Defaults to `2`, a section of a page; a
|
|
14
|
+
* section inside another section is `3`.
|
|
15
|
+
*/
|
|
16
|
+
titleLevel?: HeadingLevel;
|
|
17
|
+
/** Muted copy under the title. */
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
/** Controls beside the title: a "See all" link, a filter. */
|
|
20
|
+
actions?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A titled region of a page.
|
|
24
|
+
*
|
|
25
|
+
* Renders a `section` named by its own heading (`aria-labelledby`), so a
|
|
26
|
+
* screen reader can jump between the page's regions by name. The header is
|
|
27
|
+
* title and description with the actions beside them; the children follow
|
|
28
|
+
* at the section's own gap, tighter than the page's.
|
|
29
|
+
*/
|
|
30
|
+
export declare function Section({ title, titleLevel, description, actions, className, children, ...props }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=section.d.ts.map
|
|
@@ -0,0 +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;AACnE,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;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,UAAc,EACd,WAAW,EACX,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,YAAY,2CAoBd"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react/factory';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import './section.css';
|
|
5
|
+
import { cx } from '../cx';
|
|
6
|
+
import { Heading, Text } from '../text/text';
|
|
7
|
+
/**
|
|
8
|
+
* A titled region of a page.
|
|
9
|
+
*
|
|
10
|
+
* Renders a `section` named by its own heading (`aria-labelledby`), so a
|
|
11
|
+
* screen reader can jump between the page's regions by name. The header is
|
|
12
|
+
* title and description with the actions beside them; the children follow
|
|
13
|
+
* at the section's own gap, tighter than the page's.
|
|
14
|
+
*/
|
|
15
|
+
export function Section({ title, titleLevel = 2, description, actions, className, children, ...props }) {
|
|
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] }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=section.js.map
|
|
@@ -0,0 +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,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAqB,IAAI,EAAE,MAAM,cAAc,CAAC;AAqBhE;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EACL,UAAU,GAAG,CAAC,EACd,WAAW,EACX,OAAO,EACP,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,IAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,EAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,mBAAmB,YAC7E,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"}
|
|
@@ -96,6 +96,32 @@
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/*
|
|
100
|
+
* Content-sized: each segment starts at its label's width and the spare
|
|
101
|
+
* width is shared out evenly. Short of room the segments shrink, but no
|
|
102
|
+
* further than their longest word (a flex item's automatic minimum), so a
|
|
103
|
+
* label of several words wraps at a space and a word that fits stays
|
|
104
|
+
* whole; segments that still don't fit side by side wrap onto another row
|
|
105
|
+
* of the track. The minimum is clamped by the item's maximum, the track's
|
|
106
|
+
* width, so only a word wider than the whole track breaks inside its
|
|
107
|
+
* segment, as the long-words rule asks of every component.
|
|
108
|
+
*/
|
|
109
|
+
&.ds-segment-group--fit-content {
|
|
110
|
+
& .ds-segment-group__track {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-wrap: wrap;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Border-box, so the cap at the track's width includes the segment's padding. */
|
|
116
|
+
& .ds-segment-group__item {
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
flex: 1 1 auto;
|
|
119
|
+
min-inline-size: auto;
|
|
120
|
+
max-inline-size: 100%;
|
|
121
|
+
overflow-wrap: break-word;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
99
125
|
&.ds-segment-group--sm {
|
|
100
126
|
--_segment-group-font-size: var(--ds-segment-group-size-sm-font-size);
|
|
101
127
|
--_segment-group-padding-block: var(--ds-segment-group-size-sm-padding-block);
|
|
@@ -107,5 +133,10 @@
|
|
|
107
133
|
--_segment-group-padding-block: var(--ds-segment-group-size-md-padding-block);
|
|
108
134
|
--_segment-group-padding-inline: var(--ds-segment-group-size-md-padding-inline);
|
|
109
135
|
}
|
|
136
|
+
|
|
137
|
+
/* After the sizes, so it wins over either. */
|
|
138
|
+
&.ds-segment-group--dense {
|
|
139
|
+
--_segment-group-padding-inline: var(--ds-segment-group-dense-padding-inline);
|
|
140
|
+
}
|
|
110
141
|
}
|
|
111
142
|
}
|
|
@@ -46,6 +46,19 @@ export type SegmentGroupProps = SegmentGroupName & {
|
|
|
46
46
|
onValueChange?: (value: string) => void;
|
|
47
47
|
/** Segment height and type scale. `sm` suits a toolbar or a card header. */
|
|
48
48
|
size?: SegmentGroupSize;
|
|
49
|
+
/**
|
|
50
|
+
* How the segments share the track. `equal` (default): every segment as
|
|
51
|
+
* wide as the widest, and a word longer than its column breaks inside it.
|
|
52
|
+
* `content`: each segment as wide as its own label, the spare width shared
|
|
53
|
+
* out, so a group of labels of uneven length fits a narrow container
|
|
54
|
+
* without breaking a word.
|
|
55
|
+
*/
|
|
56
|
+
fit?: 'equal' | 'content';
|
|
57
|
+
/**
|
|
58
|
+
* `dense` tightens each segment's inline padding, for a group of many
|
|
59
|
+
* short items (six t-shirt sizes) that has to fit a phone.
|
|
60
|
+
*/
|
|
61
|
+
density?: 'default' | 'dense';
|
|
49
62
|
/** Disable every segment. The checked one keeps showing which is set. */
|
|
50
63
|
disabled?: boolean;
|
|
51
64
|
/** Name for native form participation through the hidden radio inputs. */
|
|
@@ -80,6 +93,6 @@ export type SegmentGroupProps = SegmentGroupName & {
|
|
|
80
93
|
* want a `Select`. Panels that change with the choice are `Tabs`; a segment
|
|
81
94
|
* group changes a value, not what is on the page.
|
|
82
95
|
*/
|
|
83
|
-
export declare function SegmentGroup({ label, items, value, defaultValue, onValueChange, size, disabled, name, className, 'aria-label': ariaLabel, }: SegmentGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
84
97
|
export {};
|
|
85
98
|
//# 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,GAAG;IACjD,qDAAqD;IACrD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4EAA4E;IAC5E,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAS,GACxB,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"segment-group.d.ts","sourceRoot":"","sources":["../../src/segment-group/segment-group.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,qBAAqB,CAAC;AAG7B,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,KAAK,gBAAgB,GACjB;IACE,oEAAoE;IACpE,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACD;IACE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,2FAA2F;IAC3F,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG;IACjD,qDAAqD;IACrD,KA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