@gryt/ui 0.22.0 → 0.23.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/ThemeEditor/ColorField.d.ts +20 -0
- package/dist/components/ThemeEditor/ColorField.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ContrastReport.d.ts +16 -0
- package/dist/components/ThemeEditor/ContrastReport.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ScaleStrip.d.ts +15 -0
- package/dist/components/ThemeEditor/ScaleStrip.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ThemeEditor.d.ts +23 -0
- package/dist/components/ThemeEditor/ThemeEditor.d.ts.map +1 -0
- package/dist/components/ThemeEditor/contrast.d.ts +21 -0
- package/dist/components/ThemeEditor/contrast.d.ts.map +1 -0
- package/dist/components/ThemeEditor/draft.d.ts +35 -0
- package/dist/components/ThemeEditor/draft.d.ts.map +1 -0
- package/dist/components/ThemeEditor/generate.d.ts +43 -0
- package/dist/components/ThemeEditor/generate.d.ts.map +1 -0
- package/dist/components/ThemeEditor/share.d.ts +17 -0
- package/dist/components/ThemeEditor/share.d.ts.map +1 -0
- package/dist/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1703 -926
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ColorFieldProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
/** Set when a contrast check blames this colour. */
|
|
6
|
+
warning?: string;
|
|
7
|
+
/** Shown but not editable, for values something else is computing. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* One anchor: the swatch, and the hex beside it.
|
|
12
|
+
*
|
|
13
|
+
* Two controls for one value, because they are good at different things. The
|
|
14
|
+
* native picker is how you find a colour you cannot name; the text box is how
|
|
15
|
+
* you paste the one your brand already has. The text box only commits when what
|
|
16
|
+
* is in it parses, so typing "#1a" halfway through does not repaint the page
|
|
17
|
+
* with black.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ColorField({ label, value, onChange, warning, disabled }: ColorFieldProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=ColorField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/ColorField.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAgB,EACjB,EAAE,eAAe,+BAsDjB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ContrastCheck } from './contrast.js';
|
|
2
|
+
export interface ContrastReportProps {
|
|
3
|
+
checks: ContrastCheck[];
|
|
4
|
+
/** Absent when nothing is failing. */
|
|
5
|
+
onRepair?: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* What the library's own tests would say about this theme.
|
|
9
|
+
*
|
|
10
|
+
* Ratios rather than a verdict, because "3.9 against 4.5" tells somebody how
|
|
11
|
+
* far off they are and "fails" does not. The repair only moves the colours
|
|
12
|
+
* whose job is to be read — it will not quietly redesign an accent somebody
|
|
13
|
+
* chose on purpose.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ContrastReport({ checks, onRepair }: ContrastReportProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=ContrastReport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContrastReport.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/ContrastReport.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAcD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BA8DvE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The twelve steps a family generated, under the anchors that generated them.
|
|
3
|
+
*
|
|
4
|
+
* This is the part that makes the page worth building rather than describing.
|
|
5
|
+
* Changing one hex value moves a whole ramp — component backgrounds, hover
|
|
6
|
+
* states, borders, the text step — and seeing that happen is the difference
|
|
7
|
+
* between "it takes a colour" and "it takes a colour and knows what to do with
|
|
8
|
+
* it".
|
|
9
|
+
*/
|
|
10
|
+
export interface ScaleStripProps {
|
|
11
|
+
label: string;
|
|
12
|
+
steps: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function ScaleStrip({ label, steps }: ScaleStripProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=ScaleStrip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScaleStrip.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/ScaleStrip.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,eAAe,+BAkB3D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { GrytAppearance } from '@gryt/theme';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ThemeDraft } from './draft.js';
|
|
4
|
+
export interface ThemeEditorProps {
|
|
5
|
+
/** The theme being edited. Controlled, so the host can preview it. */
|
|
6
|
+
value: ThemeDraft;
|
|
7
|
+
onChange: (next: ThemeDraft) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Which half is on the bench.
|
|
10
|
+
*
|
|
11
|
+
* The host's, not the editor's: editing the light half while the app around
|
|
12
|
+
* it is dark would be looking at two themes at once.
|
|
13
|
+
*/
|
|
14
|
+
appearance: GrytAppearance;
|
|
15
|
+
onAppearanceChange: (next: GrytAppearance) => void;
|
|
16
|
+
/** End of the header row. Where a host puts its own copy or save control. */
|
|
17
|
+
actions?: ReactNode;
|
|
18
|
+
/** Under the controls. Where the docs site puts the export tabs. */
|
|
19
|
+
footer?: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function ThemeEditor({ value: draft, onChange, appearance, onAppearanceChange, actions, footer, className }: ThemeEditorProps): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=ThemeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/ThemeEditor.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAwBvC,OAAO,KAAK,EAKV,UAAU,EACX,MAAM,SAAS,CAAC;AA8BjB,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,KAAK,EAAE,UAAU,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC;;;;;OAKG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B,kBAAkB,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,6EAA6E;IAC7E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EAAE,KAAK,EACZ,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,MAAM,EACN,SAAS,EACV,EAAE,gBAAgB,+BAwZlB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { Appearance, DraftPath, ThemeDraft } from './draft.js';
|
|
3
|
+
export type CheckLevel = "pass" | "tight" | "fail";
|
|
4
|
+
export interface ContrastCheck {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
foreground: string;
|
|
8
|
+
background: string;
|
|
9
|
+
ratio: number;
|
|
10
|
+
min: number;
|
|
11
|
+
level: CheckLevel;
|
|
12
|
+
/** Advisory checks never read as a failure; they read as "look at this". */
|
|
13
|
+
advisory: boolean;
|
|
14
|
+
/** Which editable colours are responsible, so the fields can flag. */
|
|
15
|
+
paths: DraftPath[];
|
|
16
|
+
}
|
|
17
|
+
export declare function contrastChecks(draft: ThemeDraft, theme: CSSProperties, appearance: Appearance): ContrastCheck[];
|
|
18
|
+
/** Every field a failing check blames, for the warning markers on the editor. */
|
|
19
|
+
export declare function failingPaths(checks: ContrastCheck[]): Set<DraftPath>;
|
|
20
|
+
export declare function countFailures(checks: ContrastCheck[]): number;
|
|
21
|
+
//# sourceMappingURL=contrast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/contrast.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGjE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,4EAA4E;IAC5E,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAyCD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,aAAa,EACpB,UAAU,EAAE,UAAU,GACrB,aAAa,EAAE,CA6EjB;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAOpE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { grytThemeHues, isHexColor, normalizeHexColor, GrytAppearance, GrytHueKey, GrytHues, GrytNeutralKey, GrytNeutrals, GrytRadiusKey, GrytTheme } from '@gryt/theme';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
export type Appearance = GrytAppearance;
|
|
4
|
+
export type HueKey = GrytHueKey;
|
|
5
|
+
export type NeutralKey = GrytNeutralKey;
|
|
6
|
+
export type RadiusKey = GrytRadiusKey;
|
|
7
|
+
export type HueSet = GrytHues;
|
|
8
|
+
export type NeutralSet = GrytNeutrals;
|
|
9
|
+
export type ThemeDraft = GrytTheme;
|
|
10
|
+
export declare const HUE_KEYS: readonly ["accent", "accentLight", "secondary", "secondaryLight", "success", "danger", "dangerLight", "warning", "onAccent", "onSecondary", "onDanger"];
|
|
11
|
+
export declare const NEUTRAL_KEYS: readonly ["bg", "surface", "surfaceRaised", "surfaceHover", "border", "muted", "text"];
|
|
12
|
+
export declare const RADIUS_KEYS: readonly ["sm", "md", "lg", "xl", "full"];
|
|
13
|
+
export { isHexColor as isHex, normalizeHexColor as normalizeHex };
|
|
14
|
+
/** Where this appearance's hues live, which is what an edit has to write to. */
|
|
15
|
+
export type DraftPath = `hue.${HueKey}` | `lightHue.${HueKey}` | `dark.${NeutralKey}` | `light.${NeutralKey}`;
|
|
16
|
+
export declare const grytDraft: ThemeDraft;
|
|
17
|
+
export declare function hueSlot(draft: ThemeDraft, appearance: Appearance): "hue" | "lightHue";
|
|
18
|
+
export declare const huesFor: typeof grytThemeHues;
|
|
19
|
+
export declare function cloneDraft(draft: ThemeDraft): ThemeDraft;
|
|
20
|
+
/** The colours createGrytTheme wants, for one appearance. */
|
|
21
|
+
export declare function colorsFor(draft: ThemeDraft, appearance: Appearance): Record<string, string>;
|
|
22
|
+
/** The theme itself: CSS custom properties, ready for a style prop. */
|
|
23
|
+
export declare function themeStyle(draft: ThemeDraft, appearance: Appearance): CSSProperties;
|
|
24
|
+
/** A generated scale, read back off the built theme rather than regenerated. */
|
|
25
|
+
export declare function scaleFrom(theme: CSSProperties, family: string): string[];
|
|
26
|
+
export declare const SCALE_FAMILIES: readonly ["neutral", "accent", "secondary", "success", "danger", "warning"];
|
|
27
|
+
/** Changes anywhere in the draft, as one string. Cheap memo key. */
|
|
28
|
+
export declare function draftSignature(draft: ThemeDraft): string;
|
|
29
|
+
/** Human labels, used by the editor and by the contrast report alike. */
|
|
30
|
+
export declare const HUE_LABELS: Record<HueKey, string>;
|
|
31
|
+
export declare const NEUTRAL_LABELS: Record<NeutralKey, string>;
|
|
32
|
+
export declare const RADIUS_LABELS: Record<RadiusKey, string>;
|
|
33
|
+
/** What each radius step is actually on, so the numbers mean something. */
|
|
34
|
+
export declare const RADIUS_HINTS: Record<RadiusKey, string>;
|
|
35
|
+
//# sourceMappingURL=draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/draft.ts"],"names":[],"mappings":"AAcA,OAAO,EAML,aAAa,EAEb,UAAU,EACV,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,aAAa,EACb,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AACxC,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC;AAChC,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AACxC,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;AAC9B,MAAM,MAAM,UAAU,GAAG,YAAY,CAAC;AACtC,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC;AAEnC,eAAO,MAAM,QAAQ,yJAAgB,CAAC;AACtC,eAAO,MAAM,YAAY,wFAAoB,CAAC;AAC9C,eAAO,MAAM,WAAW,2CAAmB,CAAC;AAE5C,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAE,CAAC;AAElE,gFAAgF;AAChF,MAAM,MAAM,SAAS,GACjB,OAAO,MAAM,EAAE,GACf,YAAY,MAAM,EAAE,GACpB,QAAQ,UAAU,EAAE,GACpB,SAAS,UAAU,EAAE,CAAC;AAE1B,eAAO,MAAM,SAAS,EAAE,UAAsB,CAAC;AAE/C,wBAAgB,OAAO,CACrB,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,UAAU,GACrB,KAAK,GAAG,UAAU,CAEpB;AAED,eAAO,MAAM,OAAO,sBAAgB,CAAC;AAErC,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAQxD;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CACvB,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,UAAU,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,UAAU,GACrB,aAAa,CAEf;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAMxE;AAED,eAAO,MAAM,cAAc,6EAOjB,CAAC;AAEX,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAExD;AAED,yEAAyE;AACzE,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAY7C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAQrD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAMnD,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAMlD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HueSet, ThemeDraft } from './draft.js';
|
|
2
|
+
export declare function generateDraft(): ThemeDraft;
|
|
3
|
+
/**
|
|
4
|
+
* A label colour for a filled control.
|
|
5
|
+
*
|
|
6
|
+
* Ink or paper, whichever reads better on the fill, tinted toward the fill's
|
|
7
|
+
* own hue so it looks chosen rather than dropped in — black-or-white passes the
|
|
8
|
+
* same checks and looks like a placeholder.
|
|
9
|
+
*
|
|
10
|
+
* Then pushed until it clears 7:1 rather than the 4.5 the checks require. The
|
|
11
|
+
* label on a filled button is the one piece of text in an app that always sits
|
|
12
|
+
* on a saturated colour, it is usually a verb somebody is about to press, and
|
|
13
|
+
* the whole cost of AAA here is a shade of a colour that was already nearly
|
|
14
|
+
* black. Where the fill cannot carry 7 with any label at all — a mid-lightness
|
|
15
|
+
* blue tops out around 6 — this returns the best there is and the report says
|
|
16
|
+
* what it came to.
|
|
17
|
+
*/
|
|
18
|
+
export declare function readableOn(fill: string): string;
|
|
19
|
+
/** The three label colours, recomputed from the fills they sit on. */
|
|
20
|
+
export declare function withAutoLabels(hues: HueSet): HueSet;
|
|
21
|
+
/** Whether a hue set already carries the labels the auto pick would give it. */
|
|
22
|
+
export declare function labelsAreAuto(hues: HueSet): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Push a colour away from its background until it carries text.
|
|
25
|
+
*
|
|
26
|
+
* Lightness only. Moving the hue would change which colour it is, and moving
|
|
27
|
+
* chroma barely moves contrast at all — lightness is the axis that decides
|
|
28
|
+
* whether something is readable.
|
|
29
|
+
*/
|
|
30
|
+
export declare function ensureContrast(foreground: string, background: string, min: number): string;
|
|
31
|
+
/**
|
|
32
|
+
* Fix what the contrast report is complaining about, without redesigning the
|
|
33
|
+
* theme.
|
|
34
|
+
*
|
|
35
|
+
* Only the colours whose job is to be read get moved — text, muted text, and
|
|
36
|
+
* the labels on filled controls. The anchors somebody actually chose, the
|
|
37
|
+
* background and the accent, are left exactly where they are: a repair that
|
|
38
|
+
* changed the accent would be answering a question nobody asked.
|
|
39
|
+
*/
|
|
40
|
+
export declare function repairDraft(draft: ThemeDraft): ThemeDraft;
|
|
41
|
+
/** Whether a repair would change anything, so the button can say so. */
|
|
42
|
+
export declare function needsRepair(draft: ThemeDraft): boolean;
|
|
43
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/generate.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAc,MAAM,EAAa,UAAU,EAAE,MAAM,SAAS,CAAC;AAmBzE,wBAAgB,aAAa,IAAI,UAAU,CAyE1C;AAQD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOnD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,MAAM,CAeR;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CA0CzD;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAMtD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { decodeGrytTheme, encodeGrytTheme } from '@gryt/theme';
|
|
2
|
+
import { Appearance, ThemeDraft } from './draft.js';
|
|
3
|
+
export { encodeGrytTheme as encodeDraft, decodeGrytTheme };
|
|
4
|
+
export declare function themeCode(draft: ThemeDraft): string;
|
|
5
|
+
/** The whole draft, spelled out. What import reads back. */
|
|
6
|
+
export declare function themeJson(draft: ThemeDraft): string;
|
|
7
|
+
export interface ImportResult {
|
|
8
|
+
draft?: ThemeDraft;
|
|
9
|
+
appearance?: Appearance;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Takes either of the two things somebody will paste: the JSON this page
|
|
14
|
+
* exports, or a link it produced.
|
|
15
|
+
*/
|
|
16
|
+
export declare function importTheme(input: string): ImportResult;
|
|
17
|
+
//# sourceMappingURL=share.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../../src/components/ThemeEditor/share.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,eAAe,EACf,eAAe,EAIhB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,UAAU,EAAa,UAAU,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,EAAE,eAAe,IAAI,WAAW,EAAE,eAAe,EAAE,CAAC;AAuD3D,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAmBnD;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAavD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),M=require("@base-ui/react/tooltip"),s=require("react"),c=require("@gryt/theme"),se=require("@base-ui/react/button"),we=require("clsx"),ve=require("tailwind-merge"),_=require("@base-ui/react/field"),P=require("@phosphor-icons/react"),X=require("@base-ui/react/avatar"),K=require("@gryt/owl"),J=require("@base-ui/react/checkbox"),ee=require("@base-ui/react/radio"),je=require("@base-ui/react/radio-group"),te=require("@base-ui/react/switch"),F=require("@base-ui/react/slider"),h=require("@base-ui/react/select"),Pe=require("@base-ui/react/separator"),U=require("@base-ui/react/progress"),C=require("@base-ui/react/dialog"),j=require("@base-ui/react/drawer"),D=require("@base-ui/react/menu"),z=require("@base-ui/react/tabs"),B=require("@base-ui/react/accordion"),T=require("@base-ui/react/context-menu"),N=require("@base-ui/react/popover"),R=require("@base-ui/react/toast"),O=require("@base-ui/react/scroll-area"),Ne=require("@base-ui/react/toggle"),Re=require("@base-ui/react/toggle-group"),q=require("@base-ui/react/meter"),S=require("@base-ui/react/alert-dialog"),m=require("@base-ui/react/autocomplete"),g=require("@base-ui/react/combobox"),Te=require("@base-ui/react/checkbox-group"),W=require("@base-ui/react/collapsible"),Ce=require("@base-ui/react/form"),ie=require("@base-ui/react/fieldset"),Se=require("@base-ui/react/menubar"),w=require("@base-ui/react/navigation-menu"),A=require("@base-ui/react/number-field"),re=require("@base-ui/react/otp-field"),G=require("@base-ui/react/preview-card"),L=require("@base-ui/react/toolbar"),le=s.createContext(void 0);function ce(){return s.useContext(le)}function ke(a){return Object.keys(a).some(e=>e.startsWith("--"))}function Ae({children:a,className:e,theme:t,tooltipDelay:r=400,containOverlays:i=!1}){const l=s.useRef(null),d=t===void 0?void 0:ke(t)?t:c.createGrytTheme(t);return o.jsx("div",{className:e,style:d,ref:l,children:o.jsx(le.Provider,{value:i?l:void 0,children:o.jsx(M.Tooltip.Provider,{delay:r,children:a})})})}function n(...a){return ve.twMerge(we.clsx(a))}const Me={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover data-disabled:text-gryt-muted",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},De={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},de=s.forwardRef(function({children:e,className:t,endIcon:r,size:i="medium",startIcon:l,tone:d="primary",...u},p){return o.jsxs(se.Button,{ref:p,className:n("gryt-button","inline-flex cursor-pointer items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",De[i],Me[d],t),...u,children:[l,e,r]})}),f="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",Ie="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",ue=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),ge={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},I="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",k=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),$="cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50",Ge={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},ye={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Le={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Oe={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},$e={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Fe={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},qe=s.forwardRef(function({className:e,size:t="medium",tone:r="neutral",...i},l){return o.jsx(se.Button,{ref:l,className:n("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",f,$,Fe[t],$e[r],e),...i})}),Be=s.forwardRef(function({className:e,elevated:t=!1,...r},i){return o.jsx("div",{ref:i,className:n("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",t?"bg-gryt-surface-raised":"bg-gryt-surface",e),...r})}),ze=s.forwardRef(function({children:e,className:t,from:r="assistant",...i},l){return o.jsx("div",{ref:l,className:n("gryt-message-bubble",r==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",r==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",r==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",t),...i,children:e})}),Ee=s.forwardRef(function({className:e,error:t=!1,fieldClassName:r,helperText:i,label:l,minRows:d=3,multiline:u=!1,size:p="medium",...x},y){const v=o.jsx(_.Field.Control,{ref:y,render:u?o.jsx("textarea",{rows:d}):void 0,className:n("gryt-text-field-control",ue,u&&"resize-y leading-6",t?"border-gryt-danger":"border-gryt-border",ge[p],e),...x});return o.jsxs(_.Field.Root,{className:n("gryt-text-field flex w-full flex-col gap-1.5",r),children:[l?o.jsx(_.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:l}):null,v,i?o.jsx(_.Field.Description,{className:n("text-xs",t?"text-gryt-danger-11":"text-gryt-muted"),children:i}):null]})}),_e=s.forwardRef(function({className:e,disabled:t=!1,maxRows:r=8,minRows:i=1,onSubmit:l,placeholder:d="Message Gryt",submitLabel:u="Send",...p},x){const y=s.useRef(null),v=s.useCallback(()=>{const b=y.current;if(!b)return;const V=window.getComputedStyle(b),Q=parseFloat(V.lineHeight)||24,Z=parseFloat(V.paddingTop)+parseFloat(V.paddingBottom);b.style.height="auto",b.style.height=`${Math.min(Math.max(b.scrollHeight,Q*i+Z),Q*r+Z)}px`},[r,i]);s.useLayoutEffect(v,[v,p.value]);function E(b){if(!l){b.preventDefault();return}l(b)}return o.jsxs("form",{className:n("gryt-composer",e),onSubmit:E,children:[o.jsx("textarea",{ref:b=>{y.current=b,typeof x=="function"?x(b):x&&(x.current=b)},rows:i,disabled:t,placeholder:d,onInput:v,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...p}),o.jsx(de,{type:"submit",disabled:t,size:"small",endIcon:o.jsx(P.PaperPlaneTilt,{size:14,weight:"fill"}),children:u})]})}),Ye={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},oe=256,pe=s.forwardRef(function({alt:e,children:t,className:r,fallback:i,seed:l,eggSeed:d,size:u="medium",src:p,...x},y){const v=s.useMemo(()=>l?K.owlAvatarDataUri(l,{size:oe}):void 0,[l]),E=s.useMemo(()=>d?K.eggAvatarDataUri(d,{size:oe}):void 0,[d]),b=v??E;return o.jsxs(X.Avatar.Root,{ref:y,className:n("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",Ye[u],r),...x,children:[p?o.jsx(X.Avatar.Image,{src:p,alt:e,className:"h-full w-full object-cover"}):null,o.jsx(X.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:b?o.jsx("img",{src:b,alt:e,className:"h-full w-full object-cover"}):i??t})]})}),He=s.forwardRef(function({active:e=!1,avatar:t,className:r,subtitle:i,title:l,...d},u){return o.jsxs("button",{ref:u,type:"button",className:n("gryt-conversation-item enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",e?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",r),...d,children:[t??o.jsx(pe,{size:"small",className:n(e?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:l.slice(0,1).toUpperCase()}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-semibold",children:l}),i?o.jsx("span",{className:n("block truncate text-xs",e?"text-gryt-on-accent/85":"text-gryt-muted"),children:i}):null]})]})}),Ve=s.forwardRef(function({badgeContent:e,children:t,className:r,max:i=99,showZero:l=!1,...d},u){const p=typeof e=="number"?e:null,x=p!==null&&p===0&&!l,y=p!==null&&p>i?`${i}+`:e;return o.jsxs("span",{ref:u,className:n("gryt-badge relative inline-flex",r),...d,children:[t,e!==void 0&&!x?o.jsx("span",{className:n("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:y}):null]})}),Xe={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Ue=s.forwardRef(function({children:e,className:t,icon:r,label:i,onDelete:l,tone:d="neutral",...u},p){return o.jsxs("span",{ref:p,className:n("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",Xe[d],t),...u,children:[r,i??e,l?o.jsx("button",{type:"button","aria-label":"Remove",onClick:l,className:n("-mr-1 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",f),children:o.jsx(P.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Ke=s.forwardRef(function({className:e,tone:t="primary",...r},i){return o.jsx(J.Checkbox.Root,{ref:i,className:n("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",f,$,Ge[t],e),...r,children:o.jsx(J.Checkbox.Indicator,{keepMounted:!0,className:n("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:o.jsx(P.Check,{size:12,weight:"bold"})})})}),We=s.forwardRef(function({className:e,tone:t="primary",...r},i){return o.jsx(ee.Radio.Root,{ref:i,className:n("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",f,$,Le[t],e),...r,children:o.jsx(ee.Radio.Indicator,{keepMounted:!0,className:n("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",ye[t])})})}),Qe=s.forwardRef(function({className:e,...t},r){return o.jsx(je.RadioGroup,{ref:r,className:n("gryt-radio-group flex flex-col gap-2",e),...t})}),Ze=s.forwardRef(function({className:e,tone:t="primary",...r},i){return o.jsx(te.Switch.Root,{ref:i,className:n("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",f,$,Oe[t],e),...r,children:o.jsx(te.Switch.Thumb,{className:n("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),ae=3;function Je({className:a,tone:e="primary","aria-label":t,...r}){const[i,l]=s.useState(!1),d=s.useRef(null);s.useEffect(()=>{if(!i&&d.current===null)return;const y=()=>{d.current=null,l(!1)};return window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),()=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}},[i]);function u(y){d.current={x:y.clientX,y:y.clientY}}function p(y){const v=d.current;if(v===null||i)return;(Math.abs(y.clientX-v.x)>ae||Math.abs(y.clientY-v.y)>ae)&&l(!0)}const x=i?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return o.jsx(F.Slider.Root,{className:n("gryt-slider w-full",a),...r,children:o.jsx(F.Slider.Control,{className:"flex w-full cursor-pointer touch-none items-center py-2 select-none",onPointerDown:u,onPointerMove:p,children:o.jsxs(F.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[o.jsx(F.Slider.Indicator,{className:n("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",x,ye[e])}),o.jsx(F.Slider.Thumb,{"aria-label":t,className:n("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",x,Ie),children:o.jsx("span",{className:n("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const et={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function tt({className:a,label:e,options:t=[],placeholder:r="Select",size:i="medium",...l}){const d=ce();return o.jsxs(h.Select.Root,{items:t,...l,children:[o.jsxs("div",{className:n("gryt-select flex w-full flex-col gap-1.5",a),children:[e?o.jsx(h.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:e}):null,o.jsxs(h.Select.Trigger,{className:n("flex w-full cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",f,et[i]),children:[o.jsx(h.Select.Value,{placeholder:r}),o.jsx(h.Select.Icon,{className:"shrink-0 text-gryt-muted",children:o.jsx(P.CaretUpDown,{size:16})})]})]}),o.jsx(h.Select.Portal,{container:d,children:o.jsx(h.Select.Positioner,{sideOffset:6,className:"gryt-select-positioner outline-none",children:o.jsx(h.Select.Popup,{className:n("min-w-(--anchor-width) p-1",I,k),children:o.jsx(h.Select.List,{children:t.map(u=>o.jsxs(h.Select.Item,{value:u.value,disabled:u.disabled,className:n("flex cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[o.jsx(h.Select.ItemText,{children:u.label}),o.jsx(h.Select.ItemIndicator,{className:"text-gryt-accent-11",children:o.jsx(P.Check,{size:14,weight:"bold"})})]},String(u.value)))})})})})]})}function rt({children:a,className:e,side:t="top",sideOffset:r=8,title:i}){const l=ce();return o.jsxs(M.Tooltip.Root,{children:[o.jsx(M.Tooltip.Trigger,{render:a}),o.jsx(M.Tooltip.Portal,{container:l,children:o.jsx(M.Tooltip.Positioner,{side:t,sideOffset:r,className:"gryt-tooltip-positioner",children:o.jsx(M.Tooltip.Popup,{className:n("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",k,e),children:i})})})]})}const ot=M.Tooltip.Provider,at=s.forwardRef(function({className:e,orientation:t="horizontal",...r},i){return o.jsx(Pe.Separator,{ref:i,orientation:t,className:n("gryt-divider bg-gryt-border",t==="vertical"?"h-full w-px":"h-px w-full",e),...r})}),nt=s.forwardRef(function({className:e,...t},r){return o.jsx("div",{ref:r,className:n("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",e),...t})});function st({children:a,className:e,subheader:t,title:r,...i}){return o.jsxs("div",{className:n("gryt-card-header flex flex-col gap-1 p-4",e),...i,children:[r?o.jsx("span",{className:"text-base font-semibold text-gryt-text",children:r}):null,t?o.jsx("span",{className:"text-sm text-gryt-muted",children:t}):null,a]})}function it({className:a,...e}){return o.jsx("div",{className:n("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",a),...e})}function lt({className:a,...e}){return o.jsx("div",{className:n("gryt-card-actions flex items-center gap-2 px-4 pb-4",a),...e})}const ct={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},dt=s.forwardRef(function({className:e,severity:t="info",...r},i){return o.jsx("div",{ref:i,role:"alert",className:n("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",ct[t],e),...r})});function ut({className:a,value:e=null,...t}){return o.jsx(U.Progress.Root,{value:e,className:n("gryt-progress w-full",a),...t,children:o.jsx(U.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:o.jsx(U.Progress.Indicator,{className:n("h-full rounded-(--gryt-radius-full) bg-gryt-accent","transition-[width] duration-300 ease-out motion-reduce:transition-none",e===null&&"gryt-progress-indeterminate")})})})}function gt({className:a,size:e=24,"aria-label":t="Loading"}){return o.jsx(P.CircleNotch,{role:"status","aria-label":t,size:e,weight:"bold",className:n("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",a)})}const yt={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function pt({className:a,height:e,style:t,variant:r="text",width:i,...l}){const d={width:i,height:e,...t};return o.jsx("div",{"aria-hidden":"true",className:n("gryt-skeleton bg-white/9 motion-safe:animate-pulse",yt[r],a),style:d,...l})}const me="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",mt=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Backdrop,{ref:r,className:n("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",me,"data-starting-style:opacity-0 data-ending-style:opacity-0",e),...t})}),bt=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Popup,{ref:r,className:n("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",me,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",e),...t})}),ft=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Title,{ref:r,className:n("gryt-dialog-title text-base font-semibold text-gryt-text",e),...t})}),xt=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Description,{ref:r,className:n("gryt-dialog-description text-sm text-gryt-muted",e),...t})}),ht=s.forwardRef(function({className:e,...t},r){return o.jsx("div",{ref:r,className:n("gryt-dialog-footer flex justify-end gap-3",e),...t})}),wt={Root:C.Dialog.Root,Trigger:C.Dialog.Trigger,Portal:C.Dialog.Portal,Close:C.Dialog.Close,Backdrop:mt,Popup:bt,Title:ft,Description:xt,Footer:ht},vt=()=>()=>{};function be(a){const e=s.useCallback(r=>{if(typeof window>"u"||!window.matchMedia)return vt();const i=window.matchMedia(a);return i.addEventListener("change",r),()=>i.removeEventListener("change",r)},[a]),t=s.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(a).matches,[a]);return s.useSyncExternalStore(e,t,()=>!1)}const jt={left:"left",right:"right",top:"up",bottom:"down"},H=s.createContext("right"),Pt={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},Nt={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},Rt={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function Tt({side:a="right",sheetOnMobile:e=!0,children:t,...r}){const i=be("(max-width: 767px)"),l=e&&i?"bottom":a;return o.jsx(H.Provider,{value:l,children:o.jsx(j.Drawer.Root,{swipeDirection:jt[l],...r,children:t})})}const Ct=s.forwardRef(function({className:e,...t},r){const i=s.useContext(H);return o.jsx(j.Drawer.Viewport,{ref:r,className:n("gryt-drawer-viewport fixed inset-0 z-50 flex",Pt[i],e),...t})}),St=s.forwardRef(function({className:e,...t},r){const i=s.useContext(H);return o.jsx(j.Drawer.Popup,{ref:r,className:n("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",Rt[i],Nt[i],e),...t})}),kt=s.forwardRef(function({className:e,...t},r){return o.jsx(j.Drawer.Backdrop,{ref:r,className:n("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",e),...t})});function At({className:a}){const e=s.useContext(H);return e!=="bottom"&&e!=="top"?null:o.jsx("div",{"aria-hidden":!0,className:n("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",e==="top"&&"order-last",a)})}const Mt={Root:Tt,Trigger:j.Drawer.Trigger,Portal:j.Drawer.Portal,Backdrop:kt,Viewport:Ct,Popup:St,Content:j.Drawer.Content,Grabber:At,Close:j.Drawer.Close,Title:j.Drawer.Title,Description:j.Drawer.Description},Dt=s.forwardRef(function({className:e,sideOffset:t=8,...r},i){return o.jsx(D.Menu.Positioner,{ref:i,sideOffset:t,className:n("gryt-menu-positioner outline-none",e),...r})}),It=s.forwardRef(function({className:e,...t},r){return o.jsx(D.Menu.Popup,{ref:r,className:n("gryt-menu min-w-44 p-1 outline-none",I,k,e),...t})}),Gt=s.forwardRef(function({className:e,...t},r){return o.jsx(D.Menu.Item,{ref:r,className:n("gryt-menu-item flex cursor-pointer items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...t})}),Lt=s.forwardRef(function({className:e,...t},r){return o.jsx(D.Menu.Separator,{ref:r,className:n("gryt-menu-separator my-1 h-px bg-gryt-border",e),...t})}),Y={Root:D.Menu.Root,Trigger:D.Menu.Trigger,Portal:D.Menu.Portal,Positioner:Dt,Popup:It,Item:Gt,Separator:Lt},Ot=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Root,{ref:r,className:n("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",e),...t})}),$t=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.List,{ref:r,className:n("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",e),...t})}),fe=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Tab,{ref:r,className:n("gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 hover:text-gryt-text","transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96]","motion-reduce:transition-colors motion-reduce:duration-150","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)","data-disabled:cursor-not-allowed data-disabled:opacity-50",f,e),...t})}),Ft=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Indicator,{ref:r,renderBeforeHydration:!0,className:n("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",e),...t})}),qt=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Panel,{ref:r,className:n("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",e),...t})}),Bt=Object.assign(Ot,{List:$t,Tab:fe,Panel:qt,Indicator:Ft}),zt=s.forwardRef(function({className:e,...t},r){return o.jsx(B.Accordion.Root,{ref:r,className:n("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",e),...t})}),Et=s.forwardRef(function({className:e,...t},r){return o.jsx(B.Accordion.Item,{ref:r,className:n("gryt-accordion-item",e),...t})}),_t=s.forwardRef(function({children:e,className:t,expandIcon:r,...i},l){return o.jsx(B.Accordion.Header,{className:"gryt-accordion-header m-0",children:o.jsxs(B.Accordion.Trigger,{ref:l,className:n("gryt-accordion-trigger flex w-full cursor-pointer items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",f,t),...i,children:[e,r===void 0?o.jsx(P.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):r]})})}),Yt=s.forwardRef(function({children:e,className:t,...r},i){return o.jsx(B.Accordion.Panel,{ref:i,className:n("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...r,children:o.jsx("div",{className:"px-3 pt-1 pb-3",children:e})})}),Ht=Object.assign(zt,{Item:Et,Trigger:_t,Panel:Yt}),Vt=s.forwardRef(function({className:e,sideOffset:t=2,...r},i){return o.jsx(T.ContextMenu.Positioner,{ref:i,sideOffset:t,className:n("gryt-context-menu-positioner outline-none",e),...r})}),Xt={Root:T.ContextMenu.Root,Trigger:T.ContextMenu.Trigger,Portal:T.ContextMenu.Portal,Positioner:Vt,Popup:Y.Popup,Item:Y.Item,Separator:Y.Separator,Group:T.ContextMenu.Group,GroupLabel:T.ContextMenu.GroupLabel,SubmenuRoot:T.ContextMenu.SubmenuRoot,SubmenuTrigger:T.ContextMenu.SubmenuTrigger},Ut=s.forwardRef(function({className:e,sideOffset:t=8,...r},i){return o.jsx(N.Popover.Positioner,{ref:i,sideOffset:t,className:n("gryt-popover-positioner outline-none",e),...r})}),Kt=s.forwardRef(function({className:e,...t},r){return o.jsx(N.Popover.Popup,{ref:r,className:n("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",I,k,e),...t})}),Wt=s.forwardRef(function({className:e,...t},r){return o.jsx(N.Popover.Title,{ref:r,className:n("gryt-popover-title text-sm font-semibold text-gryt-text",e),...t})}),Qt=s.forwardRef(function({className:e,...t},r){return o.jsx(N.Popover.Description,{ref:r,className:n("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",e),...t})}),Zt={Root:N.Popover.Root,Trigger:N.Popover.Trigger,Portal:N.Popover.Portal,Positioner:Ut,Popup:Kt,Title:Wt,Description:Qt,Close:N.Popover.Close,Arrow:N.Popover.Arrow},Jt={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},er=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Viewport,{ref:r,className:n("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",e),...t})}),tr=s.forwardRef(function({className:e,severity:t="neutral",...r},i){return o.jsx(R.Toast.Root,{ref:i,className:n("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",Jt[t],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",e),...r})}),rr=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Title,{ref:r,className:n("gryt-toast-title text-sm font-semibold text-gryt-text",e),...t})}),or=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Description,{ref:r,className:n("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",e),...t})}),ar=s.forwardRef(function({className:e,children:t,...r},i){return o.jsx(R.Toast.Close,{ref:i,"aria-label":"Close",className:n("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",e),...r,children:t??o.jsx(P.X,{size:14,weight:"bold"})})}),nr=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Action,{ref:r,className:n("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",e),...t})}),sr={Provider:R.Toast.Provider,Portal:R.Toast.Portal,Viewport:er,Root:tr,Title:rr,Description:or,Close:ar,Action:nr},ir=R.Toast.useToastManager,lr=s.forwardRef(function({className:e,...t},r){return o.jsx(O.ScrollArea.Root,{ref:r,className:n("gryt-scroll-area relative",e),...t})}),cr=s.forwardRef(function({className:e,...t},r){return o.jsx(O.ScrollArea.Viewport,{ref:r,className:n("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",e),...t})}),dr=s.forwardRef(function({className:e,orientation:t,...r},i){return o.jsx(O.ScrollArea.Scrollbar,{ref:i,orientation:t,className:n("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",t==="horizontal"?"h-2 flex-col":"w-2",e),...r,children:o.jsx(O.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),ur={Root:lr,Viewport:cr,Scrollbar:dr,Content:O.ScrollArea.Content,Corner:O.ScrollArea.Corner},gr={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},yr={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},pr=s.forwardRef(function({className:e,size:t="medium",tone:r="primary",...i},l){return o.jsx(Ne.Toggle,{ref:l,className:n("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",f,$,yr[t],gr[r],e),...i})}),mr=s.forwardRef(function({className:e,...t},r){return o.jsx(Re.ToggleGroup,{ref:r,className:n("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",e),...t})}),br={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function fr({className:a,value:e,label:t,showValue:r=!1,tone:i="primary",...l}){return o.jsxs(q.Meter.Root,{value:e,className:n("gryt-meter flex w-full flex-col gap-1.5",a),...l,children:[(t||r)&&o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t?o.jsx(q.Meter.Label,{className:"text-sm text-gryt-muted",children:t}):o.jsx("span",{}),r&&o.jsx(q.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),o.jsx(q.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:o.jsx(q.Meter.Indicator,{className:n("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",br[i])})})]})}const xr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Popup,{ref:r,className:n("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",e),...t})}),hr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Backdrop,{ref:r,className:n("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",e),...t})}),wr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Title,{ref:r,className:n("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",e),...t})}),vr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Description,{ref:r,className:n("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",e),...t})}),jr={Root:S.AlertDialog.Root,Trigger:S.AlertDialog.Trigger,Portal:S.AlertDialog.Portal,Backdrop:hr,Popup:xr,Title:wr,Description:vr,Close:S.AlertDialog.Close},xe=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),he=[ue,ge.medium,"border-gryt-border",f].join(" "),Pr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Input,{ref:r,className:n("gryt-combobox-input",he,e),...t})}),Nr=s.forwardRef(function({className:e,sideOffset:t=6,...r},i){return o.jsx(g.Combobox.Positioner,{ref:i,sideOffset:t,className:n("gryt-combobox-positioner outline-none",e),...r})}),Rr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Popup,{ref:r,className:n("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",I,k,e),...t})}),Tr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Item,{ref:r,className:n("gryt-combobox-item",xe,e),...t})}),Cr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Empty,{ref:r,className:n("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",e),...t})}),Sr={Root:g.Combobox.Root,Input:Pr,InputGroup:g.Combobox.InputGroup,Trigger:g.Combobox.Trigger,Icon:g.Combobox.Icon,Clear:g.Combobox.Clear,Value:g.Combobox.Value,Chips:g.Combobox.Chips,Chip:g.Combobox.Chip,ChipRemove:g.Combobox.ChipRemove,Portal:g.Combobox.Portal,Positioner:Nr,Popup:Rr,List:g.Combobox.List,Item:Tr,ItemIndicator:g.Combobox.ItemIndicator,Group:g.Combobox.Group,GroupLabel:g.Combobox.GroupLabel,Empty:Cr,Separator:g.Combobox.Separator},kr=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Input,{ref:r,className:n("gryt-autocomplete-input",he,e),...t})}),Ar=s.forwardRef(function({className:e,sideOffset:t=6,...r},i){return o.jsx(m.Autocomplete.Positioner,{ref:i,sideOffset:t,className:n("gryt-autocomplete-positioner outline-none",e),...r})}),Mr=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Popup,{ref:r,className:n("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",I,k,e),...t})}),Dr=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Item,{ref:r,className:n("gryt-autocomplete-item",xe,e),...t})}),Ir=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Empty,{ref:r,className:n("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",e),...t})}),Gr={Root:m.Autocomplete.Root,Input:kr,InputGroup:m.Autocomplete.InputGroup,Trigger:m.Autocomplete.Trigger,Icon:m.Autocomplete.Icon,Clear:m.Autocomplete.Clear,Value:m.Autocomplete.Value,Portal:m.Autocomplete.Portal,Positioner:Ar,Popup:Mr,List:m.Autocomplete.List,Item:Dr,Group:m.Autocomplete.Group,GroupLabel:m.Autocomplete.GroupLabel,Empty:Ir,Separator:m.Autocomplete.Separator},Lr=s.forwardRef(function({className:e,...t},r){return o.jsx(Te.CheckboxGroup,{ref:r,className:n("gryt-checkbox-group flex flex-col gap-2",e),...t})}),Or=s.forwardRef(function({className:e,...t},r){return o.jsx(W.Collapsible.Trigger,{ref:r,className:n("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",f,e),...t})}),$r=s.forwardRef(function({className:e,...t},r){return o.jsx(W.Collapsible.Panel,{ref:r,className:n("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",e),...t})}),Fr={Root:W.Collapsible.Root,Trigger:Or,Panel:$r},qr=s.forwardRef(function({className:e,...t},r){return o.jsx(Ce.Form,{ref:r,className:n("gryt-form flex flex-col gap-(--gryt-space-lg)",e),...t})}),Br=s.forwardRef(function({className:e,...t},r){return o.jsx(ie.Fieldset.Root,{ref:r,className:n("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",e),...t})}),zr=s.forwardRef(function({className:e,...t},r){return o.jsx(ie.Fieldset.Legend,{ref:r,className:n("gryt-fieldset-legend text-sm font-semibold text-gryt-text",e),...t})}),Er={Root:Br,Legend:zr},_r=s.forwardRef(function({className:e,...t},r){return o.jsx(Se.Menubar,{ref:r,className:n("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",e),...t})}),Yr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Trigger,{ref:r,className:n("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",f,e),...t})}),Hr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Popup,{ref:r,className:n("gryt-navigation-menu-popup outline-none",I,k,e),...t})}),Vr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Positioner,{ref:r,className:n("gryt-navigation-menu-positioner outline-none",e),...t})}),Xr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Viewport,{ref:r,className:n("gryt-navigation-menu-viewport relative overflow-hidden",e),...t})}),Ur=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Link,{ref:r,className:n("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",f,e),...t})}),Kr={Root:w.NavigationMenu.Root,List:w.NavigationMenu.List,Item:w.NavigationMenu.Item,Trigger:Yr,Content:w.NavigationMenu.Content,Portal:w.NavigationMenu.Portal,Positioner:Vr,Viewport:Xr,Popup:Hr,Link:Ur,Icon:w.NavigationMenu.Icon,Arrow:w.NavigationMenu.Arrow},ne="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",Wr=s.forwardRef(function({className:e,label:t,scrubbable:r=!1,...i},l){return o.jsxs(A.NumberField.Root,{ref:l,className:n("gryt-number-field flex flex-col gap-1.5",e),...i,children:[t&&(r?o.jsxs(A.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[t,o.jsx(A.NumberField.ScrubAreaCursor,{})]}):o.jsx("span",{className:"text-sm text-gryt-muted",children:t})),o.jsxs(A.NumberField.Group,{className:n("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",$),children:[o.jsx(A.NumberField.Decrement,{"aria-label":"Decrease",className:n(ne,"rounded-l-(--gryt-radius-full)"),children:o.jsx(P.Minus,{size:14,weight:"bold"})}),o.jsx(A.NumberField.Input,{className:n("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",f)}),o.jsx(A.NumberField.Increment,{"aria-label":"Increase",className:n(ne,"rounded-r-(--gryt-radius-full)"),children:o.jsx(P.Plus,{size:14,weight:"bold"})})]})]})}),Qr=s.forwardRef(function({className:e,length:t=6,...r},i){return o.jsx(re.OTPField.Root,{ref:i,length:t,className:n("gryt-otp-field flex gap-2",e),...r,children:Array.from({length:t},(l,d)=>o.jsx(re.OTPField.Input,{className:n("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",f)},d))})}),Zr=s.forwardRef(function({className:e,sideOffset:t=8,...r},i){return o.jsx(G.PreviewCard.Positioner,{ref:i,sideOffset:t,className:n("gryt-preview-card-positioner outline-none",e),...r})}),Jr=s.forwardRef(function({className:e,...t},r){return o.jsx(G.PreviewCard.Popup,{ref:r,className:n("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",I,k,e),...t})}),eo={Root:G.PreviewCard.Root,Trigger:G.PreviewCard.Trigger,Portal:G.PreviewCard.Portal,Positioner:Zr,Popup:Jr,Arrow:G.PreviewCard.Arrow},to=s.forwardRef(function({className:e,...t},r){return o.jsx(L.Toolbar.Root,{ref:r,className:n("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",e),...t})}),ro=s.forwardRef(function({className:e,...t},r){return o.jsx(L.Toolbar.Separator,{ref:r,className:n("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",e),...t})}),oo={Root:to,Group:L.Toolbar.Group,Button:L.Toolbar.Button,Link:L.Toolbar.Link,Input:L.Toolbar.Input,Separator:ro};Object.defineProperty(exports,"GRYT_HUE_KEYS",{enumerable:!0,get:()=>c.GRYT_HUE_KEYS});Object.defineProperty(exports,"GRYT_NEUTRAL_KEYS",{enumerable:!0,get:()=>c.GRYT_NEUTRAL_KEYS});Object.defineProperty(exports,"GRYT_RADIUS_KEYS",{enumerable:!0,get:()=>c.GRYT_RADIUS_KEYS});Object.defineProperty(exports,"GRYT_THEME_NAME_MAX",{enumerable:!0,get:()=>c.GRYT_THEME_NAME_MAX});Object.defineProperty(exports,"alphaScale",{enumerable:!0,get:()=>c.alphaScale});Object.defineProperty(exports,"cloneGrytTheme",{enumerable:!0,get:()=>c.cloneGrytTheme});Object.defineProperty(exports,"contrast",{enumerable:!0,get:()=>c.contrast});Object.defineProperty(exports,"createGrytTheme",{enumerable:!0,get:()=>c.createGrytTheme});Object.defineProperty(exports,"decodeGrytTheme",{enumerable:!0,get:()=>c.decodeGrytTheme});Object.defineProperty(exports,"encodeGrytTheme",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"grytAlphaScales",{enumerable:!0,get:()=>c.grytAlphaScales});Object.defineProperty(exports,"grytAlphaScalesLight",{enumerable:!0,get:()=>c.grytAlphaScalesLight});Object.defineProperty(exports,"grytLightTokens",{enumerable:!0,get:()=>c.grytLightTokens});Object.defineProperty(exports,"grytPresets",{enumerable:!0,get:()=>c.grytPresets});Object.defineProperty(exports,"grytPresetsById",{enumerable:!0,get:()=>c.grytPresetsById});Object.defineProperty(exports,"grytScales",{enumerable:!0,get:()=>c.grytScales});Object.defineProperty(exports,"grytScalesLight",{enumerable:!0,get:()=>c.grytScalesLight});Object.defineProperty(exports,"grytTheme",{enumerable:!0,get:()=>c.grytTheme});Object.defineProperty(exports,"grytThemeHues",{enumerable:!0,get:()=>c.grytThemeHues});Object.defineProperty(exports,"grytThemeToOptions",{enumerable:!0,get:()=>c.grytThemeToOptions});Object.defineProperty(exports,"grytTokens",{enumerable:!0,get:()=>c.grytTokens});Object.defineProperty(exports,"hexToOklch",{enumerable:!0,get:()=>c.hexToOklch});Object.defineProperty(exports,"hexToRgb",{enumerable:!0,get:()=>c.hexToRgb});Object.defineProperty(exports,"hueScale",{enumerable:!0,get:()=>c.hueScale});Object.defineProperty(exports,"hueScaleLight",{enumerable:!0,get:()=>c.hueScaleLight});Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:()=>c.isHexColor});Object.defineProperty(exports,"neutralScale",{enumerable:!0,get:()=>c.neutralScale});Object.defineProperty(exports,"neutralScaleLight",{enumerable:!0,get:()=>c.neutralScaleLight});Object.defineProperty(exports,"normalizeHexColor",{enumerable:!0,get:()=>c.normalizeHexColor});Object.defineProperty(exports,"normalizeThemeName",{enumerable:!0,get:()=>c.normalizeThemeName});Object.defineProperty(exports,"oklchToHex",{enumerable:!0,get:()=>c.oklchToHex});Object.defineProperty(exports,"rgbToHex",{enumerable:!0,get:()=>c.rgbToHex});Object.defineProperty(exports,"avatarSeed",{enumerable:!0,get:()=>K.avatarSeed});exports.Accordion=Ht;exports.Alert=dt;exports.AlertDialog=jr;exports.Autocomplete=Gr;exports.Avatar=pe;exports.Badge=Ve;exports.Button=de;exports.Card=nt;exports.CardActions=lt;exports.CardContent=it;exports.CardHeader=st;exports.Checkbox=Ke;exports.CheckboxGroup=Lr;exports.Chip=Ue;exports.Collapsible=Fr;exports.Combobox=Sr;exports.Composer=_e;exports.ContextMenu=Xt;exports.ConversationItem=He;exports.Dialog=wt;exports.Divider=at;exports.Drawer=Mt;exports.Fieldset=Er;exports.Form=qr;exports.GrytProvider=Ae;exports.IconButton=qe;exports.Menu=Y;exports.Menubar=_r;exports.MessageBubble=ze;exports.Meter=fr;exports.NavigationMenu=Kr;exports.NumberField=Wr;exports.OtpField=Qr;exports.Popover=Zt;exports.PreviewCard=eo;exports.Progress=ut;exports.Radio=We;exports.RadioGroup=Qe;exports.ScrollArea=ur;exports.Select=tt;exports.Skeleton=pt;exports.Slider=Je;exports.Spinner=gt;exports.Surface=Be;exports.Switch=Ze;exports.Tab=fe;exports.Tabs=Bt;exports.TextField=Ee;exports.Toast=sr;exports.Toggle=pr;exports.ToggleGroup=mr;exports.Toolbar=oo;exports.Tooltip=rt;exports.TooltipProvider=ot;exports.cn=n;exports.useMediaQuery=be;exports.useToastManager=ir;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),z=require("@base-ui/react/tooltip"),i=require("react"),c=require("@gryt/theme"),Ue=require("@base-ui/react/button"),wt=require("clsx"),vt=require("tailwind-merge"),ce=require("@base-ui/react/field"),T=require("@phosphor-icons/react"),he=require("@base-ui/react/avatar"),Pe=require("@gryt/owl"),Le=require("@base-ui/react/checkbox"),He=require("@base-ui/react/radio"),jt=require("@base-ui/react/radio-group"),Ge=require("@base-ui/react/switch"),ee=require("@base-ui/react/slider"),S=require("@base-ui/react/select"),Nt=require("@base-ui/react/separator"),we=require("@base-ui/react/progress"),H=require("@base-ui/react/dialog"),M=require("@base-ui/react/drawer"),B=require("@base-ui/react/menu"),ie=require("@base-ui/react/tabs"),ae=require("@base-ui/react/accordion"),L=require("@base-ui/react/context-menu"),$=require("@base-ui/react/popover"),I=require("@base-ui/react/toast"),W=require("@base-ui/react/scroll-area"),Tt=require("@base-ui/react/toggle"),Pt=require("@base-ui/react/toggle-group"),te=require("@base-ui/react/meter"),G=require("@base-ui/react/alert-dialog"),j=require("@base-ui/react/autocomplete"),w=require("@base-ui/react/combobox"),Rt=require("@base-ui/react/checkbox-group"),ke=require("@base-ui/react/collapsible"),Ct=require("@base-ui/react/form"),Xe=require("@base-ui/react/fieldset"),St=require("@base-ui/react/menubar"),k=require("@base-ui/react/navigation-menu"),E=require("@base-ui/react/number-field"),Oe=require("@base-ui/react/otp-field"),X=require("@base-ui/react/preview-card"),K=require("@base-ui/react/toolbar"),Ke=i.createContext(void 0);function We(){return i.useContext(Ke)}function kt(n){return Object.keys(n).some(e=>e.startsWith("--"))}function At({children:n,className:e,theme:t,tooltipDelay:r=400,containOverlays:a=!1}){const d=i.useRef(null),m=t===void 0?void 0:kt(t)?t:c.createGrytTheme(t);return o.jsx("div",{className:e,style:m,ref:d,children:o.jsx(Ke.Provider,{value:a?d:void 0,children:o.jsx(z.Tooltip.Provider,{delay:r,children:n})})})}function s(...n){return vt.twMerge(wt.clsx(n))}const Mt={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover data-disabled:text-gryt-muted",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Dt={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},se=i.forwardRef(function({children:e,className:t,endIcon:r,size:a="medium",startIcon:d,tone:m="primary",...g},p){return o.jsxs(Ue.Button,{ref:p,className:s("gryt-button","inline-flex cursor-pointer items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",Dt[a],Mt[m],t),...g,children:[d,e,r]})}),P="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",$t="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",Je=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),Qe={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},q="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",O=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),J="cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50",It={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},Ze={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Lt={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Ht={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},Gt={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Ot={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},Et=i.forwardRef(function({className:e,size:t="medium",tone:r="neutral",...a},d){return o.jsx(Ue.Button,{ref:d,className:s("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",P,J,Ot[t],Gt[r],e),...a})}),Ft=i.forwardRef(function({className:e,elevated:t=!1,...r},a){return o.jsx("div",{ref:a,className:s("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",t?"bg-gryt-surface-raised":"bg-gryt-surface",e),...r})}),zt=i.forwardRef(function({children:e,className:t,from:r="assistant",...a},d){return o.jsx("div",{ref:d,className:s("gryt-message-bubble",r==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",r==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",r==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",t),...a,children:e})}),Ae=i.forwardRef(function({className:e,error:t=!1,fieldClassName:r,helperText:a,label:d,minRows:m=3,multiline:g=!1,size:p="medium",...f},y){const x=o.jsx(ce.Field.Control,{ref:y,render:g?o.jsx("textarea",{rows:m}):void 0,className:s("gryt-text-field-control",Je,g&&"resize-y leading-6",t?"border-gryt-danger":"border-gryt-border",Qe[p],e),...f});return o.jsxs(ce.Field.Root,{className:s("gryt-text-field flex w-full flex-col gap-1.5",r),children:[d?o.jsx(ce.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:d}):null,x,a?o.jsx(ce.Field.Description,{className:s("text-xs",t?"text-gryt-danger-11":"text-gryt-muted"),children:a}):null]})}),Bt=i.forwardRef(function({className:e,disabled:t=!1,maxRows:r=8,minRows:a=1,onSubmit:d,placeholder:m="Message Gryt",submitLabel:g="Send",...p},f){const y=i.useRef(null),x=i.useCallback(()=>{const h=y.current;if(!h)return;const N=window.getComputedStyle(h),v=parseFloat(N.lineHeight)||24,A=parseFloat(N.paddingTop)+parseFloat(N.paddingBottom);h.style.height="auto",h.style.height=`${Math.min(Math.max(h.scrollHeight,v*a+A),v*r+A)}px`},[r,a]);i.useLayoutEffect(x,[x,p.value]);function R(h){if(!d){h.preventDefault();return}d(h)}return o.jsxs("form",{className:s("gryt-composer",e),onSubmit:R,children:[o.jsx("textarea",{ref:h=>{y.current=h,typeof f=="function"?f(h):f&&(f.current=h)},rows:a,disabled:t,placeholder:m,onInput:x,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...p}),o.jsx(se,{type:"submit",disabled:t,size:"small",endIcon:o.jsx(T.PaperPlaneTilt,{size:14,weight:"fill"}),children:g})]})}),_t={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},Ee=256,et=i.forwardRef(function({alt:e,children:t,className:r,fallback:a,seed:d,eggSeed:m,size:g="medium",src:p,...f},y){const x=i.useMemo(()=>d?Pe.owlAvatarDataUri(d,{size:Ee}):void 0,[d]),R=i.useMemo(()=>m?Pe.eggAvatarDataUri(m,{size:Ee}):void 0,[m]),h=x??R;return o.jsxs(he.Avatar.Root,{ref:y,className:s("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",_t[g],r),...f,children:[p?o.jsx(he.Avatar.Image,{src:p,alt:e,className:"h-full w-full object-cover"}):null,o.jsx(he.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:h?o.jsx("img",{src:h,alt:e,className:"h-full w-full object-cover"}):a??t})]})}),qt=i.forwardRef(function({active:e=!1,avatar:t,className:r,subtitle:a,title:d,...m},g){return o.jsxs("button",{ref:g,type:"button",className:s("gryt-conversation-item enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",e?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",r),...m,children:[t??o.jsx(et,{size:"small",className:s(e?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:d.slice(0,1).toUpperCase()}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-semibold",children:d}),a?o.jsx("span",{className:s("block truncate text-xs",e?"text-gryt-on-accent/85":"text-gryt-muted"),children:a}):null]})]})}),Yt=i.forwardRef(function({badgeContent:e,children:t,className:r,max:a=99,showZero:d=!1,...m},g){const p=typeof e=="number"?e:null,f=p!==null&&p===0&&!d,y=p!==null&&p>a?`${a}+`:e;return o.jsxs("span",{ref:g,className:s("gryt-badge relative inline-flex",r),...m,children:[t,e!==void 0&&!f?o.jsx("span",{className:s("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:y}):null]})}),Vt={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Ut=i.forwardRef(function({children:e,className:t,icon:r,label:a,onDelete:d,tone:m="neutral",...g},p){return o.jsxs("span",{ref:p,className:s("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",Vt[m],t),...g,children:[r,a??e,d?o.jsx("button",{type:"button","aria-label":"Remove",onClick:d,className:s("-mr-1 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",P),children:o.jsx(T.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Re=i.forwardRef(function({className:e,tone:t="primary",...r},a){return o.jsx(Le.Checkbox.Root,{ref:a,className:s("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",P,J,It[t],e),...r,children:o.jsx(Le.Checkbox.Indicator,{keepMounted:!0,className:s("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:o.jsx(T.Check,{size:12,weight:"bold"})})})}),Xt=i.forwardRef(function({className:e,tone:t="primary",...r},a){return o.jsx(He.Radio.Root,{ref:a,className:s("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",P,J,Lt[t],e),...r,children:o.jsx(He.Radio.Indicator,{keepMounted:!0,className:s("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",Ze[t])})})}),Kt=i.forwardRef(function({className:e,...t},r){return o.jsx(jt.RadioGroup,{ref:r,className:s("gryt-radio-group flex flex-col gap-2",e),...t})}),Wt=i.forwardRef(function({className:e,tone:t="primary",...r},a){return o.jsx(Ge.Switch.Root,{ref:a,className:s("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",P,J,Ht[t],e),...r,children:o.jsx(Ge.Switch.Thumb,{className:s("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),Fe=3;function tt({className:n,tone:e="primary","aria-label":t,...r}){const[a,d]=i.useState(!1),m=i.useRef(null);i.useEffect(()=>{if(!a&&m.current===null)return;const y=()=>{m.current=null,d(!1)};return window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),()=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}},[a]);function g(y){m.current={x:y.clientX,y:y.clientY}}function p(y){const x=m.current;if(x===null||a)return;(Math.abs(y.clientX-x.x)>Fe||Math.abs(y.clientY-x.y)>Fe)&&d(!0)}const f=a?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return o.jsx(ee.Slider.Root,{className:s("gryt-slider w-full",n),...r,children:o.jsx(ee.Slider.Control,{className:"flex w-full cursor-pointer touch-none items-center py-2 select-none",onPointerDown:g,onPointerMove:p,children:o.jsxs(ee.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[o.jsx(ee.Slider.Indicator,{className:s("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",f,Ze[e])}),o.jsx(ee.Slider.Thumb,{"aria-label":t,className:s("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",f,$t),children:o.jsx("span",{className:s("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const Jt={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function rt({className:n,label:e,options:t=[],placeholder:r="Select",size:a="medium",...d}){const m=We();return o.jsxs(S.Select.Root,{items:t,...d,children:[o.jsxs("div",{className:s("gryt-select flex w-full flex-col gap-1.5",n),children:[e?o.jsx(S.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:e}):null,o.jsxs(S.Select.Trigger,{className:s("flex w-full cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",P,Jt[a]),children:[o.jsx(S.Select.Value,{placeholder:r}),o.jsx(S.Select.Icon,{className:"shrink-0 text-gryt-muted",children:o.jsx(T.CaretUpDown,{size:16})})]})]}),o.jsx(S.Select.Portal,{container:m,children:o.jsx(S.Select.Positioner,{sideOffset:6,className:"gryt-select-positioner outline-none",children:o.jsx(S.Select.Popup,{className:s("min-w-(--anchor-width) p-1",q,O),children:o.jsx(S.Select.List,{children:t.map(g=>o.jsxs(S.Select.Item,{value:g.value,disabled:g.disabled,className:s("flex cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[o.jsx(S.Select.ItemText,{children:g.label}),o.jsx(S.Select.ItemIndicator,{className:"text-gryt-accent-11",children:o.jsx(T.Check,{size:14,weight:"bold"})})]},String(g.value)))})})})})]})}function Qt({children:n,className:e,side:t="top",sideOffset:r=8,title:a}){const d=We();return o.jsxs(z.Tooltip.Root,{children:[o.jsx(z.Tooltip.Trigger,{render:n}),o.jsx(z.Tooltip.Portal,{container:d,children:o.jsx(z.Tooltip.Positioner,{side:t,sideOffset:r,className:"gryt-tooltip-positioner",children:o.jsx(z.Tooltip.Popup,{className:s("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",O,e),children:a})})})]})}const Zt=z.Tooltip.Provider,er=i.forwardRef(function({className:e,orientation:t="horizontal",...r},a){return o.jsx(Nt.Separator,{ref:a,orientation:t,className:s("gryt-divider bg-gryt-border",t==="vertical"?"h-full w-px":"h-px w-full",e),...r})}),tr=i.forwardRef(function({className:e,...t},r){return o.jsx("div",{ref:r,className:s("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",e),...t})});function rr({children:n,className:e,subheader:t,title:r,...a}){return o.jsxs("div",{className:s("gryt-card-header flex flex-col gap-1 p-4",e),...a,children:[r?o.jsx("span",{className:"text-base font-semibold text-gryt-text",children:r}):null,t?o.jsx("span",{className:"text-sm text-gryt-muted",children:t}):null,n]})}function or({className:n,...e}){return o.jsx("div",{className:s("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",n),...e})}function nr({className:n,...e}){return o.jsx("div",{className:s("gryt-card-actions flex items-center gap-2 px-4 pb-4",n),...e})}const ar={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},sr=i.forwardRef(function({className:e,severity:t="info",...r},a){return o.jsx("div",{ref:a,role:"alert",className:s("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",ar[t],e),...r})});function ir({className:n,value:e=null,...t}){return o.jsx(we.Progress.Root,{value:e,className:s("gryt-progress w-full",n),...t,children:o.jsx(we.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:o.jsx(we.Progress.Indicator,{className:s("h-full rounded-(--gryt-radius-full) bg-gryt-accent","transition-[width] duration-300 ease-out motion-reduce:transition-none",e===null&&"gryt-progress-indeterminate")})})})}function lr({className:n,size:e=24,"aria-label":t="Loading"}){return o.jsx(T.CircleNotch,{role:"status","aria-label":t,size:e,weight:"bold",className:s("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",n)})}const cr={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function dr({className:n,height:e,style:t,variant:r="text",width:a,...d}){const m={width:a,height:e,...t};return o.jsx("div",{"aria-hidden":"true",className:s("gryt-skeleton bg-white/9 motion-safe:animate-pulse",cr[r],n),style:m,...d})}const ot="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",ur=i.forwardRef(function({className:e,...t},r){return o.jsx(H.Dialog.Backdrop,{ref:r,className:s("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",ot,"data-starting-style:opacity-0 data-ending-style:opacity-0",e),...t})}),gr=i.forwardRef(function({className:e,...t},r){return o.jsx(H.Dialog.Popup,{ref:r,className:s("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",ot,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",e),...t})}),mr=i.forwardRef(function({className:e,...t},r){return o.jsx(H.Dialog.Title,{ref:r,className:s("gryt-dialog-title text-base font-semibold text-gryt-text",e),...t})}),fr=i.forwardRef(function({className:e,...t},r){return o.jsx(H.Dialog.Description,{ref:r,className:s("gryt-dialog-description text-sm text-gryt-muted",e),...t})}),pr=i.forwardRef(function({className:e,...t},r){return o.jsx("div",{ref:r,className:s("gryt-dialog-footer flex justify-end gap-3",e),...t})}),yr={Root:H.Dialog.Root,Trigger:H.Dialog.Trigger,Portal:H.Dialog.Portal,Close:H.Dialog.Close,Backdrop:ur,Popup:gr,Title:mr,Description:fr,Footer:pr},xr=()=>()=>{};function nt(n){const e=i.useCallback(r=>{if(typeof window>"u"||!window.matchMedia)return xr();const a=window.matchMedia(n);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[n]),t=i.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(n).matches,[n]);return i.useSyncExternalStore(e,t,()=>!1)}const br={left:"left",right:"right",top:"up",bottom:"down"},me=i.createContext("right"),hr={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},wr={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},vr={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function jr({side:n="right",sheetOnMobile:e=!0,children:t,...r}){const a=nt("(max-width: 767px)"),d=e&&a?"bottom":n;return o.jsx(me.Provider,{value:d,children:o.jsx(M.Drawer.Root,{swipeDirection:br[d],...r,children:t})})}const Nr=i.forwardRef(function({className:e,...t},r){const a=i.useContext(me);return o.jsx(M.Drawer.Viewport,{ref:r,className:s("gryt-drawer-viewport fixed inset-0 z-50 flex",hr[a],e),...t})}),Tr=i.forwardRef(function({className:e,...t},r){const a=i.useContext(me);return o.jsx(M.Drawer.Popup,{ref:r,className:s("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",vr[a],wr[a],e),...t})}),Pr=i.forwardRef(function({className:e,...t},r){return o.jsx(M.Drawer.Backdrop,{ref:r,className:s("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",e),...t})});function Rr({className:n}){const e=i.useContext(me);return e!=="bottom"&&e!=="top"?null:o.jsx("div",{"aria-hidden":!0,className:s("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",e==="top"&&"order-last",n)})}const Cr={Root:jr,Trigger:M.Drawer.Trigger,Portal:M.Drawer.Portal,Backdrop:Pr,Viewport:Nr,Popup:Tr,Content:M.Drawer.Content,Grabber:Rr,Close:M.Drawer.Close,Title:M.Drawer.Title,Description:M.Drawer.Description},Sr=i.forwardRef(function({className:e,sideOffset:t=8,...r},a){return o.jsx(B.Menu.Positioner,{ref:a,sideOffset:t,className:s("gryt-menu-positioner outline-none",e),...r})}),kr=i.forwardRef(function({className:e,...t},r){return o.jsx(B.Menu.Popup,{ref:r,className:s("gryt-menu min-w-44 p-1 outline-none",q,O,e),...t})}),Ar=i.forwardRef(function({className:e,...t},r){return o.jsx(B.Menu.Item,{ref:r,className:s("gryt-menu-item flex cursor-pointer items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...t})}),Mr=i.forwardRef(function({className:e,...t},r){return o.jsx(B.Menu.Separator,{ref:r,className:s("gryt-menu-separator my-1 h-px bg-gryt-border",e),...t})}),ue={Root:B.Menu.Root,Trigger:B.Menu.Trigger,Portal:B.Menu.Portal,Positioner:Sr,Popup:kr,Item:Ar,Separator:Mr},Dr=i.forwardRef(function({className:e,...t},r){return o.jsx(ie.Tabs.Root,{ref:r,className:s("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",e),...t})}),$r=i.forwardRef(function({className:e,...t},r){return o.jsx(ie.Tabs.List,{ref:r,className:s("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",e),...t})}),at=i.forwardRef(function({className:e,...t},r){return o.jsx(ie.Tabs.Tab,{ref:r,className:s("gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 hover:text-gryt-text","transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96]","motion-reduce:transition-colors motion-reduce:duration-150","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)","data-disabled:cursor-not-allowed data-disabled:opacity-50",P,e),...t})}),Ir=i.forwardRef(function({className:e,...t},r){return o.jsx(ie.Tabs.Indicator,{ref:r,renderBeforeHydration:!0,className:s("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",e),...t})}),Lr=i.forwardRef(function({className:e,...t},r){return o.jsx(ie.Tabs.Panel,{ref:r,className:s("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",e),...t})}),Hr=Object.assign(Dr,{List:$r,Tab:at,Panel:Lr,Indicator:Ir}),Gr=i.forwardRef(function({className:e,...t},r){return o.jsx(ae.Accordion.Root,{ref:r,className:s("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",e),...t})}),Or=i.forwardRef(function({className:e,...t},r){return o.jsx(ae.Accordion.Item,{ref:r,className:s("gryt-accordion-item",e),...t})}),Er=i.forwardRef(function({children:e,className:t,expandIcon:r,...a},d){return o.jsx(ae.Accordion.Header,{className:"gryt-accordion-header m-0",children:o.jsxs(ae.Accordion.Trigger,{ref:d,className:s("gryt-accordion-trigger flex w-full cursor-pointer items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",P,t),...a,children:[e,r===void 0?o.jsx(T.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):r]})})}),Fr=i.forwardRef(function({children:e,className:t,...r},a){return o.jsx(ae.Accordion.Panel,{ref:a,className:s("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...r,children:o.jsx("div",{className:"px-3 pt-1 pb-3",children:e})})}),zr=Object.assign(Gr,{Item:Or,Trigger:Er,Panel:Fr}),Br=i.forwardRef(function({className:e,sideOffset:t=2,...r},a){return o.jsx(L.ContextMenu.Positioner,{ref:a,sideOffset:t,className:s("gryt-context-menu-positioner outline-none",e),...r})}),_r={Root:L.ContextMenu.Root,Trigger:L.ContextMenu.Trigger,Portal:L.ContextMenu.Portal,Positioner:Br,Popup:ue.Popup,Item:ue.Item,Separator:ue.Separator,Group:L.ContextMenu.Group,GroupLabel:L.ContextMenu.GroupLabel,SubmenuRoot:L.ContextMenu.SubmenuRoot,SubmenuTrigger:L.ContextMenu.SubmenuTrigger},qr=i.forwardRef(function({className:e,sideOffset:t=8,...r},a){return o.jsx($.Popover.Positioner,{ref:a,sideOffset:t,className:s("gryt-popover-positioner outline-none",e),...r})}),Yr=i.forwardRef(function({className:e,...t},r){return o.jsx($.Popover.Popup,{ref:r,className:s("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",q,O,e),...t})}),Vr=i.forwardRef(function({className:e,...t},r){return o.jsx($.Popover.Title,{ref:r,className:s("gryt-popover-title text-sm font-semibold text-gryt-text",e),...t})}),Ur=i.forwardRef(function({className:e,...t},r){return o.jsx($.Popover.Description,{ref:r,className:s("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",e),...t})}),Xr={Root:$.Popover.Root,Trigger:$.Popover.Trigger,Portal:$.Popover.Portal,Positioner:qr,Popup:Yr,Title:Vr,Description:Ur,Close:$.Popover.Close,Arrow:$.Popover.Arrow},Kr={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},Wr=i.forwardRef(function({className:e,...t},r){return o.jsx(I.Toast.Viewport,{ref:r,className:s("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",e),...t})}),Jr=i.forwardRef(function({className:e,severity:t="neutral",...r},a){return o.jsx(I.Toast.Root,{ref:a,className:s("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",Kr[t],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",e),...r})}),Qr=i.forwardRef(function({className:e,...t},r){return o.jsx(I.Toast.Title,{ref:r,className:s("gryt-toast-title text-sm font-semibold text-gryt-text",e),...t})}),Zr=i.forwardRef(function({className:e,...t},r){return o.jsx(I.Toast.Description,{ref:r,className:s("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",e),...t})}),eo=i.forwardRef(function({className:e,children:t,...r},a){return o.jsx(I.Toast.Close,{ref:a,"aria-label":"Close",className:s("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",e),...r,children:t??o.jsx(T.X,{size:14,weight:"bold"})})}),to=i.forwardRef(function({className:e,...t},r){return o.jsx(I.Toast.Action,{ref:r,className:s("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",e),...t})}),ro={Provider:I.Toast.Provider,Portal:I.Toast.Portal,Viewport:Wr,Root:Jr,Title:Qr,Description:Zr,Close:eo,Action:to},oo=I.Toast.useToastManager,no=i.forwardRef(function({className:e,...t},r){return o.jsx(W.ScrollArea.Root,{ref:r,className:s("gryt-scroll-area relative",e),...t})}),ao=i.forwardRef(function({className:e,...t},r){return o.jsx(W.ScrollArea.Viewport,{ref:r,className:s("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",e),...t})}),so=i.forwardRef(function({className:e,orientation:t,...r},a){return o.jsx(W.ScrollArea.Scrollbar,{ref:a,orientation:t,className:s("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",t==="horizontal"?"h-2 flex-col":"w-2",e),...r,children:o.jsx(W.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),io={Root:no,Viewport:ao,Scrollbar:so,Content:W.ScrollArea.Content,Corner:W.ScrollArea.Corner},lo={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},co={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},Ce=i.forwardRef(function({className:e,size:t="medium",tone:r="primary",...a},d){return o.jsx(Tt.Toggle,{ref:d,className:s("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",P,J,co[t],lo[r],e),...a})}),st=i.forwardRef(function({className:e,...t},r){return o.jsx(Pt.ToggleGroup,{ref:r,className:s("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",e),...t})}),it=c.GRYT_RADIUS_KEYS,uo=c.grytTheme;function Se(n,e){return e==="light"&&n.lightHue!==null?"lightHue":"hue"}const ge=c.grytThemeHues;function lt(n){return{hue:{...n.hue},lightHue:n.lightHue===null?null:{...n.lightHue},dark:{...n.dark},light:{...n.light},radius:{...n.radius}}}function go(n,e){return{...ge(n,e),...n[e]}}function ct(n,e){return c.createGrytTheme(c.grytThemeToOptions(n,e))}function D(n,e){const t=n;return Array.from({length:12},(r,a)=>t[`--gryt-${e}-${a+1}`])}function ze(n){return JSON.stringify(n)}const ve={accent:"Accent",accentLight:"Accent, light",secondary:"Secondary",secondaryLight:"Secondary, light",success:"Success",danger:"Danger",dangerLight:"Danger, light",warning:"Warning",onAccent:"Text on accent",onSecondary:"Text on secondary",onDanger:"Text on danger"},Be={bg:"Page",surface:"Surface",surfaceRaised:"Raised surface",surfaceHover:"Surface, hovered",border:"Border",muted:"Muted text",text:"Text"},_e={sm:"Small",md:"Medium",lg:"Large",xl:"Extra large",full:"Full"},mo={sm:"Chips, swatches, small insets",md:"Menu rows, list items",lg:"Cards and panels",xl:"Dialogs, composers, bubbles",full:"Buttons, fields, avatars"};function re({label:n,value:e,onChange:t,warning:r,disabled:a=!1}){const d=i.useId(),[m,g]=i.useState(e),[p,f]=i.useState(e);e!==p&&(f(e),g(e));function y(x){g(x),c.isHexColor(x)&&t(c.normalizeHexColor(x))}return o.jsxs("div",{className:"min-w-0",children:[o.jsxs("span",{className:"mb-1 flex items-center gap-1.5 text-xs font-medium text-gryt-muted",id:`${d}-label`,children:[o.jsx("span",{className:"truncate",children:n}),r?o.jsx("span",{className:"inline-flex shrink-0 text-gryt-warning-11",title:r,children:o.jsx(T.Warning,{"aria-label":r,size:13})}):null]}),o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("input",{"aria-label":`${n}, colour picker`,className:"docs-swatch disabled:cursor-not-allowed disabled:opacity-60",disabled:a,onChange:x=>y(x.target.value),type:"color",value:c.normalizeHexColor(e)}),o.jsx(Ae,{"aria-label":`${n}, hex value`,className:"font-mono",disabled:a,onBlur:()=>g(e),onChange:x=>y(x.target.value),size:"small",spellCheck:!1,value:m})]})]})}const fo={pass:T.Check,tight:T.Warning,fail:T.X},qe={pass:"text-gryt-success-11",tight:"text-gryt-warning-11",fail:"text-gryt-danger-11"};function po({checks:n,onRepair:e}){const t=n.filter(r=>!r.advisory&&r.level==="fail").length;return o.jsxs("section",{className:"min-w-0",children:[o.jsxs("header",{className:"flex items-center justify-between gap-2 pb-2",children:[o.jsx("h2",{className:"m-0 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Contrast"}),t>0?o.jsxs("span",{className:"text-xs text-gryt-danger-11",children:[t," of ",n.length]}):o.jsxs("span",{className:"text-xs text-gryt-muted",children:[n.length," checks pass"]})]}),o.jsx("ul",{className:"m-0 list-none space-y-1 p-0",children:n.map(r=>{const a=r.advisory&&r.level==="fail"?"tight":r.level,d=fo[a];return o.jsxs("li",{className:"flex items-center justify-between gap-2 text-xs",children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[o.jsx(d,{"aria-hidden":"true",className:qe[a],size:12}),o.jsx("span",{className:"truncate text-gryt-muted",children:r.label})]}),o.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-gryt-muted",children:[o.jsx("span",{className:a==="pass"?"text-gryt-text":qe[a],children:r.ratio.toFixed(1)}),o.jsxs("span",{"aria-hidden":"true",children:[" / ",r.min]}),o.jsxs("span",{className:"sr-only",children:[" against a minimum of ",r.min]}),!r.advisory&&r.ratio>=7?o.jsx("span",{className:"pl-1.5 text-[10px] text-gryt-success-11",children:"AAA"}):null]})]},r.id)})}),e?o.jsx("div",{className:"pt-3",children:o.jsx(se,{onClick:e,size:"small",tone:"neutral",children:"Fix the text colours"})}):null]})}function Y({label:n,steps:e}){return o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{className:"mb-1 block text-[11px] font-medium tracking-wide text-gryt-muted",children:n}),o.jsx("ol",{className:"m-0 flex list-none gap-px overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border p-0",children:e.map((t,r)=>o.jsx("li",{className:"h-6 min-w-0 flex-1",style:{backgroundColor:t},title:`${n} ${r+1} · ${t}`},`${n}-${r}`))})]})}const yo=[{family:"accent",label:"Accent"},{family:"secondary",label:"Secondary"},{family:"success",label:"Success"},{family:"danger",label:"Danger"},{family:"warning",label:"Warning"}];function xo(n,e){return n<e?"fail":n<e*1.1?"tight":"pass"}function F(n,e,t,r,a,d,m=!1){const g=c.contrast(t,r);return{id:n,label:e,foreground:t,background:r,ratio:g,min:a,level:xo(g,a),advisory:m,paths:d}}function bo(n,e,t){const r=D(e,"neutral"),a=r[0],d=r[1],m=r[11],g=r[10],p=r[5],f=t,y=Se(n,t),x=ge(n,t),R=[F("text-page","Text on the page",m,a,4.5,[`${f}.text`,`${f}.bg`]),F("text-surface","Text on a surface",m,d,4.5,[`${f}.text`,`${f}.surface`]),F("muted-page","Muted text on the page",g,a,4.5,[`${f}.muted`,`${f}.bg`]),F("muted-surface","Muted text on a surface",g,d,4.5,[`${f}.muted`,`${f}.surface`])];for(const{family:N,label:v}of yo){const A=D(e,N);R.push(F(`${N}-text`,`${v} text on the page`,A[10],a,4.5,[`${y}.${N}`,`${f}.bg`]))}const h=[{family:"accent",on:"onAccent",label:"Label on a filled button"},{family:"secondary",on:"onSecondary",label:"Label on a secondary button"},{family:"danger",on:"onDanger",label:"Label on a danger button"}];for(const{family:N,on:v,label:A}of h)R.push(F(`${v}-fill`,A,x[v],D(e,N)[8],4.5,[`${y}.${v}`,`${y}.${N}`]));return R.push(F("border-page","Border against the page",p,a,1.15,[`${f}.border`,`${f}.bg`],!0)),R}function b(n,e){return n+Math.random()*(e-n)}function je(n){return n[Math.floor(Math.random()*n.length)]}const ho=[{sm:8,md:12,lg:20,xl:28,full:999},{sm:6,md:8,lg:14,xl:18,full:999},{sm:4,md:6,lg:10,xl:14,full:8},{sm:2,md:4,lg:6,xl:8,full:4},{sm:10,md:16,lg:24,xl:32,full:999}];function wo(){const n=b(0,360),e=je([.4,.8,1.4,2.2]),t=n+je([-1,1])*b(110,200),r=(R,h,N=n)=>c.oklchToHex({l:R,c:h*e,h:N}),a=b(.15,.21),d={bg:r(a,.011),surface:r(a+.045,.014),surfaceRaised:r(a+.062,.016),surfaceHover:r(a+.125,.022),border:r(a+.125,.024),muted:r(b(.62,.665),.008),text:r(b(.9,.925),.008)},m=b(.95,.968),g={bg:r(m,.006),surface:r(b(.995,1),.001),surfaceRaised:r(m+.016,.004),surfaceHover:r(m-.035,.01),border:r(b(.878,.9),.014),muted:r(b(.46,.5),.014),text:r(b(.23,.27),.014)},p=c.oklchToHex({l:b(.67,.74),c:b(.13,.17),h:n}),f=c.oklchToHex({l:b(.79,.85),c:b(.09,.13),h:t}),y=c.oklchToHex({l:b(.67,.72),c:b(.15,.19),h:b(18,30)}),x={accent:p,accentLight:Ne(p,.085),secondary:f,secondaryLight:Ne(f,.07),success:c.oklchToHex({l:b(.8,.85),c:b(.15,.19),h:b(140,156)}),danger:y,dangerLight:Ne(y,.08),warning:c.oklchToHex({l:b(.82,.86),c:b(.14,.17),h:b(72,90)}),onAccent:"",onSecondary:"",onDanger:""};return x.onAccent=_(p),x.onSecondary=_(f),x.onDanger=_(y),{hue:x,lightHue:null,dark:d,light:g,radius:{...je(ho)}}}function Ne(n,e){const{l:t,c:r,h:a}=c.hexToOklch(n);return c.oklchToHex({l:Math.min(.97,t+e),c:r*.85,h:a})}function _(n){const{c:e,h:t}=c.hexToOklch(n),r=c.oklchToHex({l:.17,c:Math.min(.05,e*.3),h:t}),a=c.oklchToHex({l:.97,c:Math.min(.03,e*.2),h:t}),d=c.contrast(r,n)>=c.contrast(a,n)?r:a;return ne(d,n,7)}function oe(n){return{...n,onAccent:_(n.accent),onSecondary:_(n.secondary),onDanger:_(n.danger)}}function V(n){const e=oe(n);return e.onAccent===n.onAccent&&e.onSecondary===n.onSecondary&&e.onDanger===n.onDanger}function ne(n,e,t){if(c.contrast(n,e)>=t)return n;const{l:r,c:a,h:d}=c.hexToOklch(n),m=r>=c.hexToOklch(e).l?1:-1;let g=r;for(let p=0;p<120;p++){g=Math.min(1,Math.max(0,g+m*.008));const f=c.oklchToHex({l:g,c:a,h:d});if(c.contrast(f,e)>=t)return f;if(g===0||g===1)break}return m===1?"#ffffff":"#000000"}function vo(n){const e=lt(n);for(const t of["dark","light"])e[t].text=ne(e[t].text,e[t].bg,7),e[t].text=ne(e[t].text,e[t].surface,7),e[t].muted=ne(e[t].muted,e[t].bg,4.5),e[t].muted=ne(e[t].muted,e[t].surface,4.5);for(const t of[e.hue,e.lightHue])if(t!==null)for(const[r,a]of[["onAccent","accent"],["onSecondary","secondary"],["onDanger","danger"]]){const d=t[a];c.contrast(t[r],d)<7&&(t[r]=_(d))}return e}function jo(n){return n==="light"?{...c.grytTokens.color,...c.grytLightTokens}:{...c.grytTokens.color}}function No(n,e){const t=jo(e);return Object.entries(go(n,e)).filter(([r,a])=>c.normalizeHexColor(a)!==c.normalizeHexColor(t[r]??""))}function To(n){return it.filter(e=>n.radius[e]!==c.grytTokens.radius[e]).map(e=>[e,n.radius[e]])}function Ye(n,e){const t=[];e==="light"&&t.push(' appearance: "light",');const r=No(n,e);r.length>0&&(t.push(" color: {"),r.forEach(([m,g],p)=>{const f=p===r.length-1?"":",";t.push(` ${m}: "${c.normalizeHexColor(g)}"${f}`)}),t.push(" },"));const a=To(n);a.length>0&&t.push(` radius: { ${a.map(([m,g])=>`${m}: ${g}`).join(", ")} }`);const d=t.length-1;return d>=0&&(t[d]=t[d].replace(/,$/,"")),t.length===0?"":`{
|
|
2
|
+
${t.join(`
|
|
3
|
+
`)}
|
|
4
|
+
}`}function Po(n){const e=Ye(n,"dark"),t=Ye(n,"light");return`import { createGrytTheme, GrytProvider } from "@gryt/ui";
|
|
5
|
+
|
|
6
|
+
// One call per appearance. The scales are regenerated from these anchors, so
|
|
7
|
+
// every component moves with them — not just the tokens named here.
|
|
8
|
+
const dark = createGrytTheme(${e});
|
|
9
|
+
|
|
10
|
+
const light = createGrytTheme(${t});
|
|
11
|
+
|
|
12
|
+
export function App({ appearance }: { appearance: "dark" | "light" }) {
|
|
13
|
+
return (
|
|
14
|
+
<GrytProvider theme={appearance === "light" ? light : dark}>
|
|
15
|
+
{/* your app */}
|
|
16
|
+
</GrytProvider>
|
|
17
|
+
);
|
|
18
|
+
}`}function Ro(n){return JSON.stringify(n,null,2)}function dt(n){const e=n.trim();if(e==="")return{error:"Nothing to import."};const t=c.decodeGrytTheme(e);return t===null?{error:e.startsWith("{")?"No theme in that JSON.":"No theme in that link."}:{draft:t.theme,appearance:t.appearance}}const de={sm:24,md:32,lg:48,xl:64,full:40},Te=999,Co=["bg","surface","surfaceRaised","surfaceHover","border"],So=["text","muted"];function ko({value:n,onChange:e,appearance:t,onAppearanceChange:r,actions:a,footer:d,className:m}){const[g,p]=i.useState(()=>V(n.hue)&&(n.lightHue===null||V(n.lightHue))),[f,y]=i.useState(null);if(f!==null&&f!==n){y(null);const l=V(n.hue)&&(n.lightHue===null||V(n.lightHue));l!==g&&p(l)}const[x,R]=i.useState(""),[h,N]=i.useState(null),v=i.useMemo(()=>ct(n,t),[n,t]),A=i.useMemo(()=>bo(n,v,t),[n,v,t]),Q=i.useMemo(()=>{const l=new Map;for(const u of A)if(!(u.advisory||u.level!=="fail"))for(const C of u.paths)l.has(C)||l.set(C,`${u.label}: ${u.ratio.toFixed(1)}, needs ${u.min}`);return l},[A]),mt=ze(n),Me=c.grytPresets.find(l=>ze(l.theme)===mt)?.id??"custom",De=n[t],fe=Se(n,t),pe=ge(n,t),ft=A.filter(l=>!l.advisory&&l.level==="fail").length;function le(l){y(l),e(l)}function Z(l){const u=l(n);le(g?{...u,hue:oe(u.hue),lightHue:u.lightHue===null?null:oe(u.lightHue)}:u)}function ye(l){p(V(l.hue)&&(l.lightHue===null||V(l.lightHue))),le(l)}function xe(l,u){Z(C=>{const be=Se(C,t);return{...C,[be]:{...ge(C,t),[l]:u}}})}function pt(l){Z(u=>({...u,lightHue:l?{...u.hue}:null}))}function yt(l){p(l),l&&le({...n,hue:oe(n.hue),lightHue:n.lightHue===null?null:oe(n.lightHue)})}function $e(l,u){Z(C=>({...C,[t]:{...C[t],[l]:u}}))}function xt(l){Z(u=>({...u,name:l===""?void 0:l}))}function bt(l,u){Z(C=>({...C,radius:{...C.radius,[l]:u}}))}function ht(l){const u=dt(l);if(u.error!==void 0||u.draft===void 0){N(u.error??"That did not look like a theme.");return}ye(u.draft),u.appearance!==void 0&&r(u.appearance),N(null),R("")}return o.jsxs("div",{className:s("flex min-w-0 flex-col gap-(--space-md)",m),children:[o.jsxs("div",{className:"flex flex-wrap items-end gap-3 border-y border-gryt-border py-3",children:[o.jsx("div",{className:"w-52",children:o.jsx(rt,{label:"Preset",onValueChange:l=>{const u=c.grytPresetsById.get(String(l));u&&ye(u.theme)},options:[...c.grytPresets.map(l=>({label:l.name,value:l.id})),...Me==="custom"?[{label:"Custom",value:"custom"}]:[]],size:"small",value:Me})}),o.jsx("div",{className:"w-48",children:o.jsx(Ae,{label:"Name",maxLength:c.GRYT_THEME_NAME_MAX,onChange:l=>xt(l.target.value),placeholder:"Untitled theme",size:"small",value:n.name??""})}),o.jsxs(se,{onClick:()=>ye(wo()),size:"small",tone:"neutral",children:[o.jsx(T.ArrowsClockwise,{"aria-hidden":"true",size:15}),"Generate"]}),o.jsxs("div",{className:"ml-auto flex items-end gap-3",children:[o.jsxs(st,{"aria-label":"Appearance",onValueChange:l=>{const u=l[l.length-1];(u==="dark"||u==="light")&&r(u)},value:[t],children:[o.jsx(Ce,{size:"small",value:"dark",children:"Dark"}),o.jsx(Ce,{size:"small",value:"light",children:"Light"})]}),a]})]}),o.jsxs("p",{className:"m-0 text-xs text-gryt-muted",children:["Editing the ",t," half. The neutrals below belong to it",n.lightHue===null?"; the hues are shared, because step 9 is the same colour in both.":" and so do the hues."]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[t==="light"?o.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[o.jsx(Re,{checked:n.lightHue!==null,onCheckedChange:pt}),"Light has its own hues"]}):null,o.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[o.jsx(Re,{checked:g,onCheckedChange:yt}),"Pick label colours automatically"]})]}),o.jsxs("div",{className:"flex flex-col gap-(--space-md)",children:[o.jsxs(U,{title:"Surfaces",children:[Co.map(l=>o.jsx(re,{label:Be[l],onChange:u=>$e(l,u),value:De[l],warning:Q.get(`${t}.${l}`)},l)),o.jsx(Y,{label:"neutral",steps:D(v,"neutral")})]}),o.jsx(U,{title:"Text",children:So.map(l=>o.jsx(re,{label:Be[l],onChange:u=>$e(l,u),value:De[l],warning:Q.get(`${t}.${l}`)},l))}),o.jsxs(U,{title:"Accent",children:[["accent","accentLight","onAccent"].map(l=>o.jsx(re,{disabled:g&&l==="onAccent",label:ve[l],onChange:u=>xe(l,u),value:pe[l],warning:Q.get(`${fe}.${l}`)},l)),o.jsx(Y,{label:"accent",steps:D(v,"accent")})]}),o.jsxs(U,{title:"Secondary",children:[["secondary","secondaryLight","onSecondary"].map(l=>o.jsx(re,{disabled:g&&l==="onSecondary",label:ve[l],onChange:u=>xe(l,u),value:pe[l],warning:Q.get(`${fe}.${l}`)},l)),o.jsx(Y,{label:"secondary",steps:D(v,"secondary")})]}),o.jsxs(U,{title:"Status",children:[["success","danger","dangerLight","onDanger","warning"].map(l=>o.jsx(re,{disabled:g&&l==="onDanger",label:ve[l],onChange:u=>xe(l,u),value:pe[l],warning:Q.get(`${fe}.${l}`)},l)),o.jsx(Y,{label:"success",steps:D(v,"success")}),o.jsx(Y,{label:"danger",steps:D(v,"danger")}),o.jsx(Y,{label:"warning",steps:D(v,"warning")})]}),o.jsx(U,{title:"Radius",children:it.map(l=>{const u=n.radius[l],C=l==="full"&&u>=Te?de.full:u;return o.jsxs("div",{className:"min-w-0",children:[o.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[o.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:_e[l]}),o.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:u>=Te?"pill":`${u}px`})]}),o.jsx(tt,{"aria-label":`${_e[l]} radius`,max:de[l],min:0,onValueChange:be=>{const Ie=Number(be);bt(l,l==="full"&&Ie>=de.full?Te:Ie)},value:Math.min(C,de[l])}),o.jsx("p",{className:"m-0 pt-1 text-[11px] text-gryt-muted",children:mo[l]})]},l)})}),o.jsx(po,{checks:A,onRepair:ft>0?()=>le(vo(n)):void 0}),o.jsxs("section",{className:"min-w-0",children:[o.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Load one back"}),o.jsx("p",{className:"m-0 pb-2 text-sm text-gryt-muted",children:"Paste a theme’s JSON, or a link somebody sent you."}),o.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[o.jsx("textarea",{"aria-label":"Theme JSON or a shared link",className:"min-h-11 flex-1 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised px-4 py-2.5 font-mono text-sm text-gryt-text outline-none placeholder:text-gryt-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",onChange:l=>R(l.target.value),placeholder:"{ …",rows:2,spellCheck:!1,value:x}),o.jsx(se,{onClick:()=>ht(x),tone:"neutral",children:"Load"})]}),h?o.jsx("p",{className:"m-0 pt-2 text-sm text-gryt-danger-11",children:h}):null]}),d]})]})}function U({title:n,children:e}){return o.jsxs("section",{className:"min-w-0",children:[o.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:n}),o.jsx("div",{className:"flex flex-col gap-3",children:e})]})}const Ao={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function Mo({className:n,value:e,label:t,showValue:r=!1,tone:a="primary",...d}){return o.jsxs(te.Meter.Root,{value:e,className:s("gryt-meter flex w-full flex-col gap-1.5",n),...d,children:[(t||r)&&o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t?o.jsx(te.Meter.Label,{className:"text-sm text-gryt-muted",children:t}):o.jsx("span",{}),r&&o.jsx(te.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),o.jsx(te.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:o.jsx(te.Meter.Indicator,{className:s("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",Ao[a])})})]})}const Do=i.forwardRef(function({className:e,...t},r){return o.jsx(G.AlertDialog.Popup,{ref:r,className:s("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",e),...t})}),$o=i.forwardRef(function({className:e,...t},r){return o.jsx(G.AlertDialog.Backdrop,{ref:r,className:s("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",e),...t})}),Io=i.forwardRef(function({className:e,...t},r){return o.jsx(G.AlertDialog.Title,{ref:r,className:s("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",e),...t})}),Lo=i.forwardRef(function({className:e,...t},r){return o.jsx(G.AlertDialog.Description,{ref:r,className:s("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",e),...t})}),Ho={Root:G.AlertDialog.Root,Trigger:G.AlertDialog.Trigger,Portal:G.AlertDialog.Portal,Backdrop:$o,Popup:Do,Title:Io,Description:Lo,Close:G.AlertDialog.Close},ut=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),gt=[Je,Qe.medium,"border-gryt-border",P].join(" "),Go=i.forwardRef(function({className:e,...t},r){return o.jsx(w.Combobox.Input,{ref:r,className:s("gryt-combobox-input",gt,e),...t})}),Oo=i.forwardRef(function({className:e,sideOffset:t=6,...r},a){return o.jsx(w.Combobox.Positioner,{ref:a,sideOffset:t,className:s("gryt-combobox-positioner outline-none",e),...r})}),Eo=i.forwardRef(function({className:e,...t},r){return o.jsx(w.Combobox.Popup,{ref:r,className:s("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",q,O,e),...t})}),Fo=i.forwardRef(function({className:e,...t},r){return o.jsx(w.Combobox.Item,{ref:r,className:s("gryt-combobox-item",ut,e),...t})}),zo=i.forwardRef(function({className:e,...t},r){return o.jsx(w.Combobox.Empty,{ref:r,className:s("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",e),...t})}),Bo={Root:w.Combobox.Root,Input:Go,InputGroup:w.Combobox.InputGroup,Trigger:w.Combobox.Trigger,Icon:w.Combobox.Icon,Clear:w.Combobox.Clear,Value:w.Combobox.Value,Chips:w.Combobox.Chips,Chip:w.Combobox.Chip,ChipRemove:w.Combobox.ChipRemove,Portal:w.Combobox.Portal,Positioner:Oo,Popup:Eo,List:w.Combobox.List,Item:Fo,ItemIndicator:w.Combobox.ItemIndicator,Group:w.Combobox.Group,GroupLabel:w.Combobox.GroupLabel,Empty:zo,Separator:w.Combobox.Separator},_o=i.forwardRef(function({className:e,...t},r){return o.jsx(j.Autocomplete.Input,{ref:r,className:s("gryt-autocomplete-input",gt,e),...t})}),qo=i.forwardRef(function({className:e,sideOffset:t=6,...r},a){return o.jsx(j.Autocomplete.Positioner,{ref:a,sideOffset:t,className:s("gryt-autocomplete-positioner outline-none",e),...r})}),Yo=i.forwardRef(function({className:e,...t},r){return o.jsx(j.Autocomplete.Popup,{ref:r,className:s("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",q,O,e),...t})}),Vo=i.forwardRef(function({className:e,...t},r){return o.jsx(j.Autocomplete.Item,{ref:r,className:s("gryt-autocomplete-item",ut,e),...t})}),Uo=i.forwardRef(function({className:e,...t},r){return o.jsx(j.Autocomplete.Empty,{ref:r,className:s("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",e),...t})}),Xo={Root:j.Autocomplete.Root,Input:_o,InputGroup:j.Autocomplete.InputGroup,Trigger:j.Autocomplete.Trigger,Icon:j.Autocomplete.Icon,Clear:j.Autocomplete.Clear,Value:j.Autocomplete.Value,Portal:j.Autocomplete.Portal,Positioner:qo,Popup:Yo,List:j.Autocomplete.List,Item:Vo,Group:j.Autocomplete.Group,GroupLabel:j.Autocomplete.GroupLabel,Empty:Uo,Separator:j.Autocomplete.Separator},Ko=i.forwardRef(function({className:e,...t},r){return o.jsx(Rt.CheckboxGroup,{ref:r,className:s("gryt-checkbox-group flex flex-col gap-2",e),...t})}),Wo=i.forwardRef(function({className:e,...t},r){return o.jsx(ke.Collapsible.Trigger,{ref:r,className:s("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",P,e),...t})}),Jo=i.forwardRef(function({className:e,...t},r){return o.jsx(ke.Collapsible.Panel,{ref:r,className:s("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",e),...t})}),Qo={Root:ke.Collapsible.Root,Trigger:Wo,Panel:Jo},Zo=i.forwardRef(function({className:e,...t},r){return o.jsx(Ct.Form,{ref:r,className:s("gryt-form flex flex-col gap-(--gryt-space-lg)",e),...t})}),en=i.forwardRef(function({className:e,...t},r){return o.jsx(Xe.Fieldset.Root,{ref:r,className:s("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",e),...t})}),tn=i.forwardRef(function({className:e,...t},r){return o.jsx(Xe.Fieldset.Legend,{ref:r,className:s("gryt-fieldset-legend text-sm font-semibold text-gryt-text",e),...t})}),rn={Root:en,Legend:tn},on=i.forwardRef(function({className:e,...t},r){return o.jsx(St.Menubar,{ref:r,className:s("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",e),...t})}),nn=i.forwardRef(function({className:e,...t},r){return o.jsx(k.NavigationMenu.Trigger,{ref:r,className:s("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",P,e),...t})}),an=i.forwardRef(function({className:e,...t},r){return o.jsx(k.NavigationMenu.Popup,{ref:r,className:s("gryt-navigation-menu-popup outline-none",q,O,e),...t})}),sn=i.forwardRef(function({className:e,...t},r){return o.jsx(k.NavigationMenu.Positioner,{ref:r,className:s("gryt-navigation-menu-positioner outline-none",e),...t})}),ln=i.forwardRef(function({className:e,...t},r){return o.jsx(k.NavigationMenu.Viewport,{ref:r,className:s("gryt-navigation-menu-viewport relative overflow-hidden",e),...t})}),cn=i.forwardRef(function({className:e,...t},r){return o.jsx(k.NavigationMenu.Link,{ref:r,className:s("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",P,e),...t})}),dn={Root:k.NavigationMenu.Root,List:k.NavigationMenu.List,Item:k.NavigationMenu.Item,Trigger:nn,Content:k.NavigationMenu.Content,Portal:k.NavigationMenu.Portal,Positioner:sn,Viewport:ln,Popup:an,Link:cn,Icon:k.NavigationMenu.Icon,Arrow:k.NavigationMenu.Arrow},Ve="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",un=i.forwardRef(function({className:e,label:t,scrubbable:r=!1,...a},d){return o.jsxs(E.NumberField.Root,{ref:d,className:s("gryt-number-field flex flex-col gap-1.5",e),...a,children:[t&&(r?o.jsxs(E.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[t,o.jsx(E.NumberField.ScrubAreaCursor,{})]}):o.jsx("span",{className:"text-sm text-gryt-muted",children:t})),o.jsxs(E.NumberField.Group,{className:s("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",J),children:[o.jsx(E.NumberField.Decrement,{"aria-label":"Decrease",className:s(Ve,"rounded-l-(--gryt-radius-full)"),children:o.jsx(T.Minus,{size:14,weight:"bold"})}),o.jsx(E.NumberField.Input,{className:s("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",P)}),o.jsx(E.NumberField.Increment,{"aria-label":"Increase",className:s(Ve,"rounded-r-(--gryt-radius-full)"),children:o.jsx(T.Plus,{size:14,weight:"bold"})})]})]})}),gn=i.forwardRef(function({className:e,length:t=6,...r},a){return o.jsx(Oe.OTPField.Root,{ref:a,length:t,className:s("gryt-otp-field flex gap-2",e),...r,children:Array.from({length:t},(d,m)=>o.jsx(Oe.OTPField.Input,{className:s("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",P)},m))})}),mn=i.forwardRef(function({className:e,sideOffset:t=8,...r},a){return o.jsx(X.PreviewCard.Positioner,{ref:a,sideOffset:t,className:s("gryt-preview-card-positioner outline-none",e),...r})}),fn=i.forwardRef(function({className:e,...t},r){return o.jsx(X.PreviewCard.Popup,{ref:r,className:s("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",q,O,e),...t})}),pn={Root:X.PreviewCard.Root,Trigger:X.PreviewCard.Trigger,Portal:X.PreviewCard.Portal,Positioner:mn,Popup:fn,Arrow:X.PreviewCard.Arrow},yn=i.forwardRef(function({className:e,...t},r){return o.jsx(K.Toolbar.Root,{ref:r,className:s("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",e),...t})}),xn=i.forwardRef(function({className:e,...t},r){return o.jsx(K.Toolbar.Separator,{ref:r,className:s("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",e),...t})}),bn={Root:yn,Group:K.Toolbar.Group,Button:K.Toolbar.Button,Link:K.Toolbar.Link,Input:K.Toolbar.Input,Separator:xn};Object.defineProperty(exports,"GRYT_HUE_KEYS",{enumerable:!0,get:()=>c.GRYT_HUE_KEYS});Object.defineProperty(exports,"GRYT_NEUTRAL_KEYS",{enumerable:!0,get:()=>c.GRYT_NEUTRAL_KEYS});Object.defineProperty(exports,"GRYT_RADIUS_KEYS",{enumerable:!0,get:()=>c.GRYT_RADIUS_KEYS});Object.defineProperty(exports,"GRYT_THEME_NAME_MAX",{enumerable:!0,get:()=>c.GRYT_THEME_NAME_MAX});Object.defineProperty(exports,"alphaScale",{enumerable:!0,get:()=>c.alphaScale});Object.defineProperty(exports,"cloneGrytTheme",{enumerable:!0,get:()=>c.cloneGrytTheme});Object.defineProperty(exports,"contrast",{enumerable:!0,get:()=>c.contrast});Object.defineProperty(exports,"createGrytTheme",{enumerable:!0,get:()=>c.createGrytTheme});Object.defineProperty(exports,"decodeGrytTheme",{enumerable:!0,get:()=>c.decodeGrytTheme});Object.defineProperty(exports,"encodeDraft",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"encodeGrytTheme",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"grytAlphaScales",{enumerable:!0,get:()=>c.grytAlphaScales});Object.defineProperty(exports,"grytAlphaScalesLight",{enumerable:!0,get:()=>c.grytAlphaScalesLight});Object.defineProperty(exports,"grytLightTokens",{enumerable:!0,get:()=>c.grytLightTokens});Object.defineProperty(exports,"grytPresets",{enumerable:!0,get:()=>c.grytPresets});Object.defineProperty(exports,"grytPresetsById",{enumerable:!0,get:()=>c.grytPresetsById});Object.defineProperty(exports,"grytScales",{enumerable:!0,get:()=>c.grytScales});Object.defineProperty(exports,"grytScalesLight",{enumerable:!0,get:()=>c.grytScalesLight});Object.defineProperty(exports,"grytTheme",{enumerable:!0,get:()=>c.grytTheme});Object.defineProperty(exports,"grytThemeHues",{enumerable:!0,get:()=>c.grytThemeHues});Object.defineProperty(exports,"grytThemeToOptions",{enumerable:!0,get:()=>c.grytThemeToOptions});Object.defineProperty(exports,"grytTokens",{enumerable:!0,get:()=>c.grytTokens});Object.defineProperty(exports,"hexToOklch",{enumerable:!0,get:()=>c.hexToOklch});Object.defineProperty(exports,"hexToRgb",{enumerable:!0,get:()=>c.hexToRgb});Object.defineProperty(exports,"hueScale",{enumerable:!0,get:()=>c.hueScale});Object.defineProperty(exports,"hueScaleLight",{enumerable:!0,get:()=>c.hueScaleLight});Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:()=>c.isHexColor});Object.defineProperty(exports,"neutralScale",{enumerable:!0,get:()=>c.neutralScale});Object.defineProperty(exports,"neutralScaleLight",{enumerable:!0,get:()=>c.neutralScaleLight});Object.defineProperty(exports,"normalizeHexColor",{enumerable:!0,get:()=>c.normalizeHexColor});Object.defineProperty(exports,"normalizeThemeName",{enumerable:!0,get:()=>c.normalizeThemeName});Object.defineProperty(exports,"oklchToHex",{enumerable:!0,get:()=>c.oklchToHex});Object.defineProperty(exports,"rgbToHex",{enumerable:!0,get:()=>c.rgbToHex});Object.defineProperty(exports,"avatarSeed",{enumerable:!0,get:()=>Pe.avatarSeed});exports.Accordion=zr;exports.Alert=sr;exports.AlertDialog=Ho;exports.Autocomplete=Xo;exports.Avatar=et;exports.Badge=Yt;exports.Button=se;exports.Card=tr;exports.CardActions=nr;exports.CardContent=or;exports.CardHeader=rr;exports.Checkbox=Re;exports.CheckboxGroup=Ko;exports.Chip=Ut;exports.Collapsible=Qo;exports.Combobox=Bo;exports.Composer=Bt;exports.ContextMenu=_r;exports.ConversationItem=qt;exports.Dialog=yr;exports.Divider=er;exports.Drawer=Cr;exports.Fieldset=rn;exports.Form=Zo;exports.GrytProvider=At;exports.IconButton=Et;exports.Menu=ue;exports.Menubar=on;exports.MessageBubble=zt;exports.Meter=Mo;exports.NavigationMenu=dn;exports.NumberField=un;exports.OtpField=gn;exports.Popover=Xr;exports.PreviewCard=pn;exports.Progress=ir;exports.Radio=Xt;exports.RadioGroup=Kt;exports.ScrollArea=io;exports.Select=rt;exports.Skeleton=dr;exports.Slider=tt;exports.Spinner=lr;exports.Surface=Ft;exports.Switch=Wt;exports.Tab=at;exports.Tabs=Hr;exports.TextField=Ae;exports.ThemeEditor=ko;exports.Toast=ro;exports.Toggle=Ce;exports.ToggleGroup=st;exports.Toolbar=bn;exports.Tooltip=Qt;exports.TooltipProvider=Zt;exports.cloneDraft=lt;exports.cn=s;exports.grytDraft=uo;exports.importTheme=dt;exports.themeCode=Po;exports.themeJson=Ro;exports.themeStyle=ct;exports.useMediaQuery=nt;exports.useToastManager=oo;
|
|
2
19
|
//# sourceMappingURL=index.cjs.map
|