@hideyukimori/nene2-ui 0.3.0 → 0.4.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.
Files changed (39) hide show
  1. package/dist/data/DetailList.d.ts +3 -1
  2. package/dist/data/DetailList.js +3 -2
  3. package/dist/data/DetailList.js.map +1 -1
  4. package/dist/feedback/InlineAlert.d.ts +1 -1
  5. package/dist/feedback/InlineAlert.js +4 -0
  6. package/dist/feedback/InlineAlert.js.map +1 -1
  7. package/dist/feedback/ToastProvider.js +2 -2
  8. package/dist/feedback/ToastProvider.js.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/layout/PageHeader.d.ts +3 -1
  13. package/dist/layout/PageHeader.js +3 -2
  14. package/dist/layout/PageHeader.js.map +1 -1
  15. package/dist/lib/states.d.ts +15 -0
  16. package/dist/lib/states.js +15 -0
  17. package/dist/lib/states.js.map +1 -1
  18. package/dist/primitives/Button.d.ts +9 -2
  19. package/dist/primitives/Button.js +11 -4
  20. package/dist/primitives/Button.js.map +1 -1
  21. package/dist/primitives/Spinner.d.ts +3 -1
  22. package/dist/primitives/Spinner.js +3 -2
  23. package/dist/primitives/Spinner.js.map +1 -1
  24. package/dist/primitives/Switch.js +2 -2
  25. package/dist/primitives/Switch.js.map +1 -1
  26. package/dist/primitives/Text.d.ts +3 -1
  27. package/dist/primitives/Text.js +4 -3
  28. package/dist/primitives/Text.js.map +1 -1
  29. package/dist/states/EmptyState.d.ts +11 -1
  30. package/dist/states/EmptyState.js +3 -2
  31. package/dist/states/EmptyState.js.map +1 -1
  32. package/dist/states/ErrorState.d.ts +3 -1
  33. package/dist/states/ErrorState.js +3 -2
  34. package/dist/states/ErrorState.js.map +1 -1
  35. package/dist/states/LoadingState.d.ts +3 -1
  36. package/dist/states/LoadingState.js +3 -2
  37. package/dist/states/LoadingState.js.map +1 -1
  38. package/package.json +1 -1
  39. package/themes/default.css +12 -0
@@ -5,10 +5,12 @@ export interface DetailRow {
5
5
  value: ReactNode;
6
6
  }
7
7
  export interface DetailListProps {
8
+ /** Composed after the kit's own classes (design principle 2). */
9
+ className?: string;
8
10
  rows: DetailRow[];
9
11
  }
10
12
  /**
11
13
  * Read-only key/value display for detail screens. Uses a description list so the
12
14
  * label/value relationship is conveyed to assistive technology.
13
15
  */
14
- export declare function DetailList({ rows }: DetailListProps): import("react").JSX.Element;
16
+ export declare function DetailList({ rows, className }: DetailListProps): import("react").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from '../lib/cx.js';
2
3
  /**
3
4
  * Read-only key/value display for detail screens. Uses a description list so the
4
5
  * label/value relationship is conveyed to assistive technology.
5
6
  */
6
- export function DetailList({ rows }) {
7
- return (_jsx("dl", { className: "flex flex-col gap-x-slot-detail-gap", children: rows.map((row) => (_jsxs("div", { className: "flex flex-col gap-x-slot-detail-row-gap border-b border-border py-x-slot-detail-row-pad-y", children: [_jsx("dt", { className: "font-sans font-medium text-text-muted", children: row.label }), _jsx("dd", { className: "font-sans text-text-primary", children: row.value })] }, row.label))) }));
7
+ export function DetailList({ rows, className }) {
8
+ return (_jsx("dl", { className: cx('flex flex-col gap-x-slot-detail-gap', className), children: rows.map((row) => (_jsxs("div", { className: "flex flex-col gap-x-slot-detail-row-gap border-b border-border py-x-slot-detail-row-pad-y", children: [_jsx("dt", { className: "font-sans font-medium text-text-muted", children: row.label }), _jsx("dd", { className: "font-sans text-text-primary", children: row.value })] }, row.label))) }));
8
9
  }
9
10
  //# sourceMappingURL=DetailList.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DetailList.js","sourceRoot":"","sources":["../../src/data/DetailList.tsx"],"names":[],"mappings":";AAYA;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAmB;IAClD,OAAO,CACL,aAAI,SAAS,EAAC,qCAAqC,YAChD,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,eAEE,SAAS,EAAC,2FAA2F,aAErG,aAAI,SAAS,EAAC,uCAAuC,YAAE,GAAG,CAAC,KAAK,GAAM,EACtE,aAAI,SAAS,EAAC,6BAA6B,YAAE,GAAG,CAAC,KAAK,GAAM,KAJvD,GAAG,CAAC,KAAK,CAKV,CACP,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"DetailList.js","sourceRoot":"","sources":["../../src/data/DetailList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAclC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAmB;IAC7D,OAAO,CACL,aAAI,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,SAAS,CAAC,YAChE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,eAEE,SAAS,EAAC,2FAA2F,aAErG,aAAI,SAAS,EAAC,uCAAuC,YAAE,GAAG,CAAC,KAAK,GAAM,EACtE,aAAI,SAAS,EAAC,6BAA6B,YAAE,GAAG,CAAC,KAAK,GAAM,KAJvD,GAAG,CAAC,KAAK,CAKV,CACP,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export interface InlineAlertProps {
3
3
  /** What the message means. `danger` is announced assertively; `info` politely. */
4
- tone?: 'info' | 'danger';
4
+ tone?: 'info' | 'warn' | 'danger';
5
5
  children: ReactNode;
6
6
  }
