@mitcsutt/kiln-ui 0.3.0 → 0.5.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/dist/components/actions/Button/Button.module.js.map +1 -1
- package/dist/components/actions/ToggleChip/ToggleChip.d.ts +5 -0
- package/dist/components/actions/ToggleChip/ToggleChip.js +10 -6
- package/dist/components/actions/ToggleChip/ToggleChip.js.map +1 -1
- package/dist/components/actions/ToggleChip/chip.module.js +4 -3
- package/dist/components/actions/ToggleChip/chip.module.js.map +1 -1
- package/dist/components/display/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/dist/components/display/AvatarGroup/AvatarGroup.js +1 -1
- package/dist/components/display/AvatarGroup/AvatarGroup.js.map +1 -1
- package/dist/components/display/Card/Card.d.ts +7 -4
- package/dist/components/display/Card/Card.js +8 -7
- package/dist/components/display/Card/Card.js.map +1 -1
- package/dist/components/display/Card/Card.module.js.map +1 -1
- package/dist/components/display/List/List.d.ts +18 -5
- package/dist/components/display/List/List.js +53 -43
- package/dist/components/display/List/List.js.map +1 -1
- package/dist/components/display/List/List.module.js.map +1 -1
- package/dist/components/display/List/index.d.ts +1 -1
- package/dist/components/display/Marquee/Marquee.js +1 -1
- package/dist/components/display/Marquee/Marquee.js.map +1 -1
- package/dist/components/display/Media/Media.d.ts +15 -0
- package/dist/components/display/Media/Media.js +43 -23
- package/dist/components/display/Media/Media.js.map +1 -1
- package/dist/components/display/Media/Media.module.js.map +1 -1
- package/dist/components/display/Media/index.d.ts +1 -1
- package/dist/components/display/Stat/Stat.module.js.map +1 -1
- package/dist/components/display/Table/Table.d.ts +23 -1
- package/dist/components/display/Table/Table.js +19 -14
- package/dist/components/display/Table/Table.js.map +1 -1
- package/dist/components/display/Table/Table.module.js.map +1 -1
- package/dist/components/display/Table/index.d.ts +1 -1
- package/dist/components/display/Tag/Tag.d.ts +3 -0
- package/dist/components/display/Tag/Tag.js +11 -10
- package/dist/components/display/Tag/Tag.js.map +1 -1
- package/dist/components/display/Tag/Tag.module.js.map +1 -1
- package/dist/components/display/Tag/index.d.ts +1 -1
- package/dist/components/feedback/Flash/Flash.d.ts +47 -0
- package/dist/components/feedback/Flash/Flash.js +36 -0
- package/dist/components/feedback/Flash/Flash.js.map +1 -0
- package/dist/components/feedback/Flash/Flash.module.js +10 -0
- package/dist/components/feedback/Flash/Flash.module.js.map +1 -0
- package/dist/components/feedback/Flash/index.d.ts +2 -0
- package/dist/components/feedback/RelativeTime/RelativeTime.d.ts +7 -0
- package/dist/components/feedback/RelativeTime/RelativeTime.js +11 -11
- package/dist/components/feedback/RelativeTime/RelativeTime.js.map +1 -1
- package/dist/components/feedback/StatusDot/StatusDot.d.ts +1 -1
- package/dist/components/feedback/StatusDot/StatusDot.js.map +1 -1
- package/dist/components/inputs/ChoiceCards/ChoiceCards.js +9 -9
- package/dist/components/inputs/Combobox/Combobox.js +5 -5
- package/dist/components/inputs/PasswordInput/PasswordInput.js +4 -4
- package/dist/components/layout/AppShell/AppShell.d.ts +4 -1
- package/dist/components/layout/AppShell/AppShell.js +58 -44
- package/dist/components/layout/AppShell/AppShell.js.map +1 -1
- package/dist/components/layout/AppShell/AppShell.module.js.map +1 -1
- package/dist/components/layout/Box/Box.d.ts +15 -3
- package/dist/components/layout/Box/Box.js +11 -10
- package/dist/components/layout/Box/Box.js.map +1 -1
- package/dist/components/layout/Box/Box.module.js.map +1 -1
- package/dist/components/layout/Divider/Divider.d.ts +7 -1
- package/dist/components/layout/Divider/Divider.js +18 -20
- package/dist/components/layout/Divider/Divider.js.map +1 -1
- package/dist/components/layout/ScrollArea/ScrollArea.d.ts +36 -0
- package/dist/components/layout/ScrollArea/ScrollArea.js +25 -0
- package/dist/components/layout/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/components/layout/ScrollArea/ScrollArea.module.js +6 -0
- package/dist/components/layout/ScrollArea/ScrollArea.module.js.map +1 -0
- package/dist/components/layout/ScrollArea/index.d.ts +2 -0
- package/dist/components/layout/Section/Section.d.ts +18 -7
- package/dist/components/layout/Section/Section.js +10 -9
- package/dist/components/layout/Section/Section.js.map +1 -1
- package/dist/components/layout/Section/Section.module.js.map +1 -1
- package/dist/components/navigation/Accordion/Accordion.d.ts +6 -1
- package/dist/components/navigation/Accordion/Accordion.js +19 -11
- package/dist/components/navigation/Accordion/Accordion.js.map +1 -1
- package/dist/components/navigation/Accordion/Accordion.module.js +7 -6
- package/dist/components/navigation/Accordion/Accordion.module.js.map +1 -1
- package/dist/components/navigation/NavLinks/NavLinks.d.ts +4 -1
- package/dist/components/navigation/NavLinks/NavLinks.js.map +1 -1
- package/dist/components/navigation/NavLinks/NavLinks.module.js.map +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +23 -0
- package/dist/components/overlays/Tooltip/Tooltip.js +77 -31
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/typography/Numeral/Numeral.d.ts +26 -2
- package/dist/components/typography/Numeral/Numeral.js +25 -21
- package/dist/components/typography/Numeral/Numeral.js.map +1 -1
- package/dist/components/typography/Numeral/Numeral.module.js +4 -3
- package/dist/components/typography/Numeral/Numeral.module.js.map +1 -1
- package/dist/components/typography/Text/Text.d.ts +5 -2
- package/dist/components/typography/Text/Text.js.map +1 -1
- package/dist/components/typography/Text/Text.module.js.map +1 -1
- package/dist/icons/Icon.js +1 -0
- package/dist/icons/Icon.js.map +1 -1
- package/dist/icons/icons.d.ts +12 -0
- package/dist/icons/icons.js +63 -13
- package/dist/icons/icons.js.map +1 -1
- package/dist/index.d.ts +19 -24
- package/dist/index.js +114 -112
- package/dist/styles.css +1 -1
- package/dist/themes/fiesta.css +1 -1
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js.map +1 -1
- package/package.json +2 -2
- package/skills/custom-theme/SKILL.md +1 -1
- package/skills/design-rules/SKILL.md +8 -4
- package/skills/layout-composition/SKILL.md +2 -0
- package/skills/layout-composition/references/app-shell.md +2 -2
- package/skills/layout-composition/references/box.md +21 -1
- package/skills/layout-composition/references/divider.md +30 -1
- package/skills/layout-composition/references/scroll-area.md +68 -0
- package/skills/layout-composition/references/section.md +24 -2
- package/skills/setup-and-theming/SKILL.md +3 -3
- package/skills/setup-and-theming/references/fiesta.md +1 -1
|
@@ -6,18 +6,19 @@ import a from "./Box.module.js";
|
|
|
6
6
|
import { forwardRef as o } from "react";
|
|
7
7
|
import { jsx as s } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/layout/Box/Box.tsx
|
|
9
|
-
var c = o(function({ padding: o, paddingX: c, paddingY: l, surface: u = "none",
|
|
10
|
-
return /* @__PURE__ */ s(
|
|
11
|
-
ref:
|
|
9
|
+
var c = o(function({ padding: o, paddingX: c, paddingY: l, surface: u = "none", adaptTones: d = !1, border: f = !1, radius: p = "none", as: m = "div", hideBelow: h, hideAbove: g, className: _, style: v, ...y }, b) {
|
|
10
|
+
return /* @__PURE__ */ s(m, {
|
|
11
|
+
ref: b,
|
|
12
12
|
className: e(a.box, i({
|
|
13
|
-
hideBelow:
|
|
14
|
-
hideAbove:
|
|
15
|
-
}),
|
|
13
|
+
hideBelow: h,
|
|
14
|
+
hideAbove: g
|
|
15
|
+
}), _),
|
|
16
16
|
"data-surface": u === "none" ? void 0 : u,
|
|
17
|
-
"data-
|
|
18
|
-
"data-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
"data-adapt-tones": d || void 0,
|
|
18
|
+
"data-border": f || void 0,
|
|
19
|
+
"data-radius": p === "none" ? void 0 : p,
|
|
20
|
+
style: t(n("box-p", o, r), n("box-px", c, r), n("box-py", l, r), v),
|
|
21
|
+
...y
|
|
21
22
|
});
|
|
22
23
|
});
|
|
23
24
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.js","names":["styles","Box_module_default","Box","forwardRef","Comp","rest","cx","visibilityClass","className","surface","border","radius","mergeStyles","responsiveVars","padding","space","paddingX","paddingY","style"],"sources":["../../../../src/components/layout/Box/Box.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react'\nimport { cx } from '#utils/cx'\nimport { mergeStyles, responsiveVars, type Responsive } from '#utils/responsive'\nimport { space, type Space } from '#utils/tokens'\nimport styles from './Box.module.css'\nimport { visibilityClass, type VisibilityProps } from '#utils/visibility'\n\nexport type BoxElement =\n 'div' | 'span' | 'section' | 'article' | 'aside' | 'header' | 'footer' | 'li'\nexport type BoxSurface
|
|
1
|
+
{"version":3,"file":"Box.js","names":["styles","Box_module_default","Box","forwardRef","Comp","rest","cx","visibilityClass","className","surface","adaptTones","border","radius","mergeStyles","responsiveVars","padding","space","paddingX","paddingY","style"],"sources":["../../../../src/components/layout/Box/Box.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react'\nimport { cx } from '#utils/cx'\nimport { mergeStyles, responsiveVars, type Responsive } from '#utils/responsive'\nimport { space, type Space, type CategoryColor } from '#utils/tokens'\nimport styles from './Box.module.css'\nimport { visibilityClass, type VisibilityProps } from '#utils/visibility'\n\nexport type BoxElement =\n 'div' | 'span' | 'section' | 'article' | 'aside' | 'header' | 'footer' | 'li'\nexport type BoxSurface =\n | 'none'\n | 'canvas'\n | 'surface'\n | 'sunken'\n | 'raised'\n | 'inverse'\n | 'accent'\n | `cat-${CategoryColor}`\nexport type BoxRadius = 'none' | 'field' | 'surface' | 'media'\n\nexport interface BoxProps extends HTMLAttributes<HTMLElement>, VisibilityProps {\n /** Padding on every side. Responsive. */\n padding?: Responsive<Space>\n /** Inline (left/right) padding; overrides `padding` on that axis. Responsive. */\n paddingX?: Responsive<Space>\n /** Block (top/bottom) padding; overrides `padding` on that axis. Responsive. */\n paddingY?: Responsive<Space>\n /**\n * Background fill. `inverse`, `accent` and the categorical `cat-1` to `cat-8` (one person's or\n * team's colour, matching their `Tag`) also re-point ink, line and accent colours for its\n * children, so they stay legible on the fill.\n */\n surface?: BoxSurface\n /**\n * On an `inverse`, `accent` or categorical fill, re-point the status tones too, so tone text\n * and soft tone fills (a `Stat` delta, a toned `Numeral` or `Text`, a soft `Badge`) stay AA on\n * the fill. On `accent` and categorical fills tone text becomes the fill's ink, so the sign,\n * glyph or label carries the status; on `inverse` each tone keeps its hue. Off by default, so\n * tones keep the page's colours. No effect on other surfaces.\n */\n adaptTones?: boolean\n /** Hairline border in `--color-line`. One edge treatment per element — a border *or* a fill. */\n border?: boolean\n /** Corner radius, by role. */\n radius?: BoxRadius\n as?: BoxElement\n}\n\n/**\n * Padding, a surface and an edge, and nothing else. The escape hatch when no other layout fits.\n *\n * @remarks\n * `Box` adds padding, a background surface, a border and a radius to its content. Reach for\n * `Stack`, `Inline` or `Grid` to arrange things, and for `Card` when something is a self-contained\n * object. `Box` is for the wells and frames left over.\n *\n * @privateRemarks\n * The escape hatch: padding, a surface and an edge — nothing else. Reach for\n * Stack/Inline/Grid for arrangement and Card for self-contained objects first.\n *\n * <Box padding={{ base: 4, md: 5 }} surface=\"sunken\" radius=\"surface\">…</Box>\n */\nexport const Box = forwardRef<HTMLElement, BoxProps>(function Box(\n {\n padding,\n paddingX,\n paddingY,\n surface = 'none',\n adaptTones = false,\n border = false,\n radius = 'none',\n as: Comp = 'div',\n hideBelow,\n hideAbove,\n className,\n style,\n ...rest\n },\n ref,\n) {\n return (\n <Comp\n // @ts-expect-error — polymorphic ref across a union of intrinsic elements is safe here\n ref={ref}\n className={cx(styles.box, visibilityClass({ hideBelow, hideAbove }), className)}\n data-surface={surface === 'none' ? undefined : surface}\n data-adapt-tones={adaptTones || undefined}\n data-border={border || undefined}\n data-radius={radius === 'none' ? undefined : radius}\n style={mergeStyles(\n responsiveVars('box-p', padding, space),\n responsiveVars('box-px', paddingX, space),\n responsiveVars('box-py', paddingY, space),\n style,\n )}\n {...rest}\n />\n )\n})\n"],"mappings":";;;;;;;;AA8DA,IAAaE,IAAMC,EAAkC,SACnD,EACE,YACA,aACA,aACA,aAAU,QACV,gBAAa,IACb,YAAS,IACT,YAAS,QACT,IAAIC,IAAO,OACX,cACA,cACA,cACA,UACA,GAAGC,KAEL,GACA;CACA,OACE,kBAACD,GAAD;EAEO;EACL,WAAWE,EAAGN,EAAO,KAAKO,EAAgB;GAAE;GAAW;EAAU,CAAC,GAAGC,CAAS;EAC9E,gBAAcC,MAAY,SAAS,KAAA,IAAYA;EAC/C,oBAAkBC,KAAc,KAAA;EAChC,eAAaC,KAAU,KAAA;EACvB,eAAaC,MAAW,SAAS,KAAA,IAAYA;EAC7C,OAAOC,EACLC,EAAe,SAASC,GAASC,CAAK,GACtCF,EAAe,UAAUG,GAAUD,CAAK,GACxCF,EAAe,UAAUI,GAAUF,CAAK,GACxCG,CACF;EACA,GAAId;CACL,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.module.js","names":["box","Box_module_default"],"sources":["../../../../src/components/layout/Box/Box.module.css"],"sourcesContent":["/*\n * Responsive pattern: see layout/Stack/Stack.module.css. Axis padding (--box-px/-py)\n * falls back to the all-sides value (--box-p) per breakpoint.\n *\n * --box-fill / --box-on (read-only): the fill and ink of an `inverse` Box.\n */\n.box {\n --_p: var(--box-p-base, 0px);\n --_px: var(--box-px-base, var(--_p));\n --_py: var(--box-py-base, var(--_p));\n\n display: block;\n min-inline-size: 0;\n padding-block: var(--_py);\n padding-inline: var(--_px);\n}\n\n@media (min-width: 40em) {\n .box {\n --_p: var(--box-p-sm, 0px);\n --_px: var(--box-px-sm, var(--_p));\n --_py: var(--box-py-sm, var(--_p));\n }\n}\n@media (min-width: 48em) {\n .box {\n --_p: var(--box-p-md, 0px);\n --_px: var(--box-px-md, var(--_p));\n --_py: var(--box-py-md, var(--_p));\n }\n}\n@media (min-width: 64em) {\n .box {\n --_p: var(--box-p-lg, 0px);\n --_px: var(--box-px-lg, var(--_p));\n --_py: var(--box-py-lg, var(--_p));\n }\n}\n@media (min-width: 80em) {\n .box {\n --_p: var(--box-p-xl, 0px);\n --_px: var(--box-px-xl, var(--_p));\n --_py: var(--box-py-xl, var(--_p));\n }\n}\n\n/* Surfaces */\n.box[data-surface='canvas'] {\n background-color: var(--color-canvas);\n background-image: var(--canvas-image);\n background-size: var(--canvas-image-size);\n color: var(--color-ink);\n}\n.box[data-surface='surface'] {\n background-color: var(--color-surface);\n color: var(--color-ink);\n}\n.box[data-surface='sunken'] {\n background-color: var(--color-surface-sunken);\n color: var(--color-ink);\n}\n.box[data-surface='raised'] {\n background-color: var(--color-surface-raised);\n color: var(--color-ink);\n}\n/* Inverse re-
|
|
1
|
+
{"version":3,"file":"Box.module.js","names":["box","Box_module_default"],"sources":["../../../../src/components/layout/Box/Box.module.css"],"sourcesContent":["/*\n * Responsive pattern: see layout/Stack/Stack.module.css. Axis padding (--box-px/-py)\n * falls back to the all-sides value (--box-p) per breakpoint.\n *\n * --box-fill / --box-on (read-only): the fill and ink of an `inverse`, `accent` or categorical Box.\n */\n.box {\n --_p: var(--box-p-base, 0px);\n --_px: var(--box-px-base, var(--_p));\n --_py: var(--box-py-base, var(--_p));\n\n display: block;\n min-inline-size: 0;\n padding-block: var(--_py);\n padding-inline: var(--_px);\n}\n\n@media (min-width: 40em) {\n .box {\n --_p: var(--box-p-sm, 0px);\n --_px: var(--box-px-sm, var(--_p));\n --_py: var(--box-py-sm, var(--_p));\n }\n}\n@media (min-width: 48em) {\n .box {\n --_p: var(--box-p-md, 0px);\n --_px: var(--box-px-md, var(--_p));\n --_py: var(--box-py-md, var(--_p));\n }\n}\n@media (min-width: 64em) {\n .box {\n --_p: var(--box-p-lg, 0px);\n --_px: var(--box-px-lg, var(--_p));\n --_py: var(--box-py-lg, var(--_p));\n }\n}\n@media (min-width: 80em) {\n .box {\n --_p: var(--box-p-xl, 0px);\n --_px: var(--box-px-xl, var(--_p));\n --_py: var(--box-py-xl, var(--_p));\n }\n}\n\n/* Surfaces */\n.box[data-surface='canvas'] {\n background-color: var(--color-canvas);\n background-image: var(--canvas-image);\n background-size: var(--canvas-image-size);\n color: var(--color-ink);\n}\n.box[data-surface='surface'] {\n background-color: var(--color-surface);\n color: var(--color-ink);\n}\n.box[data-surface='sunken'] {\n background-color: var(--color-surface-sunken);\n color: var(--color-ink);\n}\n.box[data-surface='raised'] {\n background-color: var(--color-surface-raised);\n color: var(--color-ink);\n}\n/* Inverse, accent and categorical fills re-point the colour roles for descendants — same approach as Section. */\n.box[data-surface='inverse'] {\n --box-fill: var(--color-surface-inverse);\n --box-on: var(--color-ink-inverse);\n}\n.box[data-surface='accent'] {\n --box-fill: var(--color-accent);\n --box-on: var(--color-accent-ink);\n}\n.box[data-surface='cat-1'] {\n --box-fill: var(--color-cat-1);\n}\n.box[data-surface='cat-2'] {\n --box-fill: var(--color-cat-2);\n}\n.box[data-surface='cat-3'] {\n --box-fill: var(--color-cat-3);\n}\n.box[data-surface='cat-4'] {\n --box-fill: var(--color-cat-4);\n}\n.box[data-surface='cat-5'] {\n --box-fill: var(--color-cat-5);\n}\n.box[data-surface='cat-6'] {\n --box-fill: var(--color-cat-6);\n}\n.box[data-surface='cat-7'] {\n --box-fill: var(--color-cat-7);\n}\n.box[data-surface='cat-8'] {\n --box-fill: var(--color-cat-8);\n}\n.box[data-surface^='cat-'] {\n --box-on: var(--color-cat-ink);\n}\n.box:is([data-surface='inverse'], [data-surface='accent'], [data-surface^='cat-']) {\n --color-ink: var(--box-on);\n --color-ink-muted: color-mix(in oklab, var(--box-on) 76%, var(--box-fill));\n --color-ink-subtle: color-mix(in oklab, var(--box-on) 60%, var(--box-fill));\n --color-line: color-mix(in oklab, var(--box-on) 22%, var(--box-fill));\n --color-line-strong: color-mix(in oklab, var(--box-on) 45%, var(--box-fill));\n --color-canvas: var(--box-fill);\n --color-surface: color-mix(in oklab, var(--box-on) 7%, var(--box-fill));\n --color-surface-sunken: color-mix(in oklab, var(--box-on) 12%, var(--box-fill));\n --color-surface-raised: color-mix(in oklab, var(--box-on) 4%, var(--box-fill));\n --color-focus: var(--box-on);\n --color-accent-text: var(--box-on);\n --canvas-image: none;\n\n background-color: var(--box-fill);\n color: var(--box-on);\n}\n/* An accent or categorical fill only clears AA against its own ink: no headroom for muted steps. */\n.box:is([data-surface='accent'], [data-surface^='cat-']) {\n --color-ink-muted: var(--box-on);\n --color-ink-subtle: var(--box-on);\n --color-surface: var(--box-fill);\n --color-surface-sunken: var(--box-fill);\n --color-surface-raised: var(--box-fill);\n}\n.box:is([data-surface='inverse'], [data-surface^='cat-']) > * {\n --color-surface-inverse: var(--box-on);\n --color-ink-inverse: var(--box-fill);\n}\n/* On an accent fill the accent itself becomes the fill's ink, so a primary action still stands out. */\n.box[data-surface='accent'] > * {\n --color-accent: var(--box-on);\n --color-accent-hover: color-mix(in oklab, var(--box-on) 82%, var(--box-fill));\n --color-accent-ink: var(--box-fill);\n --color-accent-soft: color-mix(in oklab, var(--box-on) 12%, var(--box-fill));\n}\n\n/*\n * Opt-in (`adaptTones`, so existing bands keep the page's tones): status tones follow the band,\n * like the accent text does. An accent or categorical fill only clears AA against its own ink,\n * so tone text there is that ink (the sign, glyph or label carries the status) and soft tone\n * fills are the fill itself, like the nested surfaces. An inverse band has headroom, so each\n * tone keeps its hue, mixed toward the band's ink until it reads on the fill.\n * Solid tone fills keep their own ink and need no change.\n */\n.box[data-adapt-tones]:is([data-surface='accent'], [data-surface^='cat-']) {\n --tone-positive-text: var(--box-on);\n --tone-caution-text: var(--box-on);\n --tone-critical-text: var(--box-on);\n --tone-info-text: var(--box-on);\n --tone-positive-soft: var(--box-fill);\n --tone-caution-soft: var(--box-fill);\n --tone-critical-soft: var(--box-fill);\n --tone-info-soft: var(--box-fill);\n}\n.box[data-adapt-tones][data-surface='inverse'] {\n --tone-positive-text: color-mix(in oklab, var(--tone-positive) 40%, var(--box-on));\n --tone-caution-text: color-mix(in oklab, var(--tone-caution) 40%, var(--box-on));\n --tone-critical-text: color-mix(in oklab, var(--tone-critical) 40%, var(--box-on));\n --tone-info-text: color-mix(in oklab, var(--tone-info) 40%, var(--box-on));\n --tone-positive-soft: color-mix(in oklab, var(--tone-positive) 18%, var(--box-fill));\n --tone-caution-soft: color-mix(in oklab, var(--tone-caution) 18%, var(--box-fill));\n --tone-critical-soft: color-mix(in oklab, var(--tone-critical) 18%, var(--box-fill));\n --tone-info-soft: color-mix(in oklab, var(--tone-info) 18%, var(--box-fill));\n}\n\n.box[data-border] {\n border: var(--border-width) solid var(--color-line);\n}\n\n.box[data-radius='field'] {\n border-radius: var(--radius-field);\n}\n.box[data-radius='surface'] {\n border-radius: var(--radius-surface);\n}\n.box[data-radius='media'] {\n border-radius: var(--radius-media);\n}\n\n/* `hidden` wins over the display above (author CSS otherwise beats the UA [hidden] rule). */\n.box[hidden] {\n display: none;\n}\n"],"mappings":""}
|
|
@@ -7,7 +7,10 @@ export interface DividerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chil
|
|
|
7
7
|
orientation?: DividerOrientation;
|
|
8
8
|
/** Heavier rule in `--color-line-strong` at `--border-width-strong`. */
|
|
9
9
|
strong?: boolean;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Content set into a horizontal rule, e.g. "Earlier this week". It's real content, read like
|
|
12
|
+
* any text, and may be a block (a `Stack` of lines); the rules either side are decorative.
|
|
13
|
+
*/
|
|
11
14
|
label?: ReactNode;
|
|
12
15
|
/** Where the label sits. Default `start` (left-aligned by default); `center` for a lone break. */
|
|
13
16
|
labelPosition?: 'start' | 'center';
|
|
@@ -26,6 +29,9 @@ export interface DividerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chil
|
|
|
26
29
|
* `Divider` separates groups. For a rule between every item of a list, use `Stack dividers`
|
|
27
30
|
* instead, which spaces the rules for you.
|
|
28
31
|
*
|
|
32
|
+
* A labelled divider is a band rather than a separator: its label is content that screen readers
|
|
33
|
+
* read in place, and the rules either side of it are decorative.
|
|
34
|
+
*
|
|
29
35
|
* @privateRemarks
|
|
30
36
|
* A hairline rule between groups of content. Prefer `Stack dividers` for rules
|
|
31
37
|
* between every item of a list.
|
|
@@ -3,33 +3,31 @@ import { mergeStyles as t } from "../../../utils/responsive.js";
|
|
|
3
3
|
import { space as n } from "../../../utils/tokens.js";
|
|
4
4
|
import { visibilityClass as r } from "../../../utils/visibility.js";
|
|
5
5
|
import i from "./Divider.module.js";
|
|
6
|
-
import { forwardRef as a
|
|
7
|
-
import { jsx as
|
|
6
|
+
import { forwardRef as a } from "react";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/layout/Divider/Divider.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
ref:
|
|
9
|
+
var s = a(function({ orientation: a = "horizontal", strong: s = !1, label: c, labelPosition: l = "start", spacing: u, decorative: d = !1, hideBelow: f, hideAbove: p, className: m, style: h, ...g }, _) {
|
|
10
|
+
let v = c != null && c !== !1 && a === "horizontal";
|
|
11
|
+
return /* @__PURE__ */ o("div", {
|
|
12
|
+
ref: _,
|
|
13
13
|
className: e(i.divider, r({
|
|
14
|
-
hideBelow:
|
|
15
|
-
hideAbove:
|
|
16
|
-
}),
|
|
17
|
-
role:
|
|
18
|
-
"aria-orientation": !
|
|
19
|
-
"aria-labelledby": !f && b ? y : void 0,
|
|
14
|
+
hideBelow: f,
|
|
15
|
+
hideAbove: p
|
|
16
|
+
}), m),
|
|
17
|
+
role: d || v ? "none" : "separator",
|
|
18
|
+
"aria-orientation": !d && a === "vertical" ? "vertical" : void 0,
|
|
20
19
|
"data-orientation": a,
|
|
21
|
-
"data-strong":
|
|
22
|
-
"data-label-position":
|
|
23
|
-
style: t(
|
|
24
|
-
...
|
|
25
|
-
children:
|
|
26
|
-
id: y,
|
|
20
|
+
"data-strong": s || void 0,
|
|
21
|
+
"data-label-position": v ? l : void 0,
|
|
22
|
+
style: t(u === void 0 ? void 0 : { "--divider-spacing": n(u) }, h),
|
|
23
|
+
...g,
|
|
24
|
+
children: v ? /* @__PURE__ */ o("div", {
|
|
27
25
|
className: i.label,
|
|
28
|
-
children:
|
|
26
|
+
children: c
|
|
29
27
|
}) : null
|
|
30
28
|
});
|
|
31
29
|
});
|
|
32
30
|
//#endregion
|
|
33
|
-
export {
|
|
31
|
+
export { s as Divider };
|
|
34
32
|
|
|
35
33
|
//# sourceMappingURL=Divider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","names":["styles","Divider_module_default","Divider","forwardRef","rest","
|
|
1
|
+
{"version":3,"file":"Divider.js","names":["styles","Divider_module_default","Divider","forwardRef","rest","hasLabel","label","orientation","cx","visibilityClass","className","decorative","strong","labelPosition","mergeStyles","spacing","space","style"],"sources":["../../../../src/components/layout/Divider/Divider.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type HTMLAttributes, type ReactNode } from 'react'\nimport { cx } from '#utils/cx'\nimport { mergeStyles } from '#utils/responsive'\nimport { space, type Space } from '#utils/tokens'\nimport styles from './Divider.module.css'\nimport { visibilityClass, type VisibilityProps } from '#utils/visibility'\n\nexport type DividerOrientation = 'horizontal' | 'vertical'\n\nexport interface DividerProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>, VisibilityProps {\n /** Default `horizontal`. A vertical rule stretches to its flex/grid row. */\n orientation?: DividerOrientation\n /** Heavier rule in `--color-line-strong` at `--border-width-strong`. */\n strong?: boolean\n /**\n * Content set into a horizontal rule, e.g. \"Earlier this week\". It's real content, read like\n * any text, and may be a block (a `Stack` of lines); the rules either side are decorative.\n */\n label?: ReactNode\n /** Where the label sits. Default `start` (left-aligned by default); `center` for a lone break. */\n labelPosition?: 'start' | 'center'\n /** Margin on both sides of the rule (block axis if horizontal, inline if vertical). */\n spacing?: Space\n /**\n * Purely visual: hide it from assistive tech. Use when the rule only repeats a\n * boundary that headings or landmarks already convey.\n */\n decorative?: boolean\n}\n\n/**\n * A hairline rule between groups of content, optionally labelled, horizontal or vertical.\n *\n * @remarks\n * `Divider` separates groups. For a rule between every item of a list, use `Stack dividers`\n * instead, which spaces the rules for you.\n *\n * A labelled divider is a band rather than a separator: its label is content that screen readers\n * read in place, and the rules either side of it are decorative.\n *\n * @privateRemarks\n * A hairline rule between groups of content. Prefer `Stack dividers` for rules\n * between every item of a list.\n *\n * <Divider label=\"Earlier this week\" spacing={6} />\n */\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(function Divider(\n {\n orientation = 'horizontal',\n strong = false,\n label,\n labelPosition = 'start',\n spacing,\n decorative = false,\n hideBelow,\n hideAbove,\n className,\n style,\n ...rest\n },\n ref,\n) {\n const hasLabel =\n label !== undefined && label !== null && label !== false && orientation === 'horizontal'\n return (\n <div\n ref={ref}\n className={cx(styles.divider, visibilityClass({ hideBelow, hideAbove }), className)}\n // A labelled band's label is content, which a separator's children can't be.\n role={decorative || hasLabel ? 'none' : 'separator'}\n aria-orientation={!decorative && orientation === 'vertical' ? 'vertical' : undefined}\n data-orientation={orientation}\n data-strong={strong || undefined}\n data-label-position={hasLabel ? labelPosition : undefined}\n style={mergeStyles(\n spacing === undefined\n ? undefined\n : ({ '--divider-spacing': space(spacing) } as CSSProperties),\n style,\n )}\n {...rest}\n >\n {hasLabel ? <div className={styles.label}>{label}</div> : null}\n </div>\n )\n})\n"],"mappings":";;;;;;;;AA+CA,IAAaE,IAAUC,EAAyC,SAC9D,EACE,iBAAc,cACd,YAAS,IACT,UACA,mBAAgB,SAChB,YACA,gBAAa,IACb,cACA,cACA,cACA,UACA,GAAGC,KAEL,GACA;CACA,IAAMC,IACJC,KAAiC,QAAQA,MAAU,MAASC,MAAgB;CAC9E,OACE,kBAAC,OAAD;EACO;EACL,WAAWC,EAAGR,EAAO,SAASS,EAAgB;GAAE;GAAW;EAAU,CAAC,GAAGC,CAAS;EAElF,MAAMC,KAAcN,IAAW,SAAS;EACxC,oBAAkB,CAACM,KAAcJ,MAAgB,aAAa,aAAa,KAAA;EAC3E,oBAAkBA;EAClB,eAAaK,KAAU,KAAA;EACvB,uBAAqBP,IAAWQ,IAAgB,KAAA;EAChD,OAAOC,EACLC,MAAY,KAAA,IACR,KAAA,IACC,EAAE,qBAAqBC,EAAMD,CAAO,EAAE,GAC3CE,CACF;EACA,GAAIb;EAEH,UAAAC,IAAW,kBAAC,OAAD;GAAK,WAAWL,EAAO;GAAQ,UAAAM;EAAW,CAAA,IAAI;CACvD,CAAA;AAET,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type VisibilityProps } from '../../../utils/visibility.js';
|
|
3
|
+
export type ScrollAreaAxis = 'x' | 'y' | 'both';
|
|
4
|
+
export interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement>, VisibilityProps {
|
|
5
|
+
/**
|
|
6
|
+
* Names the area. With a name (this, or `aria-labelledby`) it becomes a labelled region that
|
|
7
|
+
* keyboard users can focus and scroll with the arrow keys.
|
|
8
|
+
*/
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Which way it scrolls. On `x` and `both` the content keeps its natural width, so a row of cards
|
|
12
|
+
* scrolls instead of squeezing. `y` and `both` scroll once a parent gives the area a height (a
|
|
13
|
+
* grid row, a pane). Default `x`.
|
|
14
|
+
*/
|
|
15
|
+
axis?: ScrollAreaAxis;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A scroll container for content wider or taller than the page, such as a bracket, a timeline or
|
|
19
|
+
* a wide board, that keyboard users can reach and scroll.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* `ScrollArea` lets one wide thing scroll on its own instead of pushing the page sideways. Give it
|
|
23
|
+
* a `label` and it's a named region in the tab order, so someone without a mouse or touch screen
|
|
24
|
+
* can focus it and scroll with the arrow keys. The scrollbar takes the theme's line colour.
|
|
25
|
+
*
|
|
26
|
+
* A data table doesn't need one: `Table` scrolls sideways itself, and takes the same `label`.
|
|
27
|
+
*
|
|
28
|
+
* @privateRemarks
|
|
29
|
+
* The labelled, focusable scroll wrapper Table already has, for anything that isn't a table
|
|
30
|
+
* (axe's scrollable-region-focusable). Focusable only when named, so an unnamed one never adds
|
|
31
|
+
* an anonymous tab stop. `role` is an expression, which jsx-a11y's no-noninteractive-tabindex
|
|
32
|
+
* exempts (allowExpressionValues), so the tabIndex stays lint-clean.
|
|
33
|
+
*
|
|
34
|
+
* <ScrollArea label="Knockout bracket"><Bracket /></ScrollArea>
|
|
35
|
+
*/
|
|
36
|
+
export declare const ScrollArea: import("react").ForwardRefExoticComponent<ScrollAreaProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cx as e } from "../../../utils/cx.js";
|
|
2
|
+
import { visibilityClass as t } from "../../../utils/visibility.js";
|
|
3
|
+
import n from "./ScrollArea.module.js";
|
|
4
|
+
import { forwardRef as r } from "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/layout/ScrollArea/ScrollArea.tsx
|
|
7
|
+
var a = r(function({ label: r, axis: a = "x", hideBelow: o, hideAbove: s, className: c, ...l }, u) {
|
|
8
|
+
let d = r !== void 0 || l["aria-labelledby"] !== void 0;
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
|
+
ref: u,
|
|
11
|
+
className: e(n.scrollArea, t({
|
|
12
|
+
hideBelow: o,
|
|
13
|
+
hideAbove: s
|
|
14
|
+
}), c),
|
|
15
|
+
"data-axis": a,
|
|
16
|
+
role: d ? "region" : void 0,
|
|
17
|
+
"aria-label": r,
|
|
18
|
+
tabIndex: d ? 0 : void 0,
|
|
19
|
+
...l
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as ScrollArea };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=ScrollArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.js","names":["styles","ScrollArea_module_default","ScrollArea","forwardRef","rest","named","label","cx","visibilityClass","className","axis"],"sources":["../../../../src/components/layout/ScrollArea/ScrollArea.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react'\nimport { cx } from '#utils/cx'\nimport { visibilityClass, type VisibilityProps } from '#utils/visibility'\nimport styles from './ScrollArea.module.css'\n\nexport type ScrollAreaAxis = 'x' | 'y' | 'both'\n\nexport interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement>, VisibilityProps {\n /**\n * Names the area. With a name (this, or `aria-labelledby`) it becomes a labelled region that\n * keyboard users can focus and scroll with the arrow keys.\n */\n label?: string\n /**\n * Which way it scrolls. On `x` and `both` the content keeps its natural width, so a row of cards\n * scrolls instead of squeezing. `y` and `both` scroll once a parent gives the area a height (a\n * grid row, a pane). Default `x`.\n */\n axis?: ScrollAreaAxis\n}\n\n/**\n * A scroll container for content wider or taller than the page, such as a bracket, a timeline or\n * a wide board, that keyboard users can reach and scroll.\n *\n * @remarks\n * `ScrollArea` lets one wide thing scroll on its own instead of pushing the page sideways. Give it\n * a `label` and it's a named region in the tab order, so someone without a mouse or touch screen\n * can focus it and scroll with the arrow keys. The scrollbar takes the theme's line colour.\n *\n * A data table doesn't need one: `Table` scrolls sideways itself, and takes the same `label`.\n *\n * @privateRemarks\n * The labelled, focusable scroll wrapper Table already has, for anything that isn't a table\n * (axe's scrollable-region-focusable). Focusable only when named, so an unnamed one never adds\n * an anonymous tab stop. `role` is an expression, which jsx-a11y's no-noninteractive-tabindex\n * exempts (allowExpressionValues), so the tabIndex stays lint-clean.\n *\n * <ScrollArea label=\"Knockout bracket\"><Bracket /></ScrollArea>\n */\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(function ScrollArea(\n { label, axis = 'x', hideBelow, hideAbove, className, ...rest },\n ref,\n) {\n const named = label !== undefined || rest['aria-labelledby'] !== undefined\n return (\n <div\n ref={ref}\n className={cx(styles.scrollArea, visibilityClass({ hideBelow, hideAbove }), className)}\n data-axis={axis}\n role={named ? 'region' : undefined}\n aria-label={label}\n tabIndex={named ? 0 : undefined}\n {...rest}\n />\n )\n})\n"],"mappings":";;;;;;AAwCA,IAAaE,IAAaC,EAA4C,SACpE,EAAE,UAAO,UAAO,KAAK,cAAW,cAAW,cAAW,GAAGC,KACzD,GACA;CACA,IAAMC,IAAQC,MAAU,KAAA,KAAaF,EAAK,uBAAuB,KAAA;CACjE,OACE,kBAAC,OAAD;EACO;EACL,WAAWG,EAAGP,EAAO,YAAYQ,EAAgB;GAAE;GAAW;EAAU,CAAC,GAAGC,CAAS;EACrF,aAAWC;EACX,MAAML,IAAQ,WAAW,KAAA;EACzB,cAAYC;EACZ,UAAUD,IAAQ,IAAI,KAAA;EACtB,GAAID;CACL,CAAA;AAEL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.module.js","names":["scrollArea","ScrollArea_module_default"],"sources":["../../../../src/components/layout/ScrollArea/ScrollArea.module.css"],"sourcesContent":["/*\n * Component tokens (themes may set any of these on [data-theme]):\n * --scroll-area-thumb default var(--color-line-strong) — the scrollbar's thumb\n *\n * Scrolling stays inside the area on its own axis (overscroll-behavior), so reaching the end\n * of a wide bracket doesn't swipe the browser back a page.\n */\n.scrollArea {\n display: block;\n min-inline-size: 0;\n max-inline-size: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n overscroll-behavior-x: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--scroll-area-thumb, var(--color-line-strong)) transparent;\n}\n.scrollArea[data-axis='y'] {\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior-x: auto;\n overscroll-behavior-y: contain;\n}\n.scrollArea[data-axis='both'] {\n overflow: auto;\n overscroll-behavior: contain;\n}\n/*\n * Sideways, the content keeps at least its natural width instead of squeezing to fit, so a row\n * of cards scrolls rather than shrinking; content narrower than the area still fills it.\n */\n.scrollArea:not([data-axis='y']) > * {\n min-inline-size: max-content;\n}\n.scrollArea:focus-visible {\n outline: 2px solid var(--color-focus);\n outline-offset: 2px;\n}\n\n/* `hidden` wins over the display above (author CSS otherwise beats the UA [hidden] rule). */\n.scrollArea[hidden] {\n display: none;\n}\n"],"mappings":""}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'react';
|
|
2
2
|
import { type Responsive } from '../../../utils/responsive.js';
|
|
3
|
-
import { type Space } from '../../../utils/tokens.js';
|
|
3
|
+
import { type Space, type CategoryColor } from '../../../utils/tokens.js';
|
|
4
4
|
import { type VisibilityProps } from '../../../utils/visibility.js';
|
|
5
5
|
export type SectionElement = 'section' | 'div' | 'article' | 'aside' | 'header' | 'footer';
|
|
6
|
-
export type SectionSurface = 'canvas' | 'surface' | 'sunken' | 'inverse' | 'accent'
|
|
6
|
+
export type SectionSurface = 'canvas' | 'surface' | 'sunken' | 'inverse' | 'accent' | `cat-${CategoryColor}`;
|
|
7
7
|
export type SectionDivider = 'top' | 'bottom' | 'both';
|
|
8
8
|
export interface SectionProps extends HTMLAttributes<HTMLElement>, VisibilityProps {
|
|
9
9
|
/**
|
|
@@ -12,10 +12,19 @@ export interface SectionProps extends HTMLAttributes<HTMLElement>, VisibilityPro
|
|
|
12
12
|
*/
|
|
13
13
|
space?: Responsive<Space>;
|
|
14
14
|
/**
|
|
15
|
-
* Full-bleed band colour. Omit to stay transparent on the canvas. `inverse` and
|
|
16
|
-
* `
|
|
15
|
+
* Full-bleed band colour. Omit to stay transparent on the canvas. `inverse`, `accent` and
|
|
16
|
+
* the categorical `cat-1` to `cat-8` re-point the ink, line and focus colours so children
|
|
17
|
+
* stay legible.
|
|
17
18
|
*/
|
|
18
19
|
surface?: SectionSurface;
|
|
20
|
+
/**
|
|
21
|
+
* On an `inverse`, `accent` or categorical band, re-point the status tones too, so tone text
|
|
22
|
+
* and soft tone fills (a `Stat` delta, a toned `Numeral` or `Text`, a soft `Badge`) stay AA on
|
|
23
|
+
* the band. On `accent` and categorical bands tone text becomes the band's ink, so the sign,
|
|
24
|
+
* glyph or label carries the status; on `inverse` each tone keeps its hue. Off by default, so
|
|
25
|
+
* tones keep the page's colours. No effect on other surfaces.
|
|
26
|
+
*/
|
|
27
|
+
adaptTones?: boolean;
|
|
19
28
|
/** A hairline across the full bleed at the top, bottom or both edges. */
|
|
20
29
|
divider?: SectionDivider;
|
|
21
30
|
as?: SectionElement;
|
|
@@ -31,9 +40,11 @@ export interface SectionProps extends HTMLAttributes<HTMLElement>, VisibilityPro
|
|
|
31
40
|
*
|
|
32
41
|
* ## Surfaces and bands
|
|
33
42
|
*
|
|
34
|
-
* `surface` is `canvas`, `surface`, `sunken`, `inverse` or
|
|
35
|
-
*
|
|
36
|
-
*
|
|
43
|
+
* `surface` is `canvas`, `surface`, `sunken`, `inverse`, `accent`, or a categorical `cat-1` to
|
|
44
|
+
* `cat-8` (a band in one person's or team's colour, matching their `Tag`). On `inverse`, `accent`
|
|
45
|
+
* and the categorical bands, the colour roles flip for everything inside, so text, links, focus
|
|
46
|
+
* rings and buttons stay legible with no extra props. Add `adaptTones` to flip the status tones
|
|
47
|
+
* too. `divider` adds a rule at the `top`, `bottom` or `both`.
|
|
37
48
|
*
|
|
38
49
|
* @privateRemarks
|
|
39
50
|
* A full-bleed band of vertical rhythm. Put a `Container` inside for width.
|
|
@@ -6,17 +6,18 @@ import a from "./Section.module.js";
|
|
|
6
6
|
import { forwardRef as o } from "react";
|
|
7
7
|
import { jsx as s } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/layout/Section/Section.tsx
|
|
9
|
-
var c = o(function({ space: o, surface: c,
|
|
10
|
-
return /* @__PURE__ */ s(
|
|
11
|
-
ref:
|
|
9
|
+
var c = o(function({ space: o, surface: c, adaptTones: l = !1, divider: u, as: d = "section", hideBelow: f, hideAbove: p, className: m, style: h, ...g }, _) {
|
|
10
|
+
return /* @__PURE__ */ s(d, {
|
|
11
|
+
ref: _,
|
|
12
12
|
className: e(a.section, i({
|
|
13
|
-
hideBelow:
|
|
14
|
-
hideAbove:
|
|
15
|
-
}),
|
|
13
|
+
hideBelow: f,
|
|
14
|
+
hideAbove: p
|
|
15
|
+
}), m),
|
|
16
16
|
"data-surface": c,
|
|
17
|
-
"data-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
"data-adapt-tones": l || void 0,
|
|
18
|
+
"data-divider": u,
|
|
19
|
+
style: t(n("section-space", o, r), h),
|
|
20
|
+
...g
|
|
20
21
|
});
|
|
21
22
|
});
|
|
22
23
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","names":["styles","Section_module_default","Section","forwardRef","spaceProp","Comp","rest","cx","visibilityClass","className","surface","divider","mergeStyles","responsiveVars","space","style"],"sources":["../../../../src/components/layout/Section/Section.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react'\nimport { cx } from '#utils/cx'\nimport { mergeStyles, responsiveVars, type Responsive } from '#utils/responsive'\nimport { space, type Space } from '#utils/tokens'\nimport styles from './Section.module.css'\nimport { visibilityClass, type VisibilityProps } from '#utils/visibility'\n\nexport type SectionElement = 'section' | 'div' | 'article' | 'aside' | 'header' | 'footer'\nexport type SectionSurface
|
|
1
|
+
{"version":3,"file":"Section.js","names":["styles","Section_module_default","Section","forwardRef","spaceProp","Comp","rest","cx","visibilityClass","className","surface","adaptTones","divider","mergeStyles","responsiveVars","space","style"],"sources":["../../../../src/components/layout/Section/Section.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react'\nimport { cx } from '#utils/cx'\nimport { mergeStyles, responsiveVars, type Responsive } from '#utils/responsive'\nimport { space, type Space, type CategoryColor } from '#utils/tokens'\nimport styles from './Section.module.css'\nimport { visibilityClass, type VisibilityProps } from '#utils/visibility'\n\nexport type SectionElement = 'section' | 'div' | 'article' | 'aside' | 'header' | 'footer'\nexport type SectionSurface =\n 'canvas' | 'surface' | 'sunken' | 'inverse' | 'accent' | `cat-${CategoryColor}`\nexport type SectionDivider = 'top' | 'bottom' | 'both'\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement>, VisibilityProps {\n /**\n * Block padding (top and bottom), as a step on the space scale. Responsive.\n * Vary it: adjacent sections should not share the same step. Default `8`.\n */\n space?: Responsive<Space>\n /**\n * Full-bleed band colour. Omit to stay transparent on the canvas. `inverse`, `accent` and\n * the categorical `cat-1` to `cat-8` re-point the ink, line and focus colours so children\n * stay legible.\n */\n surface?: SectionSurface\n /**\n * On an `inverse`, `accent` or categorical band, re-point the status tones too, so tone text\n * and soft tone fills (a `Stat` delta, a toned `Numeral` or `Text`, a soft `Badge`) stay AA on\n * the band. On `accent` and categorical bands tone text becomes the band's ink, so the sign,\n * glyph or label carries the status; on `inverse` each tone keeps its hue. Off by default, so\n * tones keep the page's colours. No effect on other surfaces.\n */\n adaptTones?: boolean\n /** A hairline across the full bleed at the top, bottom or both edges. */\n divider?: SectionDivider\n as?: SectionElement\n}\n\n/**\n * A full-bleed band of vertical space, with an optional surface and rules. Put a Container inside\n * it for width.\n *\n * @remarks\n * `Section` is how a page gets its rhythm: each band pads itself top and bottom with a step from\n * the space scale, and can paint a surface across the full width. Width is the `Container`'s job,\n * so a section is almost always `Section` then `Container`.\n *\n * ## Surfaces and bands\n *\n * `surface` is `canvas`, `surface`, `sunken`, `inverse`, `accent`, or a categorical `cat-1` to\n * `cat-8` (a band in one person's or team's colour, matching their `Tag`). On `inverse`, `accent`\n * and the categorical bands, the colour roles flip for everything inside, so text, links, focus\n * rings and buttons stay legible with no extra props. Add `adaptTones` to flip the status tones\n * too. `divider` adds a rule at the `top`, `bottom` or `both`.\n *\n * @privateRemarks\n * A full-bleed band of vertical rhythm. Put a `Container` inside for width.\n *\n * <Section space={{ base: 7, md: 9 }} surface=\"sunken\" divider=\"both\">\n * <Container>…</Container>\n * </Section>\n */\nexport const Section = forwardRef<HTMLElement, SectionProps>(function Section(\n {\n space: spaceProp,\n surface,\n adaptTones = false,\n divider,\n as: Comp = 'section',\n hideBelow,\n hideAbove,\n className,\n style,\n ...rest\n },\n ref,\n) {\n return (\n <Comp\n // @ts-expect-error — polymorphic ref across a union of intrinsic elements is safe here\n ref={ref}\n className={cx(styles.section, visibilityClass({ hideBelow, hideAbove }), className)}\n data-surface={surface}\n data-adapt-tones={adaptTones || undefined}\n data-divider={divider}\n style={mergeStyles(responsiveVars('section-space', spaceProp, space), style)}\n {...rest}\n />\n )\n})\n"],"mappings":";;;;;;;;AA6DA,IAAaE,IAAUC,EAAsC,SAC3D,EACE,OAAOC,GACP,YACA,gBAAa,IACb,YACA,IAAIC,IAAO,WACX,cACA,cACA,cACA,UACA,GAAGC,KAEL,GACA;CACA,OACE,kBAACD,GAAD;EAEO;EACL,WAAWE,EAAGP,EAAO,SAASQ,EAAgB;GAAE;GAAW;EAAU,CAAC,GAAGC,CAAS;EAClF,gBAAcC;EACd,oBAAkBC,KAAc,KAAA;EAChC,gBAAcC;EACd,OAAOC,EAAYC,EAAe,iBAAiBV,GAAWW,CAAK,GAAGC,CAAK;EAC3E,GAAIV;CACL,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.module.js","names":["section","Section_module_default"],"sources":["../../../../src/components/layout/Section/Section.module.css"],"sourcesContent":["/*\n * Responsive pattern: see layout/Stack/Stack.module.css.\n *\n * Component tokens:\n * --section-fill / --section-on (read-only) the band's fill and ink on inverse/accent\n * --section-space-default block padding when `space` is unset (default var(--space-8))\n * --section-divider-color hairline colour for `divider` (default var(--color-line))\n */\n.section {\n --_space: var(--section-space-base, var(--section-space-default, var(--space-8)));\n --_rule: var(--border-width) solid var(--section-divider-color, var(--color-line));\n\n display: block;\n position: relative;\n min-inline-size: 0;\n padding-block: var(--_space);\n}\n\n@media (min-width: 40em) {\n .section {\n --_space: var(--section-space-sm, var(--section-space-default, var(--space-8)));\n }\n}\n@media (min-width: 48em) {\n .section {\n --_space: var(--section-space-md, var(--section-space-default, var(--space-8)));\n }\n}\n@media (min-width: 64em) {\n .section {\n --_space: var(--section-space-lg, var(--section-space-default, var(--space-8)));\n }\n}\n@media (min-width: 80em) {\n .section {\n --_space: var(--section-space-xl, var(--section-space-default, var(--space-8)));\n }\n}\n\n.section[data-divider='top'],\n.section[data-divider='both'] {\n border-block-start: var(--_rule);\n}\n.section[data-divider='bottom'],\n.section[data-divider='both'] {\n border-block-end: var(--_rule);\n}\n\n/* Surfaces */\n.section[data-surface='canvas'] {\n background-color: var(--color-canvas);\n background-image: var(--canvas-image);\n background-size: var(--canvas-image-size);\n color: var(--color-ink);\n}\n.section[data-surface='surface'] {\n background-color: var(--color-surface);\n color: var(--color-ink);\n}\n.section[data-surface='sunken'] {\n background-color: var(--color-surface-sunken);\n color: var(--color-ink);\n}\n\n/*\n * Inverse and accent bands re-point the colour roles for every descendant, so text,\n * hairlines, focus rings and nested controls (an outline or solid Button) stay legible\n * without per-child props. Mixes are taken against the band's own fill.\n *\n * Swapping a pair (e.g. ink <-> ink-inverse) can't happen on one element — it would be\n * a var() cycle — so the band publishes its fill/ink as --section-fill/--section-on and\n * the swapped roles are set on its children.\n */\n.section[data-surface='inverse'] {\n --section-fill: var(--color-surface-inverse);\n --section-on: var(--color-ink-inverse);\n}\n.section[data-surface='accent'] {\n --section-fill: var(--color-accent);\n --section-on: var(--color-accent-ink);\n}\n.section:is([data-surface='inverse'], [data-surface='accent']) {\n --color-ink: var(--section-on);\n --color-ink-muted: color-mix(in oklab, var(--section-on) 76%, var(--section-fill));\n --color-ink-subtle: color-mix(in oklab, var(--section-on) 60%, var(--section-fill));\n --color-line: color-mix(in oklab, var(--section-on) 22%, var(--section-fill));\n --color-line-strong: color-mix(in oklab, var(--section-on) 45%, var(--section-fill));\n --color-canvas: var(--section-fill);\n --color-surface: color-mix(in oklab, var(--section-on) 7%, var(--section-fill));\n --color-surface-sunken: color-mix(in oklab, var(--section-on) 12%, var(--section-fill));\n --color-surface-raised: color-mix(in oklab, var(--section-on) 4%, var(--section-fill));\n --color-focus: var(--section-on);\n --color-accent-text: var(--section-on);\n --canvas-image: none;\n\n background-color: var(--section-fill);\n color: var(--section-on);\n}\n/* An accent fill only clears AA against its own ink
|
|
1
|
+
{"version":3,"file":"Section.module.js","names":["section","Section_module_default"],"sources":["../../../../src/components/layout/Section/Section.module.css"],"sourcesContent":["/*\n * Responsive pattern: see layout/Stack/Stack.module.css.\n *\n * Component tokens:\n * --section-fill / --section-on (read-only) the band's fill and ink on inverse/accent\n * --section-space-default block padding when `space` is unset (default var(--space-8))\n * --section-divider-color hairline colour for `divider` (default var(--color-line))\n */\n.section {\n --_space: var(--section-space-base, var(--section-space-default, var(--space-8)));\n --_rule: var(--border-width) solid var(--section-divider-color, var(--color-line));\n\n display: block;\n position: relative;\n min-inline-size: 0;\n padding-block: var(--_space);\n}\n\n@media (min-width: 40em) {\n .section {\n --_space: var(--section-space-sm, var(--section-space-default, var(--space-8)));\n }\n}\n@media (min-width: 48em) {\n .section {\n --_space: var(--section-space-md, var(--section-space-default, var(--space-8)));\n }\n}\n@media (min-width: 64em) {\n .section {\n --_space: var(--section-space-lg, var(--section-space-default, var(--space-8)));\n }\n}\n@media (min-width: 80em) {\n .section {\n --_space: var(--section-space-xl, var(--section-space-default, var(--space-8)));\n }\n}\n\n.section[data-divider='top'],\n.section[data-divider='both'] {\n border-block-start: var(--_rule);\n}\n.section[data-divider='bottom'],\n.section[data-divider='both'] {\n border-block-end: var(--_rule);\n}\n\n/* Surfaces */\n.section[data-surface='canvas'] {\n background-color: var(--color-canvas);\n background-image: var(--canvas-image);\n background-size: var(--canvas-image-size);\n color: var(--color-ink);\n}\n.section[data-surface='surface'] {\n background-color: var(--color-surface);\n color: var(--color-ink);\n}\n.section[data-surface='sunken'] {\n background-color: var(--color-surface-sunken);\n color: var(--color-ink);\n}\n\n/*\n * Inverse and accent bands re-point the colour roles for every descendant, so text,\n * hairlines, focus rings and nested controls (an outline or solid Button) stay legible\n * without per-child props. Mixes are taken against the band's own fill.\n *\n * Swapping a pair (e.g. ink <-> ink-inverse) can't happen on one element — it would be\n * a var() cycle — so the band publishes its fill/ink as --section-fill/--section-on and\n * the swapped roles are set on its children.\n */\n.section[data-surface='inverse'] {\n --section-fill: var(--color-surface-inverse);\n --section-on: var(--color-ink-inverse);\n}\n.section[data-surface='accent'] {\n --section-fill: var(--color-accent);\n --section-on: var(--color-accent-ink);\n}\n.section[data-surface='cat-1'] {\n --section-fill: var(--color-cat-1);\n}\n.section[data-surface='cat-2'] {\n --section-fill: var(--color-cat-2);\n}\n.section[data-surface='cat-3'] {\n --section-fill: var(--color-cat-3);\n}\n.section[data-surface='cat-4'] {\n --section-fill: var(--color-cat-4);\n}\n.section[data-surface='cat-5'] {\n --section-fill: var(--color-cat-5);\n}\n.section[data-surface='cat-6'] {\n --section-fill: var(--color-cat-6);\n}\n.section[data-surface='cat-7'] {\n --section-fill: var(--color-cat-7);\n}\n.section[data-surface='cat-8'] {\n --section-fill: var(--color-cat-8);\n}\n.section[data-surface^='cat-'] {\n --section-on: var(--color-cat-ink);\n}\n.section:is([data-surface='inverse'], [data-surface='accent'], [data-surface^='cat-']) {\n --color-ink: var(--section-on);\n --color-ink-muted: color-mix(in oklab, var(--section-on) 76%, var(--section-fill));\n --color-ink-subtle: color-mix(in oklab, var(--section-on) 60%, var(--section-fill));\n --color-line: color-mix(in oklab, var(--section-on) 22%, var(--section-fill));\n --color-line-strong: color-mix(in oklab, var(--section-on) 45%, var(--section-fill));\n --color-canvas: var(--section-fill);\n --color-surface: color-mix(in oklab, var(--section-on) 7%, var(--section-fill));\n --color-surface-sunken: color-mix(in oklab, var(--section-on) 12%, var(--section-fill));\n --color-surface-raised: color-mix(in oklab, var(--section-on) 4%, var(--section-fill));\n --color-focus: var(--section-on);\n --color-accent-text: var(--section-on);\n --canvas-image: none;\n\n background-color: var(--section-fill);\n color: var(--section-on);\n}\n/* An accent or categorical fill only clears AA against its own ink, so there is no headroom\n for muted/subtle steps there: secondary text uses the full band ink, and nested\n surfaces stay the band fill (edges come from the line tokens) so text on them keeps AA. */\n.section:is([data-surface='accent'], [data-surface^='cat-']) {\n --color-ink-muted: var(--section-on);\n --color-ink-subtle: var(--section-on);\n --color-surface: var(--section-fill);\n --color-surface-sunken: var(--section-fill);\n --color-surface-raised: var(--section-fill);\n}\n.section[data-surface='inverse'] > * {\n --color-surface-inverse: var(--section-on);\n --color-ink-inverse: var(--section-fill);\n}\n/* On an accent band the accent itself becomes the band's ink, so a primary action still stands out. */\n.section[data-surface='accent'] > * {\n --color-accent: var(--section-on);\n --color-accent-hover: color-mix(in oklab, var(--section-on) 82%, var(--section-fill));\n --color-accent-ink: var(--section-fill);\n --color-accent-soft: color-mix(in oklab, var(--section-on) 12%, var(--section-fill));\n}\n\n/*\n * Opt-in (`adaptTones`, so existing bands keep the page's tones): status tones follow the band,\n * like the accent text does. An accent or categorical fill only clears AA against its own ink,\n * so tone text there is that ink (the sign, glyph or label carries the status) and soft tone\n * fills are the fill itself, like the nested surfaces. An inverse band has headroom, so each\n * tone keeps its hue, mixed toward the band's ink until it reads on the fill.\n * Solid tone fills keep their own ink and need no change.\n */\n.section[data-adapt-tones]:is([data-surface='accent'], [data-surface^='cat-']) {\n --tone-positive-text: var(--section-on);\n --tone-caution-text: var(--section-on);\n --tone-critical-text: var(--section-on);\n --tone-info-text: var(--section-on);\n --tone-positive-soft: var(--section-fill);\n --tone-caution-soft: var(--section-fill);\n --tone-critical-soft: var(--section-fill);\n --tone-info-soft: var(--section-fill);\n}\n.section[data-adapt-tones][data-surface='inverse'] {\n --tone-positive-text: color-mix(in oklab, var(--tone-positive) 40%, var(--section-on));\n --tone-caution-text: color-mix(in oklab, var(--tone-caution) 40%, var(--section-on));\n --tone-critical-text: color-mix(in oklab, var(--tone-critical) 40%, var(--section-on));\n --tone-info-text: color-mix(in oklab, var(--tone-info) 40%, var(--section-on));\n --tone-positive-soft: color-mix(in oklab, var(--tone-positive) 18%, var(--section-fill));\n --tone-caution-soft: color-mix(in oklab, var(--tone-caution) 18%, var(--section-fill));\n --tone-critical-soft: color-mix(in oklab, var(--tone-critical) 18%, var(--section-fill));\n --tone-info-soft: color-mix(in oklab, var(--tone-info) 18%, var(--section-fill));\n}\n\n/* `hidden` wins over the display above (author CSS otherwise beats the UA [hidden] rule). */\n.section[hidden] {\n display: none;\n}\n"],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
2
|
import { Accordion as AccordionPrimitive } from 'radix-ui';
|
|
3
3
|
export type AccordionVariant = 'divided' | 'contained';
|
|
4
4
|
export type AccordionSize = 'sm' | 'md';
|
|
@@ -13,6 +13,11 @@ export type AccordionItemProps = ComponentPropsWithoutRef<typeof AccordionPrimit
|
|
|
13
13
|
export interface AccordionTriggerProps extends ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> {
|
|
14
14
|
/** Heading level wrapping the trigger, for the document outline. Default 3. */
|
|
15
15
|
level?: 2 | 3 | 4 | 5 | 6;
|
|
16
|
+
/**
|
|
17
|
+
* A figure or badge at the end of the trigger, just before the chevron, like a score beside
|
|
18
|
+
* a match. Keep it phrasing content (`Numeral`, `Badge`, `Text`): it's inside a button.
|
|
19
|
+
*/
|
|
20
|
+
trailing?: ReactNode;
|
|
16
21
|
}
|
|
17
22
|
export type AccordionContentProps = ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;
|
|
18
23
|
/**
|
|
@@ -27,21 +27,29 @@ var u = i("md"), d = a(function({ variant: t = "divided", size: n = "md", classN
|
|
|
27
27
|
className: e(r.item, t),
|
|
28
28
|
...n
|
|
29
29
|
});
|
|
30
|
-
}), p = a(function({ level: i = 3,
|
|
31
|
-
let
|
|
30
|
+
}), p = a(function({ level: i = 3, trailing: a, className: d, children: f, ...p }, m) {
|
|
31
|
+
let h = o(u), g = n(i);
|
|
32
32
|
return /* @__PURE__ */ s(l.Header, {
|
|
33
33
|
asChild: !0,
|
|
34
|
-
children: /* @__PURE__ */ s(
|
|
34
|
+
children: /* @__PURE__ */ s(g, {
|
|
35
35
|
className: r.header,
|
|
36
36
|
children: /* @__PURE__ */ c(l.Trigger, {
|
|
37
|
-
ref:
|
|
38
|
-
className: e(r.trigger,
|
|
39
|
-
"data-size":
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
ref: m,
|
|
38
|
+
className: e(r.trigger, d),
|
|
39
|
+
"data-size": h,
|
|
40
|
+
"data-trailing": a !== void 0 || void 0,
|
|
41
|
+
...p,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ s("span", {
|
|
44
|
+
className: r.triggerLabel,
|
|
45
|
+
children: f
|
|
46
|
+
}),
|
|
47
|
+
a === void 0 ? null : /* @__PURE__ */ s("span", {
|
|
48
|
+
className: r.triggerTrailing,
|
|
49
|
+
children: a
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ s(t, { className: r.chevron })
|
|
52
|
+
]
|
|
45
53
|
})
|
|
46
54
|
})
|
|
47
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","names":["Accordion","AccordionPrimitive","styles","Accordion_module_default","SizeContext","createContext","AccordionRoot","forwardRef","rest","props","size","Accordion","cx","className","variant","AccordionItem","AccordionTrigger","useContext","Heading","headingTag","level","ChevronDownIcon","AccordionContent","Accordion$1"],"sources":["../../../../src/components/navigation/Accordion/Accordion.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Accordion.js","names":["Accordion","AccordionPrimitive","styles","Accordion_module_default","SizeContext","createContext","AccordionRoot","forwardRef","rest","props","size","Accordion","cx","className","variant","AccordionItem","AccordionTrigger","useContext","Heading","headingTag","level","trailing","ChevronDownIcon","AccordionContent","Accordion$1"],"sources":["../../../../src/components/navigation/Accordion/Accordion.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useContext,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react'\nimport { Accordion as AccordionPrimitive } from 'radix-ui'\nimport { cx } from '#utils/cx'\nimport { ChevronDownIcon } from '#icons'\nimport styles from './Accordion.module.css'\nimport { headingTag } from '#utils/heading'\n\nexport type AccordionVariant = 'divided' | 'contained'\nexport type AccordionSize = 'sm' | 'md'\n\ninterface AccordionOwnProps {\n /** `divided` (default): hairlines between items, no box. `contained`: a bordered surface. */\n variant?: AccordionVariant\n /** `sm` for inline notes (\"Why is this invoice overdue?\"); `md` for FAQs and sections. */\n size?: AccordionSize\n}\n\nexport type AccordionProps = (\n AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps\n) &\n AccordionOwnProps\n\nconst SizeContext = createContext<AccordionSize>('md')\n\nconst AccordionRoot = forwardRef<HTMLDivElement, AccordionProps>(function Accordion(\n { variant = 'divided', size = 'md', className, ...rest },\n ref,\n) {\n const props = rest.type === 'single' ? { collapsible: true, ...rest } : rest // single items can close by default\n return (\n <SizeContext.Provider value={size}>\n <AccordionPrimitive.Root\n ref={ref}\n className={cx(styles.root, className)}\n data-variant={variant}\n data-size={size}\n {...props}\n />\n </SizeContext.Provider>\n )\n})\n\nexport type AccordionItemProps = ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n\nconst AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { className, ...rest },\n ref,\n) {\n return <AccordionPrimitive.Item ref={ref} className={cx(styles.item, className)} {...rest} />\n})\n\nexport interface AccordionTriggerProps extends ComponentPropsWithoutRef<\n typeof AccordionPrimitive.Trigger\n> {\n /** Heading level wrapping the trigger, for the document outline. Default 3. */\n level?: 2 | 3 | 4 | 5 | 6\n /**\n * A figure or badge at the end of the trigger, just before the chevron, like a score beside\n * a match. Keep it phrasing content (`Numeral`, `Badge`, `Text`): it's inside a button.\n */\n trailing?: ReactNode\n}\n\nconst AccordionTrigger = forwardRef<HTMLButtonElement, AccordionTriggerProps>(\n function AccordionTrigger({ level = 3, trailing, className, children, ...rest }, ref) {\n const size = useContext(SizeContext)\n const Heading = headingTag(level)\n return (\n <AccordionPrimitive.Header asChild>\n <Heading className={styles.header}>\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cx(styles.trigger, className)}\n data-size={size}\n data-trailing={trailing !== undefined || undefined}\n {...rest}\n >\n <span className={styles.triggerLabel}>{children}</span>\n {trailing !== undefined ? (\n <span className={styles.triggerTrailing}>{trailing}</span>\n ) : null}\n <ChevronDownIcon className={styles.chevron} />\n </AccordionPrimitive.Trigger>\n </Heading>\n </AccordionPrimitive.Header>\n )\n },\n)\n\nexport type AccordionContentProps = ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n\nconst AccordionContent = forwardRef<HTMLDivElement, AccordionContentProps>(\n function AccordionContent({ className, children, ...rest }, ref) {\n const size = useContext(SizeContext)\n return (\n <AccordionPrimitive.Content\n ref={ref}\n className={cx(styles.content, className)}\n data-size={size}\n {...rest}\n >\n <div className={styles.contentInner}>{children}</div>\n </AccordionPrimitive.Content>\n )\n },\n)\n\n/**\n * Expandable sections with a turning chevron. Also Kiln's disclosure, for a single \"why?\" note.\n *\n * @remarks\n * `Accordion` stacks sections whose content expands under their heading. It's Radix Accordion\n * underneath, so triggers are buttons inside headings, and arrow keys move between them.\n *\n * @privateRemarks\n * Radix Accordion: expandable sections with a rotating chevron and a height animation.\n * Also the library's disclosure: use one `type=\"single\"` item for an inline \"why?\" note.\n * Single accordions are `collapsible` unless you pass `collapsible={false}`.\n *\n * <Accordion type=\"single\">\n * <Accordion.Item value=\"scoring\">\n * <Accordion.Trigger>How scoring works</Accordion.Trigger>\n * <Accordion.Content>…</Accordion.Content>\n * </Accordion.Item>\n * </Accordion>\n */\nexport const Accordion = Object.assign(AccordionRoot, {\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Content: AccordionContent,\n})\n"],"mappings":";;;;;;;;AA4BA,IAAMI,IAAcC,EAA6B,IAAI,GAE/CC,IAAgBC,EAA2C,SAC/D,EAAE,aAAU,WAAW,UAAO,MAAM,cAAW,GAAGC,KAClD,GACA;CACA,IAAMC,IAAQD,EAAK,SAAS,WAAW;EAAE,aAAa;EAAM,GAAGA;CAAK,IAAIA;CACxE,OACE,kBAACJ,EAAY,UAAb;EAAsB,OAAOM;EAC3B,UAAA,kBAACT,EAAmB,MAApB;GACO;GACL,WAAWW,EAAGV,EAAO,MAAMW,CAAS;GACpC,gBAAcC;GACd,aAAWJ;GACX,GAAID;EACL,CAAA;CACmB,CAAA;AAE1B,CAAC,GAIKM,IAAgBR,EAA+C,SACnE,EAAE,cAAW,GAAGC,KAChB,GACA;CACA,OAAO,kBAACP,EAAmB,MAApB;EAA8B;EAAK,WAAWW,EAAGV,EAAO,MAAMW,CAAS;EAAG,GAAIL;CAAO,CAAA;AAC9F,CAAC,GAcKQ,IAAmBT,EACvB,SAA0B,EAAE,WAAQ,GAAG,aAAU,cAAW,aAAU,GAAGC,KAAQ,GAAK;CACpF,IAAME,IAAOO,EAAWb,CAAW,GAC7Bc,IAAUC,EAAWC,CAAK;CAChC,OACE,kBAACnB,EAAmB,QAApB;EAA2B,SAAA;EACzB,UAAA,kBAACiB,GAAD;GAAS,WAAWhB,EAAO;GACzB,UAAA,kBAACD,EAAmB,SAApB;IACO;IACL,WAAWW,EAAGV,EAAO,SAASW,CAAS;IACvC,aAAWH;IACX,iBAAeW,MAAa,KAAA,KAAa,KAAA;IACzC,GAAIb;IALN,UAAA;KAOE,kBAAC,QAAD;MAAM,WAAWN,EAAO;MAAe;KAAe,CAAA;KACrDmB,MAAa,KAAA,IAEV,OADF,kBAAC,QAAD;MAAM,WAAWnB,EAAO;MAAkB,UAAAmB;KAAe,CAAA;KAE3D,kBAACC,GAAD,EAAiB,WAAWpB,EAAO,QAAU,CAAA;IACnB;;EACrB,CAAA;CACgB,CAAA;AAE/B,CACF,GAIMqB,IAAmBhB,EACvB,SAA0B,EAAE,cAAW,aAAU,GAAGC,KAAQ,GAAK;CAC/D,IAAME,IAAOO,EAAWb,CAAW;CACnC,OACE,kBAACH,EAAmB,SAApB;EACO;EACL,WAAWW,EAAGV,EAAO,SAASW,CAAS;EACvC,aAAWH;EACX,GAAIF;EAEJ,UAAA,kBAAC,OAAD;GAAK,WAAWN,EAAO;GAAe;EAAc,CAAA;CAC1B,CAAA;AAEhC,CACF,GAqBaF,IAAY,OAAO,OAAOM,GAAe;CACpD,MAAMS;CACN,SAASC;CACT,SAASO;AACX,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
//#region src/components/navigation/Accordion/Accordion.module.css
|
|
2
|
-
var e = "kiln-Accordion__root", t = "kiln-Accordion__item", n = "kiln-Accordion__header", r = "kiln-Accordion__trigger", i = "kiln-Accordion__chevron", a = "kiln-Accordion__triggerLabel", o = "kiln-
|
|
2
|
+
var e = "kiln-Accordion__root", t = "kiln-Accordion__item", n = "kiln-Accordion__header", r = "kiln-Accordion__trigger", i = "kiln-Accordion__chevron", a = "kiln-Accordion__triggerLabel", o = "kiln-Accordion__triggerTrailing", s = "kiln-Accordion__content", c = "kiln-Accordion__open", l = "kiln-Accordion__close", u = "kiln-Accordion__contentInner", d = {
|
|
3
3
|
root: e,
|
|
4
4
|
item: t,
|
|
5
5
|
header: n,
|
|
6
6
|
trigger: r,
|
|
7
7
|
chevron: i,
|
|
8
8
|
triggerLabel: a,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
triggerTrailing: o,
|
|
10
|
+
content: s,
|
|
11
|
+
open: c,
|
|
12
|
+
close: l,
|
|
13
|
+
contentInner: u
|
|
13
14
|
};
|
|
14
15
|
//#endregion
|
|
15
|
-
export { i as chevron,
|
|
16
|
+
export { i as chevron, l as close, s as content, u as contentInner, d as default, n as header, t as item, c as open, e as root, r as trigger, a as triggerLabel, o as triggerTrailing };
|
|
16
17
|
|
|
17
18
|
//# sourceMappingURL=Accordion.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.module.js","names":["root","item","header","trigger","chevron","triggerLabel","content","open","close","contentInner","Accordion_module_default"],"sources":["../../../../src/components/navigation/Accordion/Accordion.module.css"],"sourcesContent":["/*\n * Component tokens:\n * --accordion-radius contained variant, default var(--radius-surface)\n * --accordion-bg contained variant, default var(--color-surface)\n * --accordion-shadow contained variant, default var(--shadow-surface)\n */\n.root {\n --_px: 0px;\n\n min-inline-size: 0;\n}\n\n.root[data-variant='contained'] {\n --_px: var(--space-4);\n\n overflow: hidden;\n border: var(--border-width) solid var(--color-line-strong);\n border-radius: var(--accordion-radius, var(--radius-surface));\n background: var(--accordion-bg, var(--color-surface));\n box-shadow: var(--accordion-shadow, var(--shadow-surface));\n}\n\n.item + .item {\n border-block-start: var(--border-width) solid var(--color-line);\n}\n\n.header {\n all: unset;\n display: flex;\n}\n\n.trigger {\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n gap: var(--space-4);\n min-block-size: max(2.75rem, var(--control-lg));\n padding-block: var(--space-3);\n padding-inline: var(--_px);\n border: 0;\n background: transparent;\n color: var(--color-ink);\n font-family: var(--font-text);\n font-size: var(--text-md);\n font-weight: var(--label-weight);\n letter-spacing: var(--label-tracking);\n text-transform: var(--label-transform);\n line-height: var(--leading-snug);\n text-align: start;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n transition:\n color var(--dur-1) var(--ease-out),\n background-color var(--dur-1) var(--ease-out);\n}\n.trigger[data-size='sm'] {\n /* Small = an inline note: the chevron follows the label instead of hugging the far edge. */\n justify-content: flex-start;\n gap: var(--space-2);\n min-block-size: max(2.75rem, var(--control-sm));\n padding-block: var(--space-2);\n font-size: var(--text-sm);\n}\n\n@media (hover: hover) {\n .trigger:hover:not(:disabled) .chevron {\n color: var(--color-ink);\n }\n .root[data-variant='contained'] .trigger:hover:not(:disabled) {\n background: var(--color-surface-sunken);\n }\n}\n\n.trigger:focus-visible {\n outline: 2px solid var(--color-focus);\n outline-offset: -2px;\n border-radius: var(--radius-field);\n}\n\n.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n}\n\n.triggerLabel {\n min-inline-size: 0;\n}\n\n.chevron {\n flex: none;\n font-size: 1.25rem;\n color: var(--color-ink-subtle);\n transition:\n rotate var(--dur-2) var(--ease-spring),\n color var(--dur-1) var(--ease-out);\n}\n.trigger[data-size='sm'] .chevron {\n font-size: 1rem;\n}\n.trigger[data-state='open'] .chevron {\n rotate: 180deg;\n color: var(--color-ink);\n}\n\n/* ── Content: height animates to Radix's measured value ─────────────────── */\n.content {\n overflow: hidden;\n color: var(--color-ink-muted);\n font-size: var(--text-sm);\n line-height: var(--leading-body);\n}\n.content[data-state='open'] {\n animation: open var(--dur-3) var(--ease-out);\n}\n.content[data-state='closed'] {\n animation: close var(--dur-2) var(--ease-out);\n}\n.contentInner {\n padding-block-end: var(--space-4);\n padding-inline: var(--_px);\n padding-inline-end: calc(var(--_px) + 1.25rem + var(--space-4));\n}\n.content[data-size='sm'] .contentInner {\n padding-block-end: var(--space-3);\n padding-inline-end: var(--_px);\n}\n\n@keyframes open {\n from {\n block-size: 0;\n }\n to {\n block-size: var(--radix-accordion-content-height);\n }\n}\n@keyframes close {\n from {\n block-size: var(--radix-accordion-content-height);\n }\n to {\n block-size: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .content[data-state='open'],\n .content[data-state='closed'] {\n animation: none;\n }\n .chevron {\n transition: none;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Accordion.module.js","names":["root","item","header","trigger","chevron","triggerLabel","triggerTrailing","content","open","close","contentInner","Accordion_module_default"],"sources":["../../../../src/components/navigation/Accordion/Accordion.module.css"],"sourcesContent":["/*\n * Component tokens:\n * --accordion-radius contained variant, default var(--radius-surface)\n * --accordion-bg contained variant, default var(--color-surface)\n * --accordion-shadow contained variant, default var(--shadow-surface)\n */\n.root {\n --_px: 0px;\n\n min-inline-size: 0;\n}\n\n.root[data-variant='contained'] {\n --_px: var(--space-4);\n\n overflow: hidden;\n border: var(--border-width) solid var(--color-line-strong);\n border-radius: var(--accordion-radius, var(--radius-surface));\n background: var(--accordion-bg, var(--color-surface));\n box-shadow: var(--accordion-shadow, var(--shadow-surface));\n}\n\n.item + .item {\n border-block-start: var(--border-width) solid var(--color-line);\n}\n\n.header {\n all: unset;\n display: flex;\n}\n\n.trigger {\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: space-between;\n gap: var(--space-4);\n min-block-size: max(2.75rem, var(--control-lg));\n padding-block: var(--space-3);\n padding-inline: var(--_px);\n border: 0;\n background: transparent;\n color: var(--color-ink);\n font-family: var(--font-text);\n font-size: var(--text-md);\n font-weight: var(--label-weight);\n letter-spacing: var(--label-tracking);\n text-transform: var(--label-transform);\n line-height: var(--leading-snug);\n text-align: start;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n transition:\n color var(--dur-1) var(--ease-out),\n background-color var(--dur-1) var(--ease-out);\n}\n.trigger[data-size='sm'] {\n /* Small = an inline note: the chevron follows the label instead of hugging the far edge. */\n justify-content: flex-start;\n gap: var(--space-2);\n min-block-size: max(2.75rem, var(--control-sm));\n padding-block: var(--space-2);\n font-size: var(--text-sm);\n}\n\n@media (hover: hover) {\n .trigger:hover:not(:disabled) .chevron {\n color: var(--color-ink);\n }\n .root[data-variant='contained'] .trigger:hover:not(:disabled) {\n background: var(--color-surface-sunken);\n }\n}\n\n.trigger:focus-visible {\n outline: 2px solid var(--color-focus);\n outline-offset: -2px;\n border-radius: var(--radius-field);\n}\n\n.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.45;\n}\n\n/* The label fills the trigger, so its content can spread to the chevron or `trailing`. */\n.triggerLabel {\n flex: 1 1 auto;\n min-inline-size: 0;\n}\n.trigger[data-size='sm'] .triggerLabel {\n flex: 0 1 auto;\n}\n/* With a trailing figure, even a small trigger's label fills, so the figures in a list line up. */\n.trigger[data-size='sm'][data-trailing] .triggerLabel {\n flex: 1 1 auto;\n}\n.triggerTrailing {\n display: inline-flex;\n flex: none;\n align-items: center;\n gap: var(--space-2);\n font-variant-numeric: tabular-nums lining-nums;\n}\n\n.chevron {\n flex: none;\n font-size: 1.25rem;\n color: var(--color-ink-subtle);\n transition:\n rotate var(--dur-2) var(--ease-spring),\n color var(--dur-1) var(--ease-out);\n}\n.trigger[data-size='sm'] .chevron {\n font-size: 1rem;\n}\n.trigger[data-state='open'] .chevron {\n rotate: 180deg;\n color: var(--color-ink);\n}\n\n/* ── Content: height animates to Radix's measured value ─────────────────── */\n.content {\n overflow: hidden;\n color: var(--color-ink-muted);\n font-size: var(--text-sm);\n line-height: var(--leading-body);\n}\n.content[data-state='open'] {\n animation: open var(--dur-3) var(--ease-out);\n}\n.content[data-state='closed'] {\n animation: close var(--dur-2) var(--ease-out);\n}\n.contentInner {\n padding-block-end: var(--space-4);\n padding-inline: var(--_px);\n padding-inline-end: calc(var(--_px) + 1.25rem + var(--space-4));\n}\n.content[data-size='sm'] .contentInner {\n padding-block-end: var(--space-3);\n padding-inline-end: var(--_px);\n}\n\n@keyframes open {\n from {\n block-size: 0;\n }\n to {\n block-size: var(--radix-accordion-content-height);\n }\n}\n@keyframes close {\n from {\n block-size: var(--radix-accordion-content-height);\n }\n to {\n block-size: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .content[data-state='open'],\n .content[data-state='closed'] {\n animation: none;\n }\n .chevron {\n transition: none;\n }\n}\n"],"mappings":""}
|
|
@@ -13,7 +13,10 @@ export interface NavLinksProps extends HTMLAttributes<HTMLElement>, VisibilityPr
|
|
|
13
13
|
* vertical (vertical items are already a full control tall).
|
|
14
14
|
*/
|
|
15
15
|
gap?: Space;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* `md` (default), body-size labels for page headers; `sm`, one step smaller, for sidebars,
|
|
18
|
+
* dense toolbars, footers and sub-navs. Neither drops to the caption steps.
|
|
19
|
+
*/
|
|
17
20
|
size?: NavLinksSize;
|
|
18
21
|
}
|
|
19
22
|
export interface NavLinksItemProps extends AnchorHTMLAttributes<HTMLAnchorElement>, VisibilityProps {
|