@gratiaos/ui 1.0.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 +243 -0
- package/README.md +170 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useMissingScrew.d.ts +40 -0
- package/dist/hooks/useMissingScrew.d.ts.map +1 -0
- package/dist/hooks/useMissingScrew.js +76 -0
- package/dist/hooks/useMissingScrew.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/pad/Button.d.ts +10 -0
- package/dist/pad/Button.d.ts.map +1 -0
- package/dist/pad/Button.js +7 -0
- package/dist/pad/Button.js.map +1 -0
- package/dist/pad/Card.d.ts +8 -0
- package/dist/pad/Card.d.ts.map +1 -0
- package/dist/pad/Card.js +3 -0
- package/dist/pad/Card.js.map +1 -0
- package/dist/primitives/badge.d.ts +66 -0
- package/dist/primitives/badge.d.ts.map +1 -0
- package/dist/primitives/badge.js +23 -0
- package/dist/primitives/badge.js.map +1 -0
- package/dist/primitives/button.d.ts +60 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +39 -0
- package/dist/primitives/button.js.map +1 -0
- package/dist/primitives/card.d.ts +54 -0
- package/dist/primitives/card.d.ts.map +1 -0
- package/dist/primitives/card.js +11 -0
- package/dist/primitives/card.js.map +1 -0
- package/dist/primitives/field.d.ts +107 -0
- package/dist/primitives/field.d.ts.map +1 -0
- package/dist/primitives/field.js +154 -0
- package/dist/primitives/field.js.map +1 -0
- package/dist/primitives/pill.d.ts +59 -0
- package/dist/primitives/pill.d.ts.map +1 -0
- package/dist/primitives/pill.js +26 -0
- package/dist/primitives/pill.js.map +1 -0
- package/dist/primitives/slot.d.ts +7 -0
- package/dist/primitives/slot.d.ts.map +1 -0
- package/dist/primitives/slot.js +9 -0
- package/dist/primitives/slot.js.map +1 -0
- package/dist/primitives/toast.d.ts +125 -0
- package/dist/primitives/toast.d.ts.map +1 -0
- package/dist/primitives/toast.js +462 -0
- package/dist/primitives/toast.js.map +1 -0
- package/package.json +87 -0
- package/styles/badge.css +175 -0
- package/styles/base.css +7 -0
- package/styles/button.css +257 -0
- package/styles/card.css +195 -0
- package/styles/field.css +195 -0
- package/styles/pad.css +140 -0
- package/styles/pill.css +167 -0
- package/styles/theme.css +492 -0
- package/styles/toast.css +286 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Garden UI — Pill primitive (headless)
|
|
4
|
+
* -------------------------------------
|
|
5
|
+
* Whisper: "labels should sit light, but speak clearly." 🌬️
|
|
6
|
+
*
|
|
7
|
+
* Purpose
|
|
8
|
+
* • A tiny, versatile label/chip primitive for counts, states, or tags.
|
|
9
|
+
* • Headless by design — emits data-attributes only; visuals live in styles/pill.css.
|
|
10
|
+
*
|
|
11
|
+
* Data API
|
|
12
|
+
* • [data-ui="pill"] — root
|
|
13
|
+
* • [data-variant="soft|solid|outline|subtle"]
|
|
14
|
+
* • [data-tone="accent|positive|warning|danger|subtle(default)"]
|
|
15
|
+
* • [data-density="cozy|snug"] — vertical rhythm/size
|
|
16
|
+
*
|
|
17
|
+
* A11y
|
|
18
|
+
* • Content is the accessible label. Leading/trailing adornments are
|
|
19
|
+
* `aria-hidden` so screen readers read the text once.
|
|
20
|
+
* • When rendered as <button>, we default `type="button"` to avoid accidental
|
|
21
|
+
* form submission — mirrors the Button primitive behaviour.
|
|
22
|
+
*
|
|
23
|
+
* Theming
|
|
24
|
+
* • Colors, radius and borders are driven by tokens in styles/pill.css.
|
|
25
|
+
* • No hard-coded hex here; skin chooses the palette via data-attrs.
|
|
26
|
+
*
|
|
27
|
+
* When to use
|
|
28
|
+
* • For small, inline status or metadata (e.g., "Beta", counters, light tags).
|
|
29
|
+
* • For interactive chips, render as `as="button"`/`as="a"` and style hover
|
|
30
|
+
* states in the skin.
|
|
31
|
+
*/
|
|
32
|
+
/** Visual tone (mapped by the skin). */
|
|
33
|
+
type Tone = 'accent' | 'positive' | 'warning' | 'danger' | 'subtle' | (string & {});
|
|
34
|
+
/** Visual weight (see styles for exact rendering). */
|
|
35
|
+
type Variant = 'soft' | 'solid' | 'outline' | 'subtle' | (string & {});
|
|
36
|
+
/** Vertical density (compact vs roomy). */
|
|
37
|
+
type Density = 'cozy' | 'snug' | (string & {});
|
|
38
|
+
/** Element to render as (defaults to span). */
|
|
39
|
+
type AsElement = 'span' | 'button' | 'a';
|
|
40
|
+
type PillOwnProps = {
|
|
41
|
+
/** Render as a different element (span | button | a). Defaults to span. */
|
|
42
|
+
as?: AsElement;
|
|
43
|
+
/** Visual weight. Defaults to "soft". */
|
|
44
|
+
variant?: Variant;
|
|
45
|
+
/** Color tone. Defaults to "subtle". */
|
|
46
|
+
tone?: Tone;
|
|
47
|
+
/** Vertical density. Defaults to "cozy". */
|
|
48
|
+
density?: Density;
|
|
49
|
+
/** Optional leading adornment (icon, dot, avatar). */
|
|
50
|
+
leading?: React.ReactNode;
|
|
51
|
+
/** Optional trailing adornment (icon, counter, close). */
|
|
52
|
+
trailing?: React.ReactNode;
|
|
53
|
+
};
|
|
54
|
+
export type PillProps<TAs extends AsElement = 'span'> = PillOwnProps & Omit<React.ComponentPropsWithoutRef<TAs>, 'color'>;
|
|
55
|
+
export declare const Pill: <TAs extends AsElement = "span">(props: PillProps<TAs> & {
|
|
56
|
+
ref?: React.Ref<HTMLElement>;
|
|
57
|
+
}) => React.ReactElement | null;
|
|
58
|
+
export default Pill;
|
|
59
|
+
//# sourceMappingURL=pill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pill.d.ts","sourceRoot":"","sources":["../../src/primitives/pill.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OA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Y,GAAG,IAAI,CAAC;AAErJ,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** Simple class join helper (no runtime deps). */
|
|
4
|
+
function cx(...parts) {
|
|
5
|
+
return parts.filter(Boolean).join(' ');
|
|
6
|
+
}
|
|
7
|
+
// Base utility classes — the skin (CSS) handles colors/borders via data-attrs.
|
|
8
|
+
/**
|
|
9
|
+
* Headless Pill
|
|
10
|
+
* - Emits `data-ui`, `data-variant`, `data-tone`, `data-density`.
|
|
11
|
+
* - No fixed colors here; styles/pill.css is the single source of truth.
|
|
12
|
+
*/
|
|
13
|
+
const PillInner = (props, ref) => {
|
|
14
|
+
const { as, variant = 'soft', tone = 'subtle', density = 'cozy', leading, trailing, className, children, ...rest } = props;
|
|
15
|
+
const Comp = as ?? 'span';
|
|
16
|
+
// If rendered as a button, default to type=button to avoid form submission.
|
|
17
|
+
const buttonDefaults = Comp === 'button' && !rest.type ? { type: 'button' } : null;
|
|
18
|
+
return (_jsxs(Comp, { ref: ref, "data-ui": "pill", "data-variant": variant, "data-tone": tone, "data-density": density, className: cx(className) || undefined, ...buttonDefaults, ...rest, children: [leading && (
|
|
19
|
+
// Presentational — hidden from AT since the text already conveys the label
|
|
20
|
+
_jsx("span", { "aria-hidden": "true", "data-slot": "icon leading", children: leading })), children, trailing && (_jsx("span", { "aria-hidden": "true", "data-slot": "icon trailing", children: trailing }))] }));
|
|
21
|
+
};
|
|
22
|
+
const _Pill = React.forwardRef(PillInner);
|
|
23
|
+
_Pill.displayName = 'Pill';
|
|
24
|
+
export const Pill = _Pill;
|
|
25
|
+
export default Pill;
|
|
26
|
+
//# sourceMappingURL=pill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pill.js","sourceRoot":"","sources":["../../src/primitives/pill.tsx"],"names":[],"mappings":";AAAA,OAA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;AAErJ,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** A minimal Slot primitive to forward props to child (like Radix Slot) */
|
|
3
|
+
export interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/primitives/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,2EAA2E;AAC3E,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AACD,eAAO,MAAM,IAAI,+EAQf,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export const Slot = React.forwardRef(function Slot({ children, ...rest }, ref) {
|
|
4
|
+
if (React.isValidElement(children)) {
|
|
5
|
+
return React.cloneElement(children, { ref, ...rest });
|
|
6
|
+
}
|
|
7
|
+
return _jsx("span", { ref: ref, ...rest, children: children });
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/primitives/slot.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAyB,SAAS,IAAI,CACxE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EACrB,GAAG;IAEH,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,YAAY,CAAC,QAAe,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,eAAM,GAAG,EAAE,GAAU,KAAM,IAAI,YAAG,QAAQ,GAAQ,CAAC;AAC5D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Garden UI — Toast primitive (headless)
|
|
3
|
+
* --------------------------------------
|
|
4
|
+
* Rendering is data-attribute driven; visuals live in styles/toast.css.
|
|
5
|
+
* Emit with `showToast(...)` (CustomEvent), render with `<Toaster/>`.
|
|
6
|
+
*
|
|
7
|
+
* A11y
|
|
8
|
+
* • Each item is `role="status"` with `aria-atomic="true"` so screen readers
|
|
9
|
+
* announce the toast as a single unit.
|
|
10
|
+
* • Items are focusable by default (tabIndex=0). Focus/hover pauses auto‑dismiss;
|
|
11
|
+
* blur/mouseleave resumes. Keyboard: Enter/Space dismiss (when dismissOnClick),
|
|
12
|
+
* Escape always dismisses.
|
|
13
|
+
*
|
|
14
|
+
* Theming
|
|
15
|
+
* • Duration prefers `--dur-toast`; otherwise derives from `--dur-pulse` with a
|
|
16
|
+
* generous hold. Colors/shape come from tokens: `--elev`, `--text`, `--border`,
|
|
17
|
+
* and `--color-*` accents.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* UI data‑states (handled by the primitive)
|
|
21
|
+
* • Each toast mounts with `data-state="entering"` and clears it on next frame
|
|
22
|
+
* so CSS can ease in.
|
|
23
|
+
* • On dismiss, we set `data-state="leaving"` and remove the node after the
|
|
24
|
+
* tokenized transition (see styles/toast.css).
|
|
25
|
+
*
|
|
26
|
+
* Event API (headless, global)
|
|
27
|
+
* • showToast("Saved ✓", { variant: "positive" })
|
|
28
|
+
* • showToast({ key: "sync", title: "Syncing…", variant: "neutral" }) // keyed upsert
|
|
29
|
+
* • clearToast() // remove all
|
|
30
|
+
* • clearToast("sync") // remove item(s) with key
|
|
31
|
+
*/
|
|
32
|
+
import React from 'react';
|
|
33
|
+
export type ToastVariant = 'neutral' | 'positive' | 'warning' | 'danger';
|
|
34
|
+
export type ToastOptions = {
|
|
35
|
+
/** Visual style (maps to data-variant for the skin). */
|
|
36
|
+
variant?: ToastVariant;
|
|
37
|
+
/** Override auto-dismiss duration in ms. Falls back to CSS tokens. */
|
|
38
|
+
durationMs?: number;
|
|
39
|
+
/** Optional stable key: upserts (replace/resets) an existing toast with the same key. */
|
|
40
|
+
key?: string;
|
|
41
|
+
/** Optional title to render on the first line (see styles/toast.css). */
|
|
42
|
+
title?: string;
|
|
43
|
+
/** Optional description to render on the second line. */
|
|
44
|
+
desc?: string;
|
|
45
|
+
/** Optional plain message (single-line). If title/desc are present, message is ignored in UI. */
|
|
46
|
+
message?: string;
|
|
47
|
+
/** Optional simple icon glyph (emoji / short text). For richer icons, use Toaster's renderIcon(). */
|
|
48
|
+
icon?: string;
|
|
49
|
+
/** Optional hook called when the toast is dismissed (timeout/click/Escape/clear). */
|
|
50
|
+
onDismiss?: () => void;
|
|
51
|
+
/** Optional click handler — runs before dismiss (if enabled). */
|
|
52
|
+
onClick?: () => void;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Dev helper — `useToasterTest()`
|
|
56
|
+
* --------------------------------
|
|
57
|
+
* Whisper: "debug should feel playful, not noisy." 🌬️
|
|
58
|
+
*
|
|
59
|
+
* Purpose
|
|
60
|
+
* • Tiny opt‑in hook to exercise the toast stack during development.
|
|
61
|
+
* • Provides a keyboard hotkey (Alt+T) that cycles demo toasts and Alt+Y to clear.
|
|
62
|
+
* • Exposes helpers to fire, clear, and run an interval-based "auto" demo.
|
|
63
|
+
*
|
|
64
|
+
* Usage
|
|
65
|
+
* import { Toaster, useToasterTest } from '@gratiaos/ui';
|
|
66
|
+
* ...
|
|
67
|
+
* function DevRoot() {
|
|
68
|
+
* useToasterTest(); // Alt+T to push a demo toast, Alt+Y to clear
|
|
69
|
+
* return <Toaster />;
|
|
70
|
+
* }
|
|
71
|
+
*/
|
|
72
|
+
export declare function useToasterTest(opts?: {
|
|
73
|
+
enabled?: boolean;
|
|
74
|
+
intervalMs?: number;
|
|
75
|
+
}): {
|
|
76
|
+
fireDemo: () => void;
|
|
77
|
+
clearDemo: () => void;
|
|
78
|
+
startAuto: () => void;
|
|
79
|
+
stopAuto: () => void;
|
|
80
|
+
readonly running: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Headless event API — emit a toast from anywhere in the app.
|
|
84
|
+
* Overloads:
|
|
85
|
+
* showToast('Saved ✓', { variant: 'positive' })
|
|
86
|
+
* showToast({ title: 'Saved', desc: 'Your note is now in the timeline.', variant: 'positive' })
|
|
87
|
+
*/
|
|
88
|
+
export declare function showToast(message: string, opts?: ToastOptions): void;
|
|
89
|
+
export declare function showToast(opts: ToastOptions): void;
|
|
90
|
+
/** Clear by key or all. */
|
|
91
|
+
export declare function clearToast(key?: string): void;
|
|
92
|
+
export type ToastItemLike = {
|
|
93
|
+
id: number;
|
|
94
|
+
variant: ToastVariant;
|
|
95
|
+
durationMs: number;
|
|
96
|
+
key?: string;
|
|
97
|
+
title?: string;
|
|
98
|
+
desc?: string;
|
|
99
|
+
message?: string;
|
|
100
|
+
icon?: string;
|
|
101
|
+
onDismiss?: () => void;
|
|
102
|
+
onClick?: () => void;
|
|
103
|
+
uiState?: 'entering' | 'leaving';
|
|
104
|
+
};
|
|
105
|
+
export type ToastRenderIcon = (item: Omit<ToastItemLike, 'id' | 'durationMs'>) => React.ReactNode;
|
|
106
|
+
export type ToasterProps = {
|
|
107
|
+
/** Where to pin the stack. Defaults to bottom-center. */
|
|
108
|
+
position?: 'bottom-center' | 'top-right' | 'top-center' | 'bottom-right';
|
|
109
|
+
/** Max visible toasts at once. Older ones drop first. Default: 3 */
|
|
110
|
+
max?: number;
|
|
111
|
+
/** Click to dismiss. Default: true */
|
|
112
|
+
dismissOnClick?: boolean;
|
|
113
|
+
/** Optional className; styles live in CSS under [data-ui="toast"]. */
|
|
114
|
+
className?: string;
|
|
115
|
+
/** Optional render function for a richer leading icon. */
|
|
116
|
+
renderIcon?: ToastRenderIcon;
|
|
117
|
+
/** Whether toast items can receive focus for keyboard users. Default: true */
|
|
118
|
+
focusable?: boolean;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Toaster — headless renderer using data attributes only.
|
|
122
|
+
* Visuals are provided by styles/toast.css.
|
|
123
|
+
*/
|
|
124
|
+
export declare const Toaster: React.FC<ToasterProps>;
|
|
125
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/primitives/toast.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG;IACzB,wDAAwD;IACxD,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qGAAqG;IACrG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAUF;;;;;;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