7
7
  /**
@@ -2,6 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cx } from '../lib/cx.js';
3
3
  const TONE_CLASS = {
4
4
  info: 'bg-surface text-text-primary border-border',
5
+ // `warn` reuses the danger colour deliberately: the kit's palette has one alert hue, and
6
+ // inventing a second here would be a design value living outside themes/default.css. What
7
+ // differs is the urgency it is announced with, which is the part that matters.
8
+ warn: 'bg-surface text-danger border-danger',
5
9
  danger: 'bg-surface text-danger border-danger',
6
10
  };
7
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"InlineAlert.js","sourceRoot":"","sources":["../../src/feedback/InlineAlert.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAQlC,MAAM,UAAU,GAA0D;IACxE,IAAI,EAAE,4CAA4C;IAClD,MAAM,EAAE,sCAAsC;CAC/C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,EAAoB;IACvE,OAAO,CACL,cACE,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAC5C,SAAS,EAAE,EAAE,CAAC,0DAA0D,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,YAE1F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"InlineAlert.js","sourceRoot":"","sources":["../../src/feedback/InlineAlert.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAQlC,MAAM,UAAU,GAA0D;IACxE,IAAI,EAAE,4CAA4C;IAClD,yFAAyF;IACzF,0FAA0F;IAC1F,+EAA+E;IAC/E,IAAI,EAAE,sCAAsC;IAC5C,MAAM,EAAE,sCAAsC;CAC/C,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,EAAE,QAAQ,EAAoB;IACvE,OAAO,CACL,cACE,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAC5C,SAAS,EAAE,EAAE,CAAC,0DAA0D,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,YAE1F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import { cx } from '../lib/cx.js';
4
- import { CONTROL_CLASS } from '../lib/states.js';
4
+ import { CLICKABLE_CLASS } from '../lib/states.js';
5
5
  import { ToastContext } from './toast-context.js';
6
6
  const TONE_CLASS = {
7
7
  info: 'bg-surface-raised text-text-primary border-border',
@@ -50,7 +50,7 @@ export function ToastProvider({ regionLabel, dismissLabel, defaultDurationMs = 5
50
50
  const api = useMemo(() => ({ show, dismiss }), [show, dismiss]);
51
51
  const region = (tone, live) => (_jsx("div", { "aria-live": live, "aria-label": regionLabel, role: "region", className: "flex flex-col gap-x-slot-toast-gap", children: toasts
52
52
  .filter((toast) => toast.tone === tone)
53
- .map((toast) => (_jsxs("div", { className: cx('flex items-start gap-x-slot-toast-gap rounded-x-slot-toast border p-x-slot-toast-pad font-sans shadow-sm', TONE_CLASS[toast.tone]), children: [_jsx("span", { children: toast.message }), _jsx("button", { type: "button", "aria-label": dismissLabel, onClick: () => dismiss(toast.id), className: cx('rounded-x-slot-toast px-x-slot-toast-dismiss-pad-x', CONTROL_CLASS), children: dismissLabel })] }, toast.id))) }));
53
+ .map((toast) => (_jsxs("div", { className: cx('flex items-start gap-x-slot-toast-gap rounded-x-slot-toast border p-x-slot-toast-pad font-sans shadow-sm', TONE_CLASS[toast.tone]), children: [_jsx("span", { children: toast.message }), _jsx("button", { type: "button", "aria-label": dismissLabel, onClick: () => dismiss(toast.id), className: cx('rounded-x-slot-toast px-x-slot-toast-dismiss-pad-x', CLICKABLE_CLASS), children: dismissLabel })] }, toast.id))) }));
54
54
  return (_jsxs(ToastContext.Provider, { value: api, children: [children, region('info', 'polite'), region('danger', 'assertive')] }));
55
55
  }
56
56
  //# sourceMappingURL=ToastProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"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Q,EAAE,WAAW,CAAC,IACR,CACzB,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -30,5 +30,5 @@ export { DataTable, type DataTableProps, type DataColumn } from './data/DataTabl
30
30
  export { Pagination, type PaginationProps } from './data/Pagination.js';
31
31
  export { tokens } from './theme/tokens.js';
32
32
  export { cx } from './lib/cx.js';
33
- export { CONTROL_CLASS, DISABLED_CLASS, FOCUS_CLASS } from './lib/states.js';
33
+ export { CLICKABLE_CLASS, CONTROL_CLASS, DISABLED_CLASS, FOCUS_CLASS, HOVER_CLASS, } from './lib/states.js';
34
34
  export { SOURCE_PROBE_CLASS } from './lib/source-probe.js';
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ export { tokens } from './theme/tokens.js';
41
41
  export { cx } from './lib/cx.js';
42
42
  // Controls the kit does not ship yet (Textarea has 7 independent implementations in the
43
43
  // fleet) can at least carry the same focus and disabled behaviour instead of inventing it.
44
- export { CONTROL_CLASS, DISABLED_CLASS, FOCUS_CLASS } from './lib/states.js';
44
+ export { CLICKABLE_CLASS, CONTROL_CLASS, DISABLED_CLASS, FOCUS_CLASS, HOVER_CLASS, } from './lib/states.js';
45
45
  // Lets a consumer's build prove the kit is in its Tailwind `@source` (#316).
46
46
  export { SOURCE_PROBE_CLASS } from './lib/source-probe.js';
47
47
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,EAAE,MAAM,EAAoB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAmB,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAoB,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAqB,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAkB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,QAAQ,E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classes (design principle 2). */
4
+ className?: string;
3
5
  /** Localized page title. */
