@hideyukimori/nene2-ui 0.2.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/LICENSE +21 -0
- package/README.md +192 -0
- package/dist/data/DataTable.d.ts +32 -0
- package/dist/data/DataTable.js +17 -0
- package/dist/data/DataTable.js.map +1 -0
- package/dist/data/DetailList.d.ts +14 -0
- package/dist/data/DetailList.js +9 -0
- package/dist/data/DetailList.js.map +1 -0
- package/dist/data/Pagination.d.ts +26 -0
- package/dist/data/Pagination.js +20 -0
- package/dist/data/Pagination.js.map +1 -0
- package/dist/feedback/Badge.d.ts +14 -0
- package/dist/feedback/Badge.js +18 -0
- package/dist/feedback/Badge.js.map +1 -0
- package/dist/feedback/InlineAlert.d.ts +15 -0
- package/dist/feedback/InlineAlert.js +18 -0
- package/dist/feedback/InlineAlert.js.map +1 -0
- package/dist/feedback/ToastProvider.d.ts +31 -0
- package/dist/feedback/ToastProvider.js +56 -0
- package/dist/feedback/ToastProvider.js.map +1 -0
- package/dist/feedback/toast-context.d.ts +20 -0
- package/dist/feedback/toast-context.js +17 -0
- package/dist/feedback/toast-context.js.map +1 -0
- package/dist/forms/FormField.d.ts +47 -0
- package/dist/forms/FormField.js +25 -0
- package/dist/forms/FormField.js.map +1 -0
- package/dist/forms/field-context.d.ts +54 -0
- package/dist/forms/field-context.js +51 -0
- package/dist/forms/field-context.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/Box.d.ts +20 -0
- package/dist/layout/Box.js +17 -0
- package/dist/layout/Box.js.map +1 -0
- package/dist/layout/Card.d.ts +16 -0
- package/dist/layout/Card.js +13 -0
- package/dist/layout/Card.js.map +1 -0
- package/dist/layout/Grid.d.ts +15 -0
- package/dist/layout/Grid.js +7 -0
- package/dist/layout/Grid.js.map +1 -0
- package/dist/layout/PageHeader.d.ts +7 -0
- package/dist/layout/PageHeader.js +5 -0
- package/dist/layout/PageHeader.js.map +1 -0
- package/dist/layout/Section.d.ts +16 -0
- package/dist/layout/Section.js +14 -0
- package/dist/layout/Section.js.map +1 -0
- package/dist/layout/Stack.d.ts +20 -0
- package/dist/layout/Stack.js +24 -0
- package/dist/layout/Stack.js.map +1 -0
- package/dist/lib/cx.d.ts +12 -0
- package/dist/lib/cx.js +15 -0
- package/dist/lib/cx.js.map +1 -0
- package/dist/lib/source-probe.d.ts +28 -0
- package/dist/lib/source-probe.js +29 -0
- package/dist/lib/source-probe.js.map +1 -0
- package/dist/lib/spacing.d.ts +54 -0
- package/dist/lib/spacing.js +85 -0
- package/dist/lib/spacing.js.map +1 -0
- package/dist/lib/states.d.ts +44 -0
- package/dist/lib/states.js +45 -0
- package/dist/lib/states.js.map +1 -0
- package/dist/overlay/ConfirmDialog.d.ts +24 -0
- package/dist/overlay/ConfirmDialog.js +17 -0
- package/dist/overlay/ConfirmDialog.js.map +1 -0
- package/dist/overlay/Modal.d.ts +24 -0
- package/dist/overlay/Modal.js +47 -0
- package/dist/overlay/Modal.js.map +1 -0
- package/dist/primitives/Button.d.ts +6 -0
- package/dist/primitives/Button.js +13 -0
- package/dist/primitives/Button.js.map +1 -0
- package/dist/primitives/Checkbox.d.ts +14 -0
- package/dist/primitives/Checkbox.js +19 -0
- package/dist/primitives/Checkbox.js.map +1 -0
- package/dist/primitives/Icon.d.ts +38 -0
- package/dist/primitives/Icon.js +38 -0
- package/dist/primitives/Icon.js.map +1 -0
- package/dist/primitives/Input.d.ts +7 -0
- package/dist/primitives/Input.js +15 -0
- package/dist/primitives/Input.js.map +1 -0
- package/dist/primitives/Radio.d.ts +19 -0
- package/dist/primitives/Radio.js +20 -0
- package/dist/primitives/Radio.js.map +1 -0
- package/dist/primitives/Select.d.ts +9 -0
- package/dist/primitives/Select.js +15 -0
- package/dist/primitives/Select.js.map +1 -0
- package/dist/primitives/Spinner.d.ts +5 -0
- package/dist/primitives/Spinner.js +5 -0
- package/dist/primitives/Spinner.js.map +1 -0
- package/dist/primitives/Switch.d.ts +19 -0
- package/dist/primitives/Switch.js +19 -0
- package/dist/primitives/Switch.js.map +1 -0
- package/dist/primitives/Text.d.ts +7 -0
- package/dist/primitives/Text.js +6 -0
- package/dist/primitives/Text.js.map +1 -0
- package/dist/primitives/Textarea.d.ts +11 -0
- package/dist/primitives/Textarea.js +19 -0
- package/dist/primitives/Textarea.js.map +1 -0
- package/dist/states/EmptyState.d.ts +5 -0
- package/dist/states/EmptyState.js +5 -0
- package/dist/states/EmptyState.js.map +1 -0
- package/dist/states/ErrorState.d.ts +8 -0
- package/dist/states/ErrorState.js +6 -0
- package/dist/states/ErrorState.js.map +1 -0
- package/dist/states/LoadingState.d.ts +18 -0
- package/dist/states/LoadingState.js +19 -0
- package/dist/states/LoadingState.js.map +1 -0
- package/dist/theme/tokens.d.ts +19 -0
- package/dist/theme/tokens.js +20 -0
- package/dist/theme/tokens.js.map +1 -0
- package/package.json +41 -0
- package/themes/default.css +60 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'type'> {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onCheckedChange: (checked: boolean) => void;
|
|
5
|
+
/** Localized label. A switch with no name is a mystery toggle. */
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* An on/off control that takes effect immediately.
|
|
10
|
+
*
|
|
11
|
+
* 🔴 A `<button role="switch">`, not a styled checkbox. The common shape is an
|
|
12
|
+
* `<input type="checkbox">` with a sliding track drawn over it, which assistive technology
|
|
13
|
+
* announces as "checkbox, not checked" — the wrong control, in the wrong tense. A checkbox
|
|
14
|
+
* states an intention that a later Save applies; a switch *is* the action. Different
|
|
15
|
+
* meanings get different elements.
|
|
16
|
+
*
|
|
17
|
+
* `aria-checked` carries the state; the visible track is decoration on top of it.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { cx } from '../lib/cx.js';
|
|
4
|
+
import { CONTROL_CLASS } from '../lib/states.js';
|
|
5
|
+
/**
|
|
6
|
+
* An on/off control that takes effect immediately.
|
|
7
|
+
*
|
|
8
|
+
* 🔴 A `<button role="switch">`, not a styled checkbox. The common shape is an
|
|
9
|
+
* `<input type="checkbox">` with a sliding track drawn over it, which assistive technology
|
|
10
|
+
* announces as "checkbox, not checked" — the wrong control, in the wrong tense. A checkbox
|
|
11
|
+
* states an intention that a later Save applies; a switch *is* the action. Different
|
|
12
|
+
* meanings get different elements.
|
|
13
|
+
*
|
|
14
|
+
* `aria-checked` carries the state; the visible track is decoration on top of it.
|
|
15
|
+
*/
|
|
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-md border border-border px-x-2xs py-x-3xs font-sans', checked ? 'bg-accent text-on-accent' : 'bg-surface text-text-muted', CONTROL_CLASS, className), ...rest, children: label }));
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +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,wFAAwF,EACxF,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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
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 }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
3
|
+
/**
|
|
4
|
+
* Multi-line text input. Deliberately identical to `Input` apart from the element, so the
|
|
5
|
+
* two never drift: five ships wrote their own `Textarea.tsx` and the kit shipped without
|
|
6
|
+
* one, which is how a control ends up with five different focus rings.
|
|
7
|
+
*
|
|
8
|
+
* No `rows` default and no auto-resize — height is a screen's decision, and every ship that
|
|
9
|
+
* wanted one set it on the element already.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { cx } from '../lib/cx.js';
|
|
4
|
+
import { CONTROL_CLASS } from '../lib/states.js';
|
|
5
|
+
import { useFieldWiring } from '../forms/field-context.js';
|
|
6
|
+
const BASE_CLASS = `w-full rounded-x-md border border-border bg-surface-raised px-x-inline-sm py-x-stack-sm font-sans text-text-primary placeholder:text-text-muted ${CONTROL_CLASS}`;
|
|
7
|
+
/**
|
|
8
|
+
* Multi-line text input. Deliberately identical to `Input` apart from the element, so the
|
|
9
|
+
* two never drift: five ships wrote their own `Textarea.tsx` and the kit shipped without
|
|
10
|
+
* one, which is how a control ends up with five different focus rings.
|
|
11
|
+
*
|
|
12
|
+
* No `rows` default and no auto-resize — height is a screen's decision, and every ship that
|
|
13
|
+
* wanted one set it on the element already.
|
|
14
|
+
*/
|
|
15
|
+
export const Textarea = forwardRef(function Textarea({ className, id, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-required': ariaRequired, ...rest }, ref) {
|
|
16
|
+
const wiring = useFieldWiring({ id, ariaInvalid, ariaDescribedBy, ariaRequired });
|
|
17
|
+
return _jsx("textarea", { ref: ref, className: cx(BASE_CLASS, className), ...wiring, ...rest });
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=Textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/primitives/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA+B,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,MAAM,UAAU,GAAG,mJAAmJ,aAAa,EAAE,CAAC;AAEtL;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAqC,SAAS,QAAQ,CACtF,EACE,SAAS,EACT,EAAE,EACF,cAAc,EAAE,WAAW,EAC3B,kBAAkB,EAAE,eAAe,EACnC,eAAe,EAAE,YAAY,EAC7B,GAAG,IAAI,EACR,EACD,GAAG;IAEH,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,CAAC;IAElF,OAAO,mBAAU,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,KAAM,MAAM,KAAM,IAAI,GAAI,CAAC;AAC5F,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +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,yCAAyC,EAAC,IAAI,EAAC,QAAQ,YACnE,OAAO,GACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ErrorStateProps {
|
|
2
|
+
/** Localized message. */
|
|
3
|
+
message: string;
|
|
4
|
+
/** Localized label for the retry control. */
|
|
5
|
+
retryLabel: string;
|
|
6
|
+
onRetry: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ErrorState({ message, retryLabel, onRetry }: ErrorStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../primitives/Button.js';
|
|
3
|
+
export function ErrorState({ message, retryLabel, onRetry }) {
|
|
4
|
+
return (_jsxs("div", { className: "py-x-stack-lg", role: "alert", children: [_jsx("p", { className: "font-sans text-danger", children: message }), _jsx("div", { className: "py-x-stack-sm", children: _jsx(Button, { variant: "secondary", onClick: onRetry, children: retryLabel }) })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=ErrorState.js.map
|
|
@@ -0,0 +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,eAAe,EAAC,IAAI,EAAC,OAAO,aACzC,YAAG,SAAS,EAAC,uBAAuB,YAAE,OAAO,GAAK,EAClD,cAAK,SAAS,EAAC,eAAe,YAC5B,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,OAAO,YACzC,UAAU,GACJ,GACL,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface LoadingStateProps {
|
|
2
|
+
/** Localized message announced while the work is in flight. */
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The third of the three states.
|
|
7
|
+
*
|
|
8
|
+
* 🔴 The kit's own README says these ship as a set — "so a screen that handles only the
|
|
9
|
+
* happy path is visibly incomplete" — and then v0.1 shipped `EmptyState` and `ErrorState`
|
|
10
|
+
* without this one. Five ships wrote their own. A set documented as a set and delivered
|
|
11
|
+
* short is worse than no set: every screen author reads the principle, looks for the part,
|
|
12
|
+
* and writes their own.
|
|
13
|
+
*
|
|
14
|
+
* 🔴 The wrapper carries no `role="status"`. `Spinner` renders an `<output aria-live>`,
|
|
15
|
+
* and a live region wrapped in another live region is announced twice. `aria-busy` marks
|
|
16
|
+
* the region as in-flight without adding a second announcer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function LoadingState({ label }: LoadingStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner } from '../primitives/Spinner.js';
|
|
3
|
+
/**
|
|
4
|
+
* The third of the three states.
|
|
5
|
+
*
|
|
6
|
+
* 🔴 The kit's own README says these ship as a set — "so a screen that handles only the
|
|
7
|
+
* happy path is visibly incomplete" — and then v0.1 shipped `EmptyState` and `ErrorState`
|
|
8
|
+
* without this one. Five ships wrote their own. A set documented as a set and delivered
|
|
9
|
+
* short is worse than no set: every screen author reads the principle, looks for the part,
|
|
10
|
+
* and writes their own.
|
|
11
|
+
*
|
|
12
|
+
* 🔴 The wrapper carries no `role="status"`. `Spinner` renders an `<output aria-live>`,
|
|
13
|
+
* and a live region wrapped in another live region is announced twice. `aria-busy` marks
|
|
14
|
+
* the region as in-flight without adding a second announcer.
|
|
15
|
+
*/
|
|
16
|
+
export function LoadingState({ label }) {
|
|
17
|
+
return (_jsx("div", { className: "py-x-stack-lg", "aria-busy": "true", children: _jsx(Spinner, { label: label }) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=LoadingState.js.map
|
|
@@ -0,0 +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,eAAe,eAAW,MAAM,YAC7C,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,GAAI,GACrB,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only TS accessors for theme tokens, for programmatic use such as charts where a
|
|
3
|
+
* CSS class cannot be applied.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 These are `var()` references, never literal values — the CSS `@theme` block stays
|
|
6
|
+
* the single source of truth. Adding a literal here creates a second source that drifts.
|
|
7
|
+
*/
|
|
8
|
+
export declare const tokens: {
|
|
9
|
+
readonly color: {
|
|
10
|
+
readonly accent: "var(--color-accent)";
|
|
11
|
+
readonly danger: "var(--color-danger)";
|
|
12
|
+
readonly surface: "var(--color-surface)";
|
|
13
|
+
readonly surfaceRaised: "var(--color-surface-raised)";
|
|
14
|
+
readonly border: "var(--color-border)";
|
|
15
|
+
readonly textPrimary: "var(--color-text-primary)";
|
|
16
|
+
readonly textMuted: "var(--color-text-muted)";
|
|
17
|
+
readonly onAccent: "var(--color-on-accent)";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only TS accessors for theme tokens, for programmatic use such as charts where a
|
|
3
|
+
* CSS class cannot be applied.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 These are `var()` references, never literal values — the CSS `@theme` block stays
|
|
6
|
+
* the single source of truth. Adding a literal here creates a second source that drifts.
|
|
7
|
+
*/
|
|
8
|
+
export const tokens = {
|
|
9
|
+
color: {
|
|
10
|
+
accent: 'var(--color-accent)',
|
|
11
|
+
danger: 'var(--color-danger)',
|
|
12
|
+
surface: 'var(--color-surface)',
|
|
13
|
+
surfaceRaised: 'var(--color-surface-raised)',
|
|
14
|
+
border: 'var(--color-border)',
|
|
15
|
+
textPrimary: 'var(--color-text-primary)',
|
|
16
|
+
textMuted: 'var(--color-text-muted)',
|
|
17
|
+
onAccent: 'var(--color-on-accent)',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/theme/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE,qBAAqB;QAC7B,OAAO,EAAE,sBAAsB;QAC/B,aAAa,EAAE,6BAA6B;QAC5C,MAAM,EAAE,qBAAqB;QAC7B,WAAW,EAAE,2BAA2B;QACxC,SAAS,EAAE,yBAAyB;QACpC,QAAQ,EAAE,wBAAwB;KACnC;CACO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hideyukimori/nene2-ui",
|
|
3
|
+
"version": "0.2.0",
|
|
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
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./themes/default.css": "./themes/default.css",
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"themes"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc --build",
|
|
26
|
+
"prepack": "tsc --build"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/hideyukiMORI/nene2-fleet-tooling.git",
|
|
31
|
+
"directory": "packages/nene2-ui"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public",
|
|
35
|
+
"provenance": true
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": ">=19",
|
|
39
|
+
"tailwindcss": ">=4"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* @nene2-contract 1.0 @themegen 1.0.0
|
|
2
|
+
*
|
|
3
|
+
* The kit's default theme. Promoted verbatim from nene-payout — the fleet's only
|
|
4
|
+
* conformance-violation-free product as of 2026-08-23.
|
|
5
|
+
*
|
|
6
|
+
* 🔴 This file is the ONLY place a design value may appear. Components reference these
|
|
7
|
+
* through Tailwind utilities (bg-accent, rounded-x-md, px-x-inline-md). To rebrand,
|
|
8
|
+
* replace this file — never edit a component.
|
|
9
|
+
*
|
|
10
|
+
* Regenerate with: npx @hideyukimori/nene2-tokens themegen
|
|
11
|
+
*/
|
|
12
|
+
@theme {
|
|
13
|
+
--color-surface: oklch(99% 0.004 260);
|
|
14
|
+
--color-surface-raised: oklch(100% 0 0);
|
|
15
|
+
--color-text-primary: oklch(25% 0.02 260);
|
|
16
|
+
--color-text-muted: oklch(55% 0.02 260);
|
|
17
|
+
--color-border: oklch(90% 0.01 260);
|
|
18
|
+
--color-accent: oklch(55% 0.15 250);
|
|
19
|
+
--color-on-accent: oklch(99% 0 0);
|
|
20
|
+
--color-danger: oklch(55% 0.2 25);
|
|
21
|
+
|
|
22
|
+
--shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.06);
|
|
23
|
+
|
|
24
|
+
/* Sentinel for the consumer's build (#316). Zero-width, so applying it does nothing.
|
|
25
|
+
* Its only job is to exist: `p-x-source-probe` appears nowhere except this kit's `dist`,
|
|
26
|
+
* so a build that generates it has the kit in its `@source`, and a build that does not
|
|
27
|
+
* has silently dropped every class the kit ships. See SOURCE_PROBE_CLASS. */
|
|
28
|
+
--spacing-x-source-probe: 0px;
|
|
29
|
+
|
|
30
|
+
/* Disabled controls. A value, so it lives here rather than in a component — the same rule
|
|
31
|
+
* the colours follow. 50% is what the fleet's screens most often reached for when the kit
|
|
32
|
+
* gave them nothing (50 x10, 40 x4, 30 x6, measured 2026-08-23 across 20 uses). */
|
|
33
|
+
--opacity-x-disabled: 50%;
|
|
34
|
+
|
|
35
|
+
--radius-x-md: 0.5rem;
|
|
36
|
+
|
|
37
|
+
/* The spacing scale. Nine steps, chosen by measurement rather than taste: snapping the
|
|
38
|
+
* 944 spacing utilities the fleet writes by hand onto these nine moves 98.2% of them by
|
|
39
|
+
* 2px or less (2026-08-23, #298). See src/lib/spacing.ts.
|
|
40
|
+
*
|
|
41
|
+
* 🔴 No step may be named numerically (`x-2`) — `gap-x-2` is Tailwind's own column-gap
|
|
42
|
+
* utility and would take precedence. */
|
|
43
|
+
--spacing-x-3xs: 0.25rem;
|
|
44
|
+
--spacing-x-2xs: 0.5rem;
|
|
45
|
+
--spacing-x-xs: 0.75rem;
|
|
46
|
+
--spacing-x-sm: 1rem;
|
|
47
|
+
--spacing-x-md: 1.25rem;
|
|
48
|
+
--spacing-x-lg: 1.5rem;
|
|
49
|
+
--spacing-x-xl: 2rem;
|
|
50
|
+
--spacing-x-2xl: 3rem;
|
|
51
|
+
|
|
52
|
+
/* Semantic names used by the primitives that shipped in v0.1. They are aliases, never
|
|
53
|
+
* second values — two names holding the same literal is exactly the drift this file
|
|
54
|
+
* exists to prevent. Rebranding still means editing the scale above, once. */
|
|
55
|
+
--spacing-x-inline-sm: var(--spacing-x-2xs);
|
|
56
|
+
--spacing-x-inline-md: var(--spacing-x-sm);
|
|
57
|
+
--spacing-x-stack-sm: var(--spacing-x-xs);
|
|
58
|
+
--spacing-x-stack-md: var(--spacing-x-md);
|
|
59
|
+
--spacing-x-stack-lg: var(--spacing-x-xl);
|
|
60
|
+
}
|