4
6
  title: string;
5
7
  actions?: ReactNode;
6
8
  }
7
- export declare function PageHeader({ title, actions }: PageHeaderProps): import("react").JSX.Element;
9
+ export declare function PageHeader({ title, actions, className }: PageHeaderProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export function PageHeader({ title, actions }) {
3
- return (_jsxs("header", { className: "flex items-center justify-between py-x-slot-page-header-pad-y", children: [_jsx("h1", { className: "font-sans font-medium text-text-primary", children: title }), actions] }));
2
+ import { cx } from '../lib/cx.js';
3
+ export function PageHeader({ title, actions, className }) {
4
+ return (_jsxs("header", { className: cx('flex items-center justify-between py-x-slot-page-header-pad-y', className), children: [_jsx("h1", { className: "font-sans font-medium text-text-primary", children: title }), actions] }));
4
5
  }
5
6
  //# sourceMappingURL=PageHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../src/layout/PageHeader.tsx"],"names":[],"mappings":";AAQA,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAmB;IAC5D,OAAO,CACL,kBAAQ,SAAS,EAAC,+DAA+D,aAC/E,aAAI,SAAS,EAAC,yCAAyC,YAAE,KAAK,GAAM,EACnE,OAAO,IACD,CACV,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"PageHeader.js","sourceRoot":"","sources":["../../src/layout/PageHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAUlC,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAmB;IACvE,OAAO,CACL,kBACE,SAAS,EAAE,EAAE,CAAC,+DAA+D,EAAE,SAAS,CAAC,aAEzF,aAAI,SAAS,EAAC,yCAAyC,YAAE,KAAK,GAAM,EACnE,OAAO,IACD,CACV,CAAC;AACJ,CAAC"}
@@ -50,5 +50,20 @@ export declare const FOCUS_CLASS = "focus-visible:outline-2 focus-visible:outlin
50
50
  * literal here would be a design value living outside themes/default.css.
51
51
  */
52
52
  export declare const DISABLED_CLASS = "disabled:opacity-x-disabled disabled:cursor-not-allowed";
53
+ /**
54
+ * Pointer feedback for anything clickable.
55
+ *
56
+ * 🔴 The third hole of the same shape. v0.1 shipped with no disabled and no focus styling;
57
+ * 0.4.0 is where the kit stops shipping without hover and press. The fleet writes them
58
+ * anyway — measured 2026-08-23 across seven products, though only three of them show up if
59
+ * you grep for Tailwind classes: nene-invoice, nene-deal, nene-profile and nene-serve
60
+ * declare theirs in CSS (`background` 55 times, `color` 42, `border-color` 17). Counting one
61
+ * spelling of a thing that has two is how the first two holes stayed open.
62
+ *
63
+ * `disabled:` is excluded on purpose: a disabled control must not react to the pointer.
64
+ */
65
+ export declare const HOVER_CLASS = "hover:brightness-x-slot-hover active:brightness-x-slot-press disabled:hover:brightness-100 disabled:active:brightness-100";
53
66
  /** Controls that can be focused and disabled — every interactive primitive in the kit. */
54
67
  export declare const CONTROL_CLASS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-text-primary disabled:opacity-x-disabled disabled:cursor-not-allowed";
68
+ /** Controls that are also clicked: buttons, switches, the toast dismiss. */
69
+ export declare const CLICKABLE_CLASS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-text-primary disabled:opacity-x-disabled disabled:cursor-not-allowed hover:brightness-x-slot-hover active:brightness-x-slot-press disabled:hover:brightness-100 disabled:active:brightness-100";
@@ -50,6 +50,21 @@ export const FOCUS_CLASS = 'focus-visible:outline-2 focus-visible:outline-offset
50
50
  * literal here would be a design value living outside themes/default.css.
51
51
  */
52
52
  export const DISABLED_CLASS = 'disabled:opacity-x-disabled disabled:cursor-not-allowed';
53
+ /**
54
+ * Pointer feedback for anything clickable.
55
+ *
56
+ * 🔴 The third hole of the same shape. v0.1 shipped with no disabled and no focus styling;
57
+ * 0.4.0 is where the kit stops shipping without hover and press. The fleet writes them
58
+ * anyway — measured 2026-08-23 across seven products, though only three of them show up if
59
+ * you grep for Tailwind classes: nene-invoice, nene-deal, nene-profile and nene-serve
60
+ * declare theirs in CSS (`background` 55 times, `color` 42, `border-color` 17). Counting one
61
+ * spelling of a thing that has two is how the first two holes stayed open.
62
+ *
63
+ * `disabled:` is excluded on purpose: a disabled control must not react to the pointer.
64
+ */
65
+ export const HOVER_CLASS = 'hover:brightness-x-slot-hover active:brightness-x-slot-press disabled:hover:brightness-100 disabled:active:brightness-100';
53
66
  /** Controls that can be focused and disabled — every interactive primitive in the kit. */
54
67
  export const CONTROL_CLASS = `${FOCUS_CLASS} ${DISABLED_CLASS}`;
68
+ /** Controls that are also clicked: buttons, switches, the toast dismiss. */
69
+ export const CLICKABLE_CLASS = `${CONTROL_CLASS} ${HOVER_CLASS}`;
55
70
  //# sourceMappingURL=states.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"states.js","sourceRoot":"","sources":["../../src/lib/states.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GACtB,2FAA2F,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,yDAAyD,CAAC;AAExF,0FAA0F;AAC1F,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,WAAW,IAAI,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"states.js","sourceRoot":"","sources":["../../src/lib/states.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,WAAW,GACtB,2FAA2F,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,yDAAyD,CAAC;AAExF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GACtB,2HAA2H,CAAC;AAE9H,0FAA0F;AAC1F,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,WAAW,IAAI,cAAc,EAAE,CAAC;AAEhE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,aAAa,IAAI,WAAW,EAAE,CAAC"}
@@ -1,6 +1,13 @@
1
1
  import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
2
  export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
- variant?: 'primary' | 'secondary' | 'danger';
3
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
4
+ /**
5
+ * Two sizes, not a length. `sm` for dense rows and toolbars.
6
+ *
7
+ * Structure, not a design value: the caller picks one of two arrangements and cannot
8
+ * write a padding of its own (design principle 3).
9
+ */
10
+ size?: 'md' | 'sm';
4
11
  children: ReactNode;
5
12
  }
6
- export declare function Button({ variant, children, type, className, ...rest }: ButtonProps): import("react").JSX.Element;
13
+ export declare function Button({ variant, size, children, type, className, ...rest }: ButtonProps): import("react").JSX.Element;
@@ -1,13 +1,20 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cx } from '../lib/cx.js';
3
- import { CONTROL_CLASS } from '../lib/states.js';
3
+ import { CLICKABLE_CLASS } from '../lib/states.js';
4
4
  const VARIANT_CLASS = {
5
5
  primary: 'bg-accent text-on-accent',
6
6
  secondary: 'bg-surface-raised text-text-primary border border-border',
7
7
  danger: 'bg-danger text-on-accent',
8
+ // No fill and no border: for the third action in a row, where two framed buttons would
9
+ // compete with each other. nene-vault ships this variant already.
10
+ ghost: 'bg-transparent text-text-primary',
8
11
  };
9
- const BASE_CLASS = `rounded-x-slot-button px-x-slot-button-pad-x py-x-slot-button-pad-y font-sans font-medium ${CONTROL_CLASS}`;
10
- export function Button({ variant = 'primary', children, type = 'button', className, ...rest }) {
11
- return (_jsx("button", { type: type, className: cx(BASE_CLASS, VARIANT_CLASS[variant], className), ...rest, children: children }));
12
+ const SIZE_CLASS = {
13
+ md: 'px-x-slot-button-pad-x py-x-slot-button-pad-y',
14
+ sm: 'px-x-slot-button-sm-pad-x py-x-slot-button-sm-pad-y',
15
+ };
16
+ const BASE_CLASS = `rounded-x-slot-button font-sans font-medium ${CLICKABLE_CLASS}`;
17
+ export function Button({ variant = 'primary', size = 'md', children, type = 'button', className, ...rest }) {
18
+ return (_jsx("button", { type: type, className: cx(BASE_CLASS, SIZE_CLASS[size], VARIANT_CLASS[variant], className), ...rest, children: children }));
12
19
  }
13
20
  //# sourceMappingURL=Button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/primitives/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,MAAM,aAAa,GAAwD;IACzE,OAAO,EAAE,0BAA0B;IACnC,SAAS,EAAE,0DAA0D;IACrE,MAAM,EAAE,0BAA0B;CACnC,CAAC;AAEF,MAAM,UAAU,GAAG,6FAA6F,aAAa,EAAE,CAAC;AAEhI,MAAM,UAAU,MAAM,CAAC,EACrB,OAAO,GAAG,SAAS,EACnB,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,GAAG,IAAI,EACK;IACZ,OAAO,CACL,iBAAQ,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,KAAM,IAAI,YACvF,QAAQ,GACF,CACV,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/primitives/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAcnD,MAAM,aAAa,GAAwD;IACzE,OAAO,EAAE,0BAA0B;IACnC,SAAS,EAAE,0DAA0D;IACrE,MAAM,EAAE,0BAA0B;IAClC,uFAAuF;IACvF,kEAAkE;IAClE,KAAK,EAAE,kCAAkC;CAC1C,CAAC;AAEF,MAAM,UAAU,GAAqD;IACnE,EAAE,EAAE,+CAA+C;IACnD,EAAE,EAAE,qDAAqD;CAC1D,CAAC;AAEF,MAAM,UAAU,GAAG,+CAA+C,eAAe,EAAE,CAAC;AAEpF,MAAM,UAAU,MAAM,CAAC,EACrB,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,QAAQ,EACR,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,GAAG,IAAI,EACK;IACZ,OAAO,CACL,iBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,KAC1E,IAAI,YAEP,QAAQ,GACF,CACV,CAAC;AACJ,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export interface SpinnerProps {
2
+ /** Composed after the kit's own classes (design principle 2). */
3
+ className?: string;
2
4
  /** Localized loading text. The kit never ships strings — see README. */
3
5
  label: string;
4
6
  }
5
- export declare function Spinner({ label }: SpinnerProps): import("react").JSX.Element;
7
+ export declare function Spinner({ label, className }: SpinnerProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export function Spinner({ label }) {
3
- return (_jsx("output", { className: "font-sans text-text-muted", "aria-live": "polite", children: label }));
2
+ import { cx } from '../lib/cx.js';
3
+ export function Spinner({ label, className }) {
4
+ return (_jsx("output", { className: cx('font-sans text-text-muted', className), "aria-live": "polite", children: label }));
4
5
  }
5
6
  //# sourceMappingURL=Spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../src/primitives/Spinner.tsx"],"names":[],"mappings":";AAKA,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAgB;IAC7C,OAAO,CACL,iBAAQ,SAAS,EAAC,2BAA2B,eAAW,QAAQ,YAC7D,KAAK,GACC,CACV,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../src/primitives/Spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAQlC,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAgB;IACxD,OAAO,CACL,iBAAQ,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,SAAS,CAAC,eAAY,QAAQ,YAC9E,KAAK,GACC,CACV,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import { cx } from '../lib/cx.js';
4
- import { CONTROL_CLASS } from '../lib/states.js';
4
+ import { CLICKABLE_CLASS } from '../lib/states.js';
5
5
  /**
6
6
  * An on/off control that takes effect immediately.
7
7
  *
@@ -14,6 +14,6 @@ import { CONTROL_CLASS } from '../lib/states.js';
14
14
  * `aria-checked` carries the state; the visible track is decoration on top of it.
15
15
  */
16
16
  export const Switch = forwardRef(function Switch({ checked, onCheckedChange, label, className, ...rest }, ref) {
17
- return (_jsx("button", { ref: ref, type: "button", role: "switch", "aria-checked": checked, "aria-label": label, onClick: () => onCheckedChange(!checked), className: cx('inline-flex items-center rounded-x-slot-switch border border-border px-x-slot-switch-pad-x py-x-slot-switch-pad-y font-sans', checked ? 'bg-accent text-on-accent' : 'bg-surface text-text-muted', CONTROL_CLASS, className), ...rest, children: label }));
17
+ return (_jsx("button", { ref: ref, type: "button", role: "switch", "aria-checked": checked, "aria-label": label, onClick: () => onCheckedChange(!checked), className: cx('inline-flex items-center rounded-x-slot-switch border border-border px-x-slot-switch-pad-x py-x-slot-switch-pad-y font-sans', checked ? 'bg-accent text-on-accent' : 'bg-surface text-text-muted', CLICKABLE_CLASS, className), ...rest, children: label }));
18
18
  });
19
19
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/primitives/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAUjD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CAC9E,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EACvD,GAAG;IAEH,OAAO,CACL,iBACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,kBACC,OAAO,gBACT,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EACxC,SAAS,EAAE,EAAE,CACX,6HAA6H,EAC7H,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,4BAA4B,EACnE,aAAa,EACb,SAAS,CACV,KACG,IAAI,YAEP,KAAK,GACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../src/primitives/Switch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAUnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CAC9E,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EACvD,GAAG;IAEH,OAAO,CACL,iBACE,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,kBACC,OAAO,gBACT,KAAK,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EACxC,SAAS,EAAE,EAAE,CACX,6HAA6H,EAC7H,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,4BAA4B,EACnE,eAAe,EACf,SAAS,CACV,KACG,IAAI,YAEP,KAAK,GACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export interface TextProps {
3
+ /** Composed after the kit's own classes (design principle 2). */
4
+ className?: string;
3
5
  as?: 'p' | 'span';
4
6
  tone?: 'primary' | 'muted';
5
7
  children: ReactNode;
6
8
  }
7
- export declare function Text({ as, tone, children }: TextProps): import("react").JSX.Element;
9
+ export declare function Text({ as, tone, children, className }: TextProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export function Text({ as = 'p', tone = 'primary', children }) {
3
- const className = `font-sans ${tone === 'muted' ? 'text-text-muted' : 'text-text-primary'}`;
4
- return as === 'span' ? (_jsx("span", { className: className, children: children })) : (_jsx("p", { className: className, children: children }));
2
+ import { cx } from '../lib/cx.js';
3
+ export function Text({ as = 'p', tone = 'primary', children, className }) {
4
+ const merged = cx('font-sans', tone === 'muted' ? 'text-text-muted' : 'text-text-primary', className);
5
+ return as === 'span' ? (_jsx("span", { className: merged, children: children })) : (_jsx("p", { className: merged, children: children }));
5
6
  }
6
7
  //# sourceMappingURL=Text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/primitives/Text.tsx"],"names":[],"mappings":";AAQA,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAa;IACtE,MAAM,SAAS,GAAG,aAAa,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAAmB,EAAE,CAAC;IAE5F,OAAO,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,CACrB,eAAM,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAQ,CAC9C,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAE,SAAS,YAAG,QAAQ,GAAK,CACxC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/primitives/Text.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAUlC,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAa;IACjF,MAAM,MAAM,GAAG,EAAE,CACf,WAAW,EACX,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAAmB,EAC1D,SAAS,CACV,CAAC;IAEF,OAAO,EAAE,KAAK,MAAM,CAAC,CAAC,CAAC,CACrB,eAAM,SAAS,EAAE,MAAM,YAAG,QAAQ,GAAQ,CAC3C,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAE,MAAM,YAAG,QAAQ,GAAK,CACrC,CAAC;AACJ,CAAC"}
@@ -1,5 +1,15 @@
1
1
  export interface EmptyStateProps {
2
+ /** Composed after the kit's own classes (design principle 2). */
3
+ className?: string;
4
+ /**
5
+ * Horizontal alignment. Centre by default — measured across the fleet on 2026-08-23,
6
+ * five of the six products that ship an EmptyState centre it.
7
+ *
8
+ * A choice between two arrangements, not a value: `align="start"` is structure, and
9
+ * design principle 3 bars design *values* from props, not structural options.
10
+ */
11
+ align?: 'center' | 'start';
2
12
  /** Localized message. The kit never ships strings — see README. */
3
13
  message: string;
4
14
  }
5
- export declare function EmptyState({ message }: EmptyStateProps): import("react").JSX.Element;
15
+ export declare function EmptyState({ message, align, className }: EmptyStateProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- export function EmptyState({ message }) {
3
- return (_jsx("div", { className: "py-x-slot-state-pad-y font-sans text-text-muted", role: "status", children: message }));
2
+ import { cx } from '../lib/cx.js';
3
+ export function EmptyState({ message, align = 'center', className }) {
4
+ return (_jsx("div", { className: cx('py-x-slot-state-pad-y font-sans text-text-muted', align === 'center' && 'text-center', className), role: "status", children: message }));
4
5
  }
5
6
  //# sourceMappingURL=EmptyState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/states/EmptyState.tsx"],"names":[],"mappings":";AAKA,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAmB;IACrD,OAAO,CACL,cAAK,SAAS,EAAC,iDAAiD,EAAC,IAAI,EAAC,QAAQ,YAC3E,OAAO,GACJ,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"EmptyState.js","sourceRoot":"","sources":["../../src/states/EmptyState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAgBlC,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,KAAK,GAAG,QAAQ,EAAE,SAAS,EAAmB;IAClF,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,iDAAiD,EACjD,KAAK,KAAK,QAAQ,IAAI,aAAa,EACnC,SAAS,CACV,EACD,IAAI,EAAC,QAAQ,YAEZ,OAAO,GACJ,CACP,CAAC;AACJ,CAAC"}
@@ -1,8 +1,10 @@
1
1
  export interface ErrorStateProps {
2
+ /** Composed after the kit's own classes (design principle 2). */
3
+ className?: string;
2
4
  /** Localized message. */
3
5
  message: string;
4
6
  /** Localized label for the retry control. */
5
7
  retryLabel: string;
6
8
  onRetry: () => void;
7
9
  }
8
- export declare function ErrorState({ message, retryLabel, onRetry }: ErrorStateProps): import("react").JSX.Element;
10
+ export declare function ErrorState({ message, retryLabel, onRetry, className }: ErrorStateProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from '../primitives/Button.js';
3
- export function ErrorState({ message, retryLabel, onRetry }) {
4
- return (_jsxs("div", { className: "py-x-slot-state-pad-y", role: "alert", children: [_jsx("p", { className: "font-sans text-danger", children: message }), _jsx("div", { className: "py-x-slot-state-action-pad-y", children: _jsx(Button, { variant: "secondary", onClick: onRetry, children: retryLabel }) })] }));
3
+ import { cx } from '../lib/cx.js';
4
+ export function ErrorState({ message, retryLabel, onRetry, className }) {
5
+ return (_jsxs("div", { className: cx('py-x-slot-state-pad-y', className), role: "alert", children: [_jsx("p", { className: "font-sans text-danger", children: message }), _jsx("div", { className: "py-x-slot-state-action-pad-y", children: _jsx(Button, { variant: "secondary", onClick: onRetry, children: retryLabel }) })] }));
5
6
  }
6
7
  //# sourceMappingURL=ErrorState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState.js","sourceRoot":"","sources":["../../src/states/ErrorState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAUjD,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAmB;IAC1E,OAAO,CACL,eAAK,SAAS,EAAC,uBAAuB,EAAC,IAAI,EAAC,OAAO,aACjD,YAAG,SAAS,EAAC,uBAAuB,YAAE,OAAO,GAAK,EAClD,cAAK,SAAS,EAAC,8BAA8B,YAC3C,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,OAAO,YACzC,UAAU,GACJ,GACL,IACF,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ErrorState.js","sourceRoot":"","sources":["../../src/states/ErrorState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAYlC,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAmB;IACrF,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,EAAE,IAAI,EAAC,OAAO,aAClE,YAAG,SAAS,EAAC,uBAAuB,YAAE,OAAO,GAAK,EAClD,cAAK,SAAS,EAAC,8BAA8B,YAC3C,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,OAAO,YACzC,UAAU,GACJ,GACL,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export interface LoadingStateProps {
2
+ /** Composed after the kit's own classes (design principle 2). */
3
+ className?: string;
2
4
  /** Localized message announced while the work is in flight. */
3
5
  label: string;
4
6
  }
@@ -15,4 +17,4 @@ export interface LoadingStateProps {
15
17
  * and a live region wrapped in another live region is announced twice. `aria-busy` marks
16
18
  * the region as in-flight without adding a second announcer.
17
19
  */
18
- export declare function LoadingState({ label }: LoadingStateProps): import("react").JSX.Element;
20
+ export declare function LoadingState({ label, className }: LoadingStateProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Spinner } from '../primitives/Spinner.js';
3
+ import { cx } from '../lib/cx.js';
3
4
  /**
4
5
  * The third of the three states.
5
6
  *
@@ -13,7 +14,7 @@ import { Spinner } from '../primitives/Spinner.js';
13
14
  * and a live region wrapped in another live region is announced twice. `aria-busy` marks
14
15
  * the region as in-flight without adding a second announcer.
15
16
  */
16
- export function LoadingState({ label }) {
17
- return (_jsx("div", { className: "py-x-slot-state-pad-y", "aria-busy": "true", children: _jsx(Spinner, { label: label }) }));
17
+ export function LoadingState({ label, className }) {
18
+ return (_jsx("div", { className: cx('py-x-slot-state-pad-y', className), "aria-busy": "true", children: _jsx(Spinner, { label: label }) }));
18
19
  }
19
20
  //# sourceMappingURL=LoadingState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingState.js","sourceRoot":"","sources":["../../src/states/LoadingState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAOnD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAqB;IACvD,OAAO,CACL,cAAK,SAAS,EAAC,uBAAuB,eAAW,MAAM,YACrD,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,GACrB,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"LoadingState.js","sourceRoot":"","sources":["../../src/states/LoadingState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AASlC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAqB;IAClE,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,eAAY,MAAM,YACtE,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,GACrB,CACP,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hideyukimori/nene2-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "NeNe fleet shared React UI kit — token-driven primitives on Tailwind v4 @theme. Components carry no design of their own; themes do.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,6 +52,8 @@
52
52
  * ───────────────────────────────────────────────────────────────────────── */
53
53
  --spacing-x-slot-button-pad-x: var(--spacing-x-sm);
54
54
  --spacing-x-slot-button-pad-y: var(--spacing-x-xs);
55
+ --spacing-x-slot-button-sm-pad-x: var(--spacing-x-xs);
56
+ --spacing-x-slot-button-sm-pad-y: var(--spacing-x-3xs);
55
57
  --spacing-x-slot-control-pad-x: var(--spacing-x-2xs);
56
58
  --spacing-x-slot-control-pad-y: var(--spacing-x-xs);
57
59
  --spacing-x-slot-field-gap: var(--spacing-x-2xs);
@@ -83,6 +85,16 @@
83
85
  --radius-x-slot-modal: var(--radius-x-md);
84
86
  --radius-x-slot-card: var(--radius-x-md);
85
87
 
88
+ /* Pointer feedback. One rule for every variant, rather than a hover colour per fill:
89
+ * the kit's buttons are filled with three different colours, and a palette entry for each
90
+ * hover state would be three more values a product has to keep in step. Darkening works on
91
+ * all of them — including the white `secondary` fill, where the fleet's own
92
+ * `hover:brightness-105` does nothing at all.
93
+ *
94
+ * Tailwind wraps `hover:` in `@media (hover: hover)`, so this does not stick on touch. */
95
+ --brightness-x-slot-hover: 95%;
96
+ --brightness-x-slot-press: 90%;
97
+
86
98
  --color-x-slot-field-label: var(--color-text-muted);
87
99
  --text-x-slot-field-label-size: 0.75rem;
88
100
  --font-weight-x-slot-field-label: 500;