@krizaka/ui 2.0.0-beta.4 → 2.0.0-beta.5
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/README.md +3 -1
- package/dist/{button-8La7l0V4.d.ts → button-D5aSsmxX.d.ts} +3 -3
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/button.js.map +1 -1
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/{chunk-ZUD4U22H.js → chunk-6DJ6SQY3.js} +2 -2
- package/dist/chunk-6DJ6SQY3.js.map +1 -0
- package/dist/{chunk-3X5MVH54.js → chunk-IUGBKMJC.js} +2 -2
- package/dist/command.js +2 -2
- package/dist/confirm-button.d.ts +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/dialog.js +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +90 -65
- package/dist/index.js.map +1 -1
- package/dist/motion.css +52 -2
- package/dist/native.d.ts +29 -4
- package/dist/native.js +359 -92
- package/dist/native.js.map +1 -1
- package/dist/section-backdrop.d.ts +75 -0
- package/dist/section-backdrop.js +27 -0
- package/dist/section-backdrop.js.map +1 -0
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js +1 -1
- package/package.json +18 -4
- package/registry/button.json +1 -1
- package/registry/card.json +1 -1
- package/registry/demos/section-backdrop.d.ts +5 -0
- package/registry/demos/section-backdrop.js +14 -0
- package/registry/demos/section-backdrop.tsx +10 -0
- package/registry/dropdown-menu.json +1 -1
- package/registry/index.json +10 -1
- package/registry/section-backdrop.json +73 -0
- package/dist/chunk-ZUD4U22H.js.map +0 -1
- /package/dist/{chunk-3X5MVH54.js.map → chunk-IUGBKMJC.js.map} +0 -0
package/README.md
CHANGED
|
@@ -149,6 +149,7 @@ Colours are roles of the preset (`bg-surface-2`, `text-fg-secondary`, `border-bo
|
|
|
149
149
|
| `@krizaka/ui/command` | `Command.Root` (`label`, `shouldFilter`…) `/Input` (`placeholder`, `trailing`) `/List` (`label`) `/Empty` (`emptyLabel`) `/Loading/Group/Item/Separator/Shortcut` on cmdk; `CommandDialog` (`label`, `open`/`onOpenChange`, `footer`, `contentProps`) | client |
|
|
150
150
|
| `@krizaka/ui/confirm-button` | `ConfirmButton` (two presses: `confirmLabel`, `onConfirm`, `timeoutMs` 4000, `label` for an icon, `armedContent`; the `Button` variants), `confirmArmed` | client |
|
|
151
151
|
| `@krizaka/ui/progress` | `Progress` (`variant` bar·ring, `size` sm·md·lg, `value`/`max`, indeterminate without a value, `label`, `valueText`, a ring's centre as children) | server |
|
|
152
|
+
| `@krizaka/ui/section-backdrop` | `SectionBackdrop` (`as`, `direction` down·up, `dome`, `grid`, `media` blurred for depth of field, `animated`): a page section on the brand's section gradient — see `@krizaka/tokens` BRAND.md, "Visual language" | server |
|
|
152
153
|
| `@krizaka/ui` | the marks, `MotionObserver`, `RotatingWord`, `cx` (unchanged) | client |
|
|
153
154
|
| `@krizaka/ui/native` | React Native: `ThemeProvider`/`useTheme`, `Txt`, `Button`, `IconButton`, `Card.*`, `Badge`, `Chip` (+ `Group`), `Avatar` (+ `Group`), `Skeleton`, `EmptyState`, `Spinner`, `Countdown`, `Segmented`, `Progress`, `Toaster`/`toast`, the marks — see [React Native](#react-native) | native |
|
|
154
155
|
| `@krizaka/ui/motion.css`, `@krizaka/ui/tailwind.css` | the motion signature; the `@source` of the primitives' classes | CSS |
|
|
@@ -245,7 +246,7 @@ const { theme, scheme, mode, setMode, radius } = useTheme(); // theme.surface1,
|
|
|
245
246
|
| `Segmented` | `options` (`value`, `label`, `disabled`), `value`, `onValueChange`, `size` | The web `Tabs variant="segmented"` (a tab list). To filter, `Chip.Group`. |
|
|
246
247
|
| `Progress` | `variant` bar·ring, `size`, `value`/`max`, `label`, `valueText`, a ring's centre as children | The fill is the `accent` → `accent2` gradient (react-native-svg); it animates to each new value. |
|
|
247
248
|
| `Toaster`, `toast` | `toast(title, { description, tone, icon, action, onPress, id, duration, onDismiss })`, `toast.success/warning/error/info`, `toast.dismiss(id?)`; `Toaster closeLabel position offset duration max` | No sonner: a light queue of its own. `offset` takes the safe-area inset (no safe-area dependency). |
|
|
248
|
-
| `OrochiaMark` | `size`, `animated`, `title`, `neutral` | The
|
|
249
|
+
| `KrizakaMark`, `OrazakaMark`, `OrochiaMark`, `ProductMark` (`id`) | `size`, `animated`, `title`, `neutral` (default `theme.textMuted`) | The brand marks, drawn with react-native-svg from the web marks' geometry. |
|
|
249
250
|
|
|
250
251
|
Every animation (skeleton, badge dot, urgent countdown, progress, toast entrance, the marks) stops when the system
|
|
251
252
|
asks to reduce motion (`useReducedMotion()`). Accessibility goes through `role` and `aria-*` (RN ≥ 0.71): headings,
|
|
@@ -311,6 +312,7 @@ import { MotionObserver, RotatingWord } from "@krizaka/ui";
|
|
|
311
312
|
| `kz-gradient-text`, `kz-marquee` | Drifting gradient text, endless bands |
|
|
312
313
|
| `kz-overlay`, `kz-dialog`, `kz-pop`, `kz-fade` | Backdrops, dialogs (from the bottom on phones), menus, views swapped in place |
|
|
313
314
|
| `kz-progress` | The indeterminate progress bar's travelling segment |
|
|
315
|
+
| `kz-backdrop`, `kz-backdrop-drift`, `-dome`, `-grid`, `-media` | The layers of `SectionBackdrop`: the brand's section gradient, the slow light drift (40 s), the dome, the perspective grid, the blurred foreground |
|
|
314
316
|
|
|
315
317
|
With Tailwind CSS v4, give every transition the same easing:
|
|
316
318
|
|
|
@@ -6,7 +6,7 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
6
6
|
variant: {
|
|
7
7
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover";
|
|
8
8
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3";
|
|
9
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent";
|
|
9
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent";
|
|
10
10
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg";
|
|
11
11
|
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20";
|
|
12
12
|
};
|
|
@@ -24,7 +24,7 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
24
24
|
variant: {
|
|
25
25
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover";
|
|
26
26
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3";
|
|
27
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent";
|
|
27
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent";
|
|
28
28
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg";
|
|
29
29
|
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20";
|
|
30
30
|
};
|
|
@@ -42,7 +42,7 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
42
42
|
variant: {
|
|
43
43
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover";
|
|
44
44
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3";
|
|
45
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent";
|
|
45
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent";
|
|
46
46
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg";
|
|
47
47
|
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20";
|
|
48
48
|
};
|
package/dist/button.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
6
6
|
variant: {
|
|
7
7
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover";
|
|
8
8
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3";
|
|
9
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent";
|
|
9
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent";
|
|
10
10
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg";
|
|
11
11
|
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20";
|
|
12
12
|
};
|
|
@@ -24,7 +24,7 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
24
24
|
variant: {
|
|
25
25
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover";
|
|
26
26
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3";
|
|
27
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent";
|
|
27
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent";
|
|
28
28
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg";
|
|
29
29
|
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20";
|
|
30
30
|
};
|
|
@@ -42,7 +42,7 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
42
42
|
variant: {
|
|
43
43
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover";
|
|
44
44
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3";
|
|
45
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent";
|
|
45
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent";
|
|
46
46
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg";
|
|
47
47
|
danger: "border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20";
|
|
48
48
|
};
|
package/dist/button.js
CHANGED
|
@@ -8,7 +8,7 @@ var buttonVariants = tv({
|
|
|
8
8
|
variant: {
|
|
9
9
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover",
|
|
10
10
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3",
|
|
11
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent",
|
|
11
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent",
|
|
12
12
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg",
|
|
13
13
|
// The danger token is invariant and too light for small text on a light surface (3.6:1): the label stays a
|
|
14
14
|
// text role, the border and the tint carry the danger.
|
package/dist/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const buttonVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98]\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The danger token is invariant and too light for small text on a light surface (3.6:1): the label stays a\n // text role, the border and the tint carry the danger.\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n shape: { rounded: \"rounded-lg\", pill: \"rounded-full\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `secondary` (a raised surface), `outline`, `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Disables and signals the wait (aria-busy, data-loading) — the product adds a spinner if it wants one. */\n loading?: boolean;\n };\n\nexport function Button({ asChild, loading, variant, size, shape, className, disabled, ...props }: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({ variant, size, shape, className })}\n {...props}\n />\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. */\nexport function IconButton({ label, size = \"icon\", ...props }: IconButtonProps) {\n return <Button aria-label={label} title={label} size={size} {...props} />;\n}\n"],"mappings":";AACA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAmDlC;AAjDG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MACE;AAAA,EAGF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,IACV;AAAA,IACA,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB,IAAI,qBAAqB,MAAM,YAAY;AAAA,IACpG,OAAO,EAAE,SAAS,cAAc,MAAM,eAAe;AAAA,EACvD;AAAA,EACA,iBAAiB,EAAE,SAAS,aAAa,MAAM,MAAM,OAAO,UAAU;AACxE,CAAC;AA2BM,SAAS,OAAO,EAAE,SAAS,SAAS,SAAS,MAAM,OAAO,WAAW,UAAU,GAAG,MAAM,GAAgB;AAC7G,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,UAAU,SAAY;AAAA,MAC5B,aAAW,WAAW;AAAA,MACtB,gBAAc,UAAU,KAAK;AAAA,MAC7B,gBAAc,WAAW;AAAA,MACzB,UAAU,UAAU,SAAY,YAAY;AAAA,MAC5C,iBAAe,YAAY,YAAY,WAAW,OAAO;AAAA,MACzD,WAAW,eAAe,EAAE,SAAS,MAAM,OAAO,UAAU,CAAC;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,WAAW,EAAE,OAAO,OAAO,QAAQ,GAAG,MAAM,GAAoB;AAC9E,SAAO,oBAAC,UAAO,cAAY,OAAO,OAAO,OAAO,MAAa,GAAG,OAAO;AACzE;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const buttonVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98]\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The danger token is invariant and too light for small text on a light surface (3.6:1): the label stays a\n // text role, the border and the tint carry the danger.\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n shape: { rounded: \"rounded-lg\", pill: \"rounded-full\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `secondary` (a raised surface), `outline`, `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Disables and signals the wait (aria-busy, data-loading) — the product adds a spinner if it wants one. */\n loading?: boolean;\n };\n\nexport function Button({ asChild, loading, variant, size, shape, className, disabled, ...props }: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({ variant, size, shape, className })}\n {...props}\n />\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. */\nexport function IconButton({ label, size = \"icon\", ...props }: IconButtonProps) {\n return <Button aria-label={label} title={label} size={size} {...props} />;\n}\n"],"mappings":";AACA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAmDlC;AAjDG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MACE;AAAA,EAGF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,IACV;AAAA,IACA,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB,IAAI,qBAAqB,MAAM,YAAY;AAAA,IACpG,OAAO,EAAE,SAAS,cAAc,MAAM,eAAe;AAAA,EACvD;AAAA,EACA,iBAAiB,EAAE,SAAS,aAAa,MAAM,MAAM,OAAO,UAAU;AACxE,CAAC;AA2BM,SAAS,OAAO,EAAE,SAAS,SAAS,SAAS,MAAM,OAAO,WAAW,UAAU,GAAG,MAAM,GAAgB;AAC7G,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,UAAU,SAAY;AAAA,MAC5B,aAAW,WAAW;AAAA,MACtB,gBAAc,UAAU,KAAK;AAAA,MAC7B,gBAAc,WAAW;AAAA,MACzB,UAAU,UAAU,SAAY,YAAY;AAAA,MAC5C,iBAAe,YAAY,YAAY,WAAW,OAAO;AAAA,MACzD,WAAW,eAAe,EAAE,SAAS,MAAM,OAAO,UAAU,CAAC;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,WAAW,EAAE,OAAO,OAAO,QAAQ,GAAG,MAAM,GAAoB;AAC9E,SAAO,oBAAC,UAAO,cAAY,OAAO,OAAO,OAAO,MAAa,GAAG,OAAO;AACzE;","names":[]}
|
package/dist/card.js
CHANGED
|
@@ -14,7 +14,7 @@ var card = tv({
|
|
|
14
14
|
fallback: "flex h-full w-full items-center justify-center bg-linear-to-br from-accent/15 via-media to-accent-2/15 text-accent/60",
|
|
15
15
|
overlay: "absolute z-10 flex items-center gap-1.5",
|
|
16
16
|
body: "relative flex flex-1 flex-col gap-3",
|
|
17
|
-
title: "line-clamp-1 text-sm font-semibold text-fg transition-colors group-hover:text-accent",
|
|
17
|
+
title: "line-clamp-1 text-sm font-semibold text-fg transition-colors group-hover:text-fg-accent",
|
|
18
18
|
description: "line-clamp-2 text-xs text-fg-secondary",
|
|
19
19
|
stat: "min-w-0",
|
|
20
20
|
statLabel: "text-[10px] font-semibold uppercase tracking-wider text-fg-secondary",
|
package/dist/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/card/card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. One `tv` definition with slots: each part takes its slot, and a product overrides\n// any part through `className` (merged last by tailwind-merge).\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\n\nexport const card = tv({\n slots: {\n root:\n \"group relative flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n media: \"relative overflow-hidden bg-media\",\n image: \"h-full w-full object-cover transition-transform duration-500 motion-safe:group-hover:scale-105\",\n fallback: \"flex h-full w-full items-center justify-center bg-linear-to-br from-accent/15 via-media to-accent-2/15 text-accent/60\",\n overlay: \"absolute z-10 flex items-center gap-1.5\",\n body: \"relative flex flex-1 flex-col gap-3\",\n title: \"line-clamp-1 text-sm font-semibold text-fg transition-colors group-hover:text-accent\",\n description: \"line-clamp-2 text-xs text-fg-secondary\",\n stat: \"min-w-0\",\n statLabel: \"text-[10px] font-semibold uppercase tracking-wider text-fg-secondary\",\n statValue: \"font-display text-xl font-black tabular-nums text-fg\",\n footer: \"relative mt-auto flex items-center gap-2 border-t border-border-subtle pt-3 text-xs text-fg-secondary\",\n },\n variants: {\n radius: { md: { root: \"rounded-md\" }, lg: { root: \"rounded-lg\" }, xl: { root: \"rounded-xl\" } },\n tone: { default: {}, elevated: { root: \"bg-surface-2 shadow-md\" }, glass: { root: \"bg-surface-1/70 backdrop-blur-md\" } },\n interactive: { true: { root: \"kz-spotlight kz-lift hover:border-accent/50\" } },\n padding: { none: { body: \"p-0\" }, sm: { body: \"p-3\" }, md: { body: \"p-4\" }, lg: { body: \"p-6\" } },\n },\n defaultVariants: { radius: \"xl\", tone: \"default\", padding: \"md\" },\n});\n\ntype CardVariants = VariantProps<typeof card>;\n/** The parts without a variant read the default slots: no context, so server-safe. */\nconst slots = card();\n\nexport type CardRootProps = React.ComponentProps<\"div\"> &\n Pick<CardVariants, \"radius\" | \"tone\" | \"interactive\"> & {\n /**\n * md · lg · xl.\n * @default \"xl\"\n */\n radius?: CardVariants[\"radius\"];\n /**\n * default (the base surface) · elevated (raised, a shadow) · glass (translucent, blurred).\n * @default \"default\"\n */\n tone?: CardVariants[\"tone\"];\n /** The spotlight that follows the pointer and the lift on hover: for a card that is a link. */\n interactive?: CardVariants[\"interactive\"];\n /** Renders the child (a link, an article) instead of the <div>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay (50 ms a step, 8 steps at most). */\n reveal?: number;\n };\n\nexport function CardRoot({ asChild, reveal, radius, tone, interactive, className, style, ...props }: CardRootProps) {\n const Comp = asChild ? Slot.Root : \"div\";\n const revealStyle =\n reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <Comp\n data-reveal={reveal === undefined ? undefined : \"\"}\n data-interactive={interactive ? \"\" : undefined}\n style={revealStyle}\n className={card({ radius, tone, interactive }).root({ className })}\n {...props}\n />\n );\n}\n\nconst ASPECT = { video: \"aspect-video\", square: \"aspect-square\", portrait: \"aspect-[3/4]\", auto: \"\" } as const;\nexport type CardMediaProps = React.ComponentProps<\"div\"> & {\n /** The ratio of the media: video (16:9) · square · portrait (3:4) · auto (the content's). */\n aspect?: keyof typeof ASPECT;\n};\n\nexport function CardMedia({ aspect = \"video\", className, ...props }: CardMediaProps) {\n return <div data-aspect={aspect} className={slots.media({ className: cn(ASPECT[aspect], className) })} {...props} />;\n}\n\nexport type CardImageProps = Omit<React.ComponentProps<\"img\">, \"src\"> & {\n /** The image's URL; `null` or nothing shows the `fallback`. */\n src?: string | null;\n /** Shown when there is no image: an icon, an illustration (decorative). */\n fallback?: React.ReactNode;\n};\n\n/** The image of a media, or its `fallback` when there is none. `alt` is empty by default: the title names the card. */\nexport function CardImage({ src, alt = \"\", fallback, className, ...props }: CardImageProps) {\n if (!src) {\n return (\n <div data-fallback=\"\" aria-hidden className={slots.fallback({ className })}>\n {fallback}\n </div>\n );\n }\n return <img src={src} alt={alt} loading=\"lazy\" decoding=\"async\" className={slots.image({ className })} {...props} />;\n}\n\nconst CORNER = {\n \"top-left\": \"left-2.5 top-2.5\",\n \"top-right\": \"right-2.5 top-2.5\",\n \"bottom-left\": \"bottom-2.5 left-2.5\",\n \"bottom-right\": \"bottom-2.5 right-2.5\",\n} as const;\nexport type CardOverlayProps = React.ComponentProps<\"div\"> & {\n /** The corner of the media it sits in. */\n corner?: keyof typeof CORNER;\n};\n\n/** What sits on the media (badges, a caption). `scrim` and `fg-on-media` are invariant: nothing to do for light. */\nexport function CardOverlay({ corner = \"top-left\", className, ...props }: CardOverlayProps) {\n return <div data-corner={corner} className={slots.overlay({ className: cn(CORNER[corner], className) })} {...props} />;\n}\n\nexport type CardBodyProps = React.ComponentProps<\"div\"> & {\n /**\n * none · sm · md · lg.\n * @default \"md\"\n */\n padding?: CardVariants[\"padding\"];\n};\n\nexport function CardBody({ padding, className, ...props }: CardBodyProps) {\n return <div className={card({ padding }).body({ className })} {...props} />;\n}\n\nexport type CardTitleProps = React.ComponentProps<\"h3\"> & {\n /** The heading level, to fit the page's outline. */\n as?: \"h2\" | \"h3\" | \"h4\";\n};\n\nexport function CardTitle({ as: Tag = \"h3\", className, ...props }: CardTitleProps) {\n return <Tag className={slots.title({ className })} {...props} />;\n}\n\nexport function CardDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return <p className={slots.description({ className })} {...props} />;\n}\n\nexport type CardStatProps = React.ComponentProps<\"div\"> & {\n /** What the figure is, in small capitals above it (the figure is the children). */\n label: React.ReactNode;\n};\n\n/** A figure put forward: the label in capitals, the value in tabular digits. */\nexport function CardStat({ label, className, children, ...props }: CardStatProps) {\n return (\n <div className={slots.stat({ className })} {...props}>\n <p className={slots.statLabel()}>{label}</p>\n <p className={slots.statValue()}>{children}</p>\n </div>\n );\n}\n\nexport function CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={slots.footer({ className })} {...props} />;\n}\n\n/** `Card.Root/Media/Image/Overlay/Body/Title/Description/Stat/Footer`. */\nexport const Card = {\n Root: CardRoot,\n Media: CardMedia,\n Image: CardImage,\n Overlay: CardOverlay,\n Body: CardBody,\n Title: CardTitle,\n Description: CardDescription,\n Stat: CardStat,\n Footer: CardFooter,\n};\n"],"mappings":";;;;;AAEA,SAAS,YAAY;AAErB,SAAS,UAA6B;AA2DlC,cAwFA,YAxFA;AAvDG,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,WAAW;AAAA,IACX,WAAW;AAAA,IACX,QAAQ;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,GAAG,MAAM,GAAkB;AAChF,SACE,qBAAC,SAAI,WAAW,MAAM,KAAK,EAAE,UAAU,CAAC,GAAI,GAAG,OAC7C;AAAA,wBAAC,OAAE,WAAW,MAAM,UAAU,GAAI,iBAAM;AAAA,IACxC,oBAAC,OAAE,WAAW,MAAM,UAAU,GAAI,UAAS;AAAA,KAC7C;AAEJ;AAEO,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC/E,SAAO,oBAAC,SAAI,WAAW,MAAM,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACjE;AAGO,IAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AACV;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/card/card.tsx"],"sourcesContent":["// Server-safe: no hook, no context. One `tv` definition with slots: each part takes its slot, and a product overrides\n// any part through `className` (merged last by tailwind-merge).\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\n\nexport const card = tv({\n slots: {\n root:\n \"group relative flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n media: \"relative overflow-hidden bg-media\",\n image: \"h-full w-full object-cover transition-transform duration-500 motion-safe:group-hover:scale-105\",\n fallback: \"flex h-full w-full items-center justify-center bg-linear-to-br from-accent/15 via-media to-accent-2/15 text-accent/60\",\n overlay: \"absolute z-10 flex items-center gap-1.5\",\n body: \"relative flex flex-1 flex-col gap-3\",\n title: \"line-clamp-1 text-sm font-semibold text-fg transition-colors group-hover:text-fg-accent\",\n description: \"line-clamp-2 text-xs text-fg-secondary\",\n stat: \"min-w-0\",\n statLabel: \"text-[10px] font-semibold uppercase tracking-wider text-fg-secondary\",\n statValue: \"font-display text-xl font-black tabular-nums text-fg\",\n footer: \"relative mt-auto flex items-center gap-2 border-t border-border-subtle pt-3 text-xs text-fg-secondary\",\n },\n variants: {\n radius: { md: { root: \"rounded-md\" }, lg: { root: \"rounded-lg\" }, xl: { root: \"rounded-xl\" } },\n tone: { default: {}, elevated: { root: \"bg-surface-2 shadow-md\" }, glass: { root: \"bg-surface-1/70 backdrop-blur-md\" } },\n interactive: { true: { root: \"kz-spotlight kz-lift hover:border-accent/50\" } },\n padding: { none: { body: \"p-0\" }, sm: { body: \"p-3\" }, md: { body: \"p-4\" }, lg: { body: \"p-6\" } },\n },\n defaultVariants: { radius: \"xl\", tone: \"default\", padding: \"md\" },\n});\n\ntype CardVariants = VariantProps<typeof card>;\n/** The parts without a variant read the default slots: no context, so server-safe. */\nconst slots = card();\n\nexport type CardRootProps = React.ComponentProps<\"div\"> &\n Pick<CardVariants, \"radius\" | \"tone\" | \"interactive\"> & {\n /**\n * md · lg · xl.\n * @default \"xl\"\n */\n radius?: CardVariants[\"radius\"];\n /**\n * default (the base surface) · elevated (raised, a shadow) · glass (translucent, blurred).\n * @default \"default\"\n */\n tone?: CardVariants[\"tone\"];\n /** The spotlight that follows the pointer and the lift on hover: for a card that is a link. */\n interactive?: CardVariants[\"interactive\"];\n /** Renders the child (a link, an article) instead of the <div>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay (50 ms a step, 8 steps at most). */\n reveal?: number;\n };\n\nexport function CardRoot({ asChild, reveal, radius, tone, interactive, className, style, ...props }: CardRootProps) {\n const Comp = asChild ? Slot.Root : \"div\";\n const revealStyle =\n reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <Comp\n data-reveal={reveal === undefined ? undefined : \"\"}\n data-interactive={interactive ? \"\" : undefined}\n style={revealStyle}\n className={card({ radius, tone, interactive }).root({ className })}\n {...props}\n />\n );\n}\n\nconst ASPECT = { video: \"aspect-video\", square: \"aspect-square\", portrait: \"aspect-[3/4]\", auto: \"\" } as const;\nexport type CardMediaProps = React.ComponentProps<\"div\"> & {\n /** The ratio of the media: video (16:9) · square · portrait (3:4) · auto (the content's). */\n aspect?: keyof typeof ASPECT;\n};\n\nexport function CardMedia({ aspect = \"video\", className, ...props }: CardMediaProps) {\n return <div data-aspect={aspect} className={slots.media({ className: cn(ASPECT[aspect], className) })} {...props} />;\n}\n\nexport type CardImageProps = Omit<React.ComponentProps<\"img\">, \"src\"> & {\n /** The image's URL; `null` or nothing shows the `fallback`. */\n src?: string | null;\n /** Shown when there is no image: an icon, an illustration (decorative). */\n fallback?: React.ReactNode;\n};\n\n/** The image of a media, or its `fallback` when there is none. `alt` is empty by default: the title names the card. */\nexport function CardImage({ src, alt = \"\", fallback, className, ...props }: CardImageProps) {\n if (!src) {\n return (\n <div data-fallback=\"\" aria-hidden className={slots.fallback({ className })}>\n {fallback}\n </div>\n );\n }\n return <img src={src} alt={alt} loading=\"lazy\" decoding=\"async\" className={slots.image({ className })} {...props} />;\n}\n\nconst CORNER = {\n \"top-left\": \"left-2.5 top-2.5\",\n \"top-right\": \"right-2.5 top-2.5\",\n \"bottom-left\": \"bottom-2.5 left-2.5\",\n \"bottom-right\": \"bottom-2.5 right-2.5\",\n} as const;\nexport type CardOverlayProps = React.ComponentProps<\"div\"> & {\n /** The corner of the media it sits in. */\n corner?: keyof typeof CORNER;\n};\n\n/** What sits on the media (badges, a caption). `scrim` and `fg-on-media` are invariant: nothing to do for light. */\nexport function CardOverlay({ corner = \"top-left\", className, ...props }: CardOverlayProps) {\n return <div data-corner={corner} className={slots.overlay({ className: cn(CORNER[corner], className) })} {...props} />;\n}\n\nexport type CardBodyProps = React.ComponentProps<\"div\"> & {\n /**\n * none · sm · md · lg.\n * @default \"md\"\n */\n padding?: CardVariants[\"padding\"];\n};\n\nexport function CardBody({ padding, className, ...props }: CardBodyProps) {\n return <div className={card({ padding }).body({ className })} {...props} />;\n}\n\nexport type CardTitleProps = React.ComponentProps<\"h3\"> & {\n /** The heading level, to fit the page's outline. */\n as?: \"h2\" | \"h3\" | \"h4\";\n};\n\nexport function CardTitle({ as: Tag = \"h3\", className, ...props }: CardTitleProps) {\n return <Tag className={slots.title({ className })} {...props} />;\n}\n\nexport function CardDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return <p className={slots.description({ className })} {...props} />;\n}\n\nexport type CardStatProps = React.ComponentProps<\"div\"> & {\n /** What the figure is, in small capitals above it (the figure is the children). */\n label: React.ReactNode;\n};\n\n/** A figure put forward: the label in capitals, the value in tabular digits. */\nexport function CardStat({ label, className, children, ...props }: CardStatProps) {\n return (\n <div className={slots.stat({ className })} {...props}>\n <p className={slots.statLabel()}>{label}</p>\n <p className={slots.statValue()}>{children}</p>\n </div>\n );\n}\n\nexport function CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={slots.footer({ className })} {...props} />;\n}\n\n/** `Card.Root/Media/Image/Overlay/Body/Title/Description/Stat/Footer`. */\nexport const Card = {\n Root: CardRoot,\n Media: CardMedia,\n Image: CardImage,\n Overlay: CardOverlay,\n Body: CardBody,\n Title: CardTitle,\n Description: CardDescription,\n Stat: CardStat,\n Footer: CardFooter,\n};\n"],"mappings":";;;;;AAEA,SAAS,YAAY;AAErB,SAAS,UAA6B;AA2DlC,cAwFA,YAxFA;AAvDG,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,WAAW;AAAA,IACX,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,GAAG,IAAI,EAA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,OAC7C;AAAA,wBAAC,OAAE,WAAW,MAAM,UAAU,GAAI,iBAAM;AAAA,IACxC,oBAAC,OAAE,WAAW,MAAM,UAAU,GAAI,UAAS;AAAA,KAC7C;AAEJ;AAEO,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC/E,SAAO,oBAAC,SAAI,WAAW,MAAM,OAAO,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACjE;AAGO,IAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AAAA,EACP,aAAa;AAAA,EACb,MAAM;AAAA,EACN,QAAQ;AACV;","names":[]}
|
|
@@ -10,7 +10,7 @@ var buttonVariants = tv({
|
|
|
10
10
|
variant: {
|
|
11
11
|
primary: "bg-accent text-on-accent shadow-sm hover:bg-accent-hover",
|
|
12
12
|
secondary: "border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3",
|
|
13
|
-
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-accent",
|
|
13
|
+
outline: "border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent",
|
|
14
14
|
ghost: "text-fg-secondary hover:bg-surface-2 hover:text-fg",
|
|
15
15
|
// The danger token is invariant and too light for small text on a light surface (3.6:1): the label stays a
|
|
16
16
|
// text role, the border and the tint carry the danger.
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
Button,
|
|
47
47
|
IconButton
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-6DJ6SQY3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["// Server-safe: no hook, no context. `buttonVariants` styles a <Link> or a Server Component without the component.\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const buttonVariants = tv({\n base:\n \"inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap font-semibold transition-all \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-0 \" +\n \"disabled:pointer-events-none disabled:opacity-40 data-loading:cursor-progress active:scale-[0.98]\",\n variants: {\n variant: {\n primary: \"bg-accent text-on-accent shadow-sm hover:bg-accent-hover\",\n secondary: \"border border-border-default bg-surface-2 text-fg hover:border-border-strong hover:bg-surface-3\",\n outline: \"border border-border-default bg-transparent text-fg hover:border-accent hover:text-fg-accent\",\n ghost: \"text-fg-secondary hover:bg-surface-2 hover:text-fg\",\n // The danger token is invariant and too light for small text on a light surface (3.6:1): the label stays a\n // text role, the border and the tint carry the danger.\n danger: \"border border-danger/50 bg-danger/10 text-fg hover:border-danger hover:bg-danger/20\",\n },\n size: { sm: \"h-8 px-3 text-xs\", md: \"h-10 px-4 text-sm\", lg: \"h-12 px-6 text-sm\", icon: \"h-10 w-10\" },\n shape: { rounded: \"rounded-lg\", pill: \"rounded-full\" },\n },\n defaultVariants: { variant: \"secondary\", size: \"md\", shape: \"rounded\" },\n});\n\nexport type ButtonVariants = VariantProps<typeof buttonVariants>;\n\nexport type ButtonProps = React.ComponentProps<\"button\"> &\n ButtonVariants & {\n /**\n * The look: `primary` (the accent), `secondary` (a raised surface), `outline`, `ghost`, `danger`.\n * @default \"secondary\"\n */\n variant?: ButtonVariants[\"variant\"];\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"md\"\n */\n size?: ButtonVariants[\"size\"];\n /**\n * rounded · pill.\n * @default \"rounded\"\n */\n shape?: ButtonVariants[\"shape\"];\n /** Renders the child (e.g. a <Link>) instead of the <button>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Disables and signals the wait (aria-busy, data-loading) — the product adds a spinner if it wants one. */\n loading?: boolean;\n };\n\nexport function Button({ asChild, loading, variant, size, shape, className, disabled, ...props }: ButtonProps) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (\n <Comp\n type={asChild ? undefined : \"button\"}\n aria-busy={loading || undefined}\n data-loading={loading ? \"\" : undefined}\n data-variant={variant ?? \"secondary\"}\n disabled={asChild ? undefined : disabled || loading}\n aria-disabled={asChild && (disabled || loading) ? true : undefined}\n className={buttonVariants({ variant, size, shape, className })}\n {...props}\n />\n );\n}\n\nexport type IconButtonProps = Omit<ButtonProps, \"size\"> & {\n /** The accessible name (and tooltip) of the button — required, passed translated. */\n label: string;\n /**\n * sm · md · lg, or `icon` (a square).\n * @default \"icon\"\n */\n size?: ButtonProps[\"size\"];\n};\n\n/** An icon-only button: `label` is required, it is its accessible name. */\nexport function IconButton({ label, size = \"icon\", ...props }: IconButtonProps) {\n return <Button aria-label={label} title={label} size={size} {...props} />;\n}\n"],"mappings":";;;AACA,SAAS,YAAY;AAErB,SAAS,UAA6B;AAmDlC;AAjDG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,MACE;AAAA,EAGF,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,MACT,OAAO;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,IACV;AAAA,IACA,MAAM,EAAE,IAAI,oBAAoB,IAAI,qBAAqB,IAAI,qBAAqB,MAAM,YAAY;AAAA,IACpG,OAAO,EAAE,SAAS,cAAc,MAAM,eAAe;AAAA,EACvD;AAAA,EACA,iBAAiB,EAAE,SAAS,aAAa,MAAM,MAAM,OAAO,UAAU;AACxE,CAAC;AA2BM,SAAS,OAAO,EAAE,SAAS,SAAS,SAAS,MAAM,OAAO,WAAW,UAAU,GAAG,MAAM,GAAgB;AAC7G,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,UAAU,SAAY;AAAA,MAC5B,aAAW,WAAW;AAAA,MACtB,gBAAc,UAAU,KAAK;AAAA,MAC7B,gBAAc,WAAW;AAAA,MACzB,UAAU,UAAU,SAAY,YAAY;AAAA,MAC5C,iBAAe,YAAY,YAAY,WAAW,OAAO;AAAA,MACzD,WAAW,eAAe,EAAE,SAAS,MAAM,OAAO,UAAU,CAAC;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAaO,SAAS,WAAW,EAAE,OAAO,OAAO,QAAQ,GAAG,MAAM,GAAoB;AAC9E,SAAO,oBAAC,UAAO,cAAY,OAAO,OAAO,OAAO,MAAa,GAAG,OAAO;AACzE;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
IconButton
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6DJ6SQY3.js";
|
|
5
5
|
|
|
6
6
|
// src/dialog/dialog.tsx
|
|
7
7
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
@@ -118,4 +118,4 @@ export {
|
|
|
118
118
|
Dialog,
|
|
119
119
|
Sheet
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
//# sourceMappingURL=chunk-IUGBKMJC.js.map
|
package/dist/command.js
CHANGED
package/dist/confirm-button.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { B as ButtonProps } from './button-
|
|
2
|
+
import { B as ButtonProps } from './button-D5aSsmxX.js';
|
|
3
3
|
import 'tailwind-variants';
|
|
4
4
|
|
|
5
5
|
declare const confirmArmed = "border border-danger bg-danger/20 text-fg hover:border-danger hover:bg-danger/30";
|
package/dist/confirm-button.js
CHANGED
package/dist/dialog.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
DialogTitle,
|
|
10
10
|
Sheet,
|
|
11
11
|
dialog
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IUGBKMJC.js";
|
|
13
13
|
import {
|
|
14
14
|
Button
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6DJ6SQY3.js";
|
|
16
16
|
|
|
17
17
|
// src/dialog/alert-dialog.tsx
|
|
18
18
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -14,7 +14,7 @@ var menu = tv({
|
|
|
14
14
|
slots: {
|
|
15
15
|
content: cn(floating, "min-w-48 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto p-1 origin-(--radix-dropdown-menu-content-transform-origin)"),
|
|
16
16
|
item: "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm text-fg outline-hidden transition-colors data-highlighted:bg-surface-3 data-disabled:pointer-events-none data-disabled:opacity-40 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 [&>svg]:text-fg-secondary",
|
|
17
|
-
indicator: "ml-auto flex h-4 w-4 items-center justify-center text-accent",
|
|
17
|
+
indicator: "ml-auto flex h-4 w-4 items-center justify-center text-fg-accent",
|
|
18
18
|
label: "px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wider text-fg-secondary",
|
|
19
19
|
separator: "-mx-1 my-1 h-px bg-border-subtle"
|
|
20
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["// Client (a portal). Radix does the roving focus, the arrows, Home/End, typeahead, Escape and the focus return.\nimport { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport const menu = tv({\n slots: {\n content: cn(floating, \"min-w-48 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto p-1 origin-(--radix-dropdown-menu-content-transform-origin)\"),\n item:\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm text-fg outline-hidden transition-colors \" +\n \"data-highlighted:bg-surface-3 data-disabled:pointer-events-none data-disabled:opacity-40 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 \" +\n \"[&>svg]:text-fg-secondary\",\n indicator: \"ml-auto flex h-4 w-4 items-center justify-center text-accent\",\n label: \"px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\",\n separator: \"-mx-1 my-1 h-px bg-border-subtle\",\n },\n variants: {\n // The danger token is too light for small text on a light surface: the label stays a text role, the icon and the\n // highlight carry the danger.\n tone: { default: {}, danger: { item: \"data-highlighted:bg-danger/15 [&>svg]:text-danger\" } },\n },\n defaultVariants: { tone: \"default\" },\n});\nconst s = menu();\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof MenuPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function DropdownMenuContent({ sideOffset = 6, align = \"end\", collisionPadding = 8, container, className, ...props }: DropdownMenuContentProps) {\n return (\n <MenuPrimitive.Portal container={container}>\n <MenuPrimitive.Content sideOffset={sideOffset} align={align} collisionPadding={collisionPadding} className={s.content({ className })} {...props} />\n </MenuPrimitive.Portal>\n );\n}\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof MenuPrimitive.Item> & {\n /** `danger` for a destructive action: the icon and the highlight carry the danger, the label stays legible. */\n tone?: \"default\" | \"danger\";\n};\n\n/** An action. `tone=\"danger\"` for a destructive one; `onSelect` runs it (the menu closes). */\nexport function DropdownMenuItem({ tone, className, ...props }: DropdownMenuItemProps) {\n return <MenuPrimitive.Item data-tone={tone ?? \"default\"} className={menu({ tone }).item({ className })} {...props} />;\n}\n\n/** A toggled option: `checked` + `onCheckedChange`. */\nexport function DropdownMenuCheckboxItem({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n return (\n <MenuPrimitive.CheckboxItem className={s.item({ className })} {...props}>\n {children}\n <MenuPrimitive.ItemIndicator className={s.indicator()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenuPrimitive.ItemIndicator>\n </MenuPrimitive.CheckboxItem>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Label>) {\n return <MenuPrimitive.Label className={s.label({ className })} {...props} />;\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Separator>) {\n return <MenuPrimitive.Separator className={s.separator({ className })} {...props} />;\n}\n\n/** `DropdownMenu.Root/Trigger/Content/Item/CheckboxItem/Label/Separator/Group`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const DropdownMenu = {\n Root: MenuPrimitive.Root,\n Trigger: MenuPrimitive.Trigger,\n Content: DropdownMenuContent,\n Item: DropdownMenuItem,\n CheckboxItem: DropdownMenuCheckboxItem,\n Label: DropdownMenuLabel,\n Separator: DropdownMenuSeparator,\n Group: MenuPrimitive.Group,\n};\n"],"mappings":";;;;;;;;;AACA,SAAS,gBAAgB,qBAAqB;AAE9C,SAAS,UAAU;AAiCb,cAkBF,YAlBE;AA5BC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,SAAS,GAAG,UAAU,6IAA6I;AAAA,IACnK,MACE;AAAA,IAGF,WAAW;AAAA,IACX,OAAO;AAAA,IACP,WAAW;AAAA,EACb;AAAA,EACA,UAAU;AAAA;AAAA;AAAA,IAGR,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAAE,MAAM,oDAAoD,EAAE;AAAA,EAC7F;AAAA,EACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;AACD,IAAM,IAAI,KAAK;AAOR,SAAS,oBAAoB,EAAE,aAAa,GAAG,QAAQ,OAAO,mBAAmB,GAAG,WAAW,WAAW,GAAG,MAAM,GAA6B;AACrJ,SACE,oBAAC,cAAc,QAAd,EAAq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-menu/dropdown-menu.tsx"],"sourcesContent":["// Client (a portal). Radix does the roving focus, the arrows, Home/End, typeahead, Escape and the focus return.\nimport { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport const menu = tv({\n slots: {\n content: cn(floating, \"min-w-48 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto p-1 origin-(--radix-dropdown-menu-content-transform-origin)\"),\n item:\n \"relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2.5 py-2 text-sm text-fg outline-hidden transition-colors \" +\n \"data-highlighted:bg-surface-3 data-disabled:pointer-events-none data-disabled:opacity-40 [&>svg]:h-4 [&>svg]:w-4 [&>svg]:shrink-0 \" +\n \"[&>svg]:text-fg-secondary\",\n indicator: \"ml-auto flex h-4 w-4 items-center justify-center text-fg-accent\",\n label: \"px-2.5 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wider text-fg-secondary\",\n separator: \"-mx-1 my-1 h-px bg-border-subtle\",\n },\n variants: {\n // The danger token is too light for small text on a light surface: the label stays a text role, the icon and the\n // highlight carry the danger.\n tone: { default: {}, danger: { item: \"data-highlighted:bg-danger/15 [&>svg]:text-danger\" } },\n },\n defaultVariants: { tone: \"default\" },\n});\nconst s = menu();\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof MenuPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function DropdownMenuContent({ sideOffset = 6, align = \"end\", collisionPadding = 8, container, className, ...props }: DropdownMenuContentProps) {\n return (\n <MenuPrimitive.Portal container={container}>\n <MenuPrimitive.Content sideOffset={sideOffset} align={align} collisionPadding={collisionPadding} className={s.content({ className })} {...props} />\n </MenuPrimitive.Portal>\n );\n}\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof MenuPrimitive.Item> & {\n /** `danger` for a destructive action: the icon and the highlight carry the danger, the label stays legible. */\n tone?: \"default\" | \"danger\";\n};\n\n/** An action. `tone=\"danger\"` for a destructive one; `onSelect` runs it (the menu closes). */\nexport function DropdownMenuItem({ tone, className, ...props }: DropdownMenuItemProps) {\n return <MenuPrimitive.Item data-tone={tone ?? \"default\"} className={menu({ tone }).item({ className })} {...props} />;\n}\n\n/** A toggled option: `checked` + `onCheckedChange`. */\nexport function DropdownMenuCheckboxItem({ className, children, ...props }: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n return (\n <MenuPrimitive.CheckboxItem className={s.item({ className })} {...props}>\n {children}\n <MenuPrimitive.ItemIndicator className={s.indicator()}>\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n </MenuPrimitive.ItemIndicator>\n </MenuPrimitive.CheckboxItem>\n );\n}\n\nexport function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Label>) {\n return <MenuPrimitive.Label className={s.label({ className })} {...props} />;\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof MenuPrimitive.Separator>) {\n return <MenuPrimitive.Separator className={s.separator({ className })} {...props} />;\n}\n\n/** `DropdownMenu.Root/Trigger/Content/Item/CheckboxItem/Label/Separator/Group`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const DropdownMenu = {\n Root: MenuPrimitive.Root,\n Trigger: MenuPrimitive.Trigger,\n Content: DropdownMenuContent,\n Item: DropdownMenuItem,\n CheckboxItem: DropdownMenuCheckboxItem,\n Label: DropdownMenuLabel,\n Separator: DropdownMenuSeparator,\n Group: MenuPrimitive.Group,\n};\n"],"mappings":";;;;;;;;;AACA,SAAS,gBAAgB,qBAAqB;AAE9C,SAAS,UAAU;AAiCb,cAkBF,YAlBE;AA5BC,IAAM,OAAO,GAAG;AAAA,EACrB,OAAO;AAAA,IACL,SAAS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,MAAM,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AAC5E;AAEO,SAAS,sBAAsB,EAAE,WAAW,GAAG,MAAM,GAAyD;AACnH,SAAO,oBAAC,cAAc,WAAd,EAAwB,WAAW,EAAE,UAAU,EAAE,UAAU,CAAC,GAAI,GAAG,OAAO;AACpF;AAGO,IAAM,eAAe;AAAA,EAC1B,MAAM,cAAc;AAAA,EACpB,SAAS,cAAc;AAAA,EACvB,SAAS;AAAA,EACT,MAAM;AAAA,EACN,cAAc;AAAA,EACd,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO,cAAc;AACvB;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,10 +13,17 @@ interface MarkProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The Krizaka mark: an ink hexagonal shield, open at one vertex where a blue node breaks out, around a blue core —
|
|
18
|
+
* the parent of the family (Orochia's coiled serpent, Orazaka's shards). The orbit turns, the node and the core
|
|
19
|
+
* breathe. The shield reads the host's text roles, so it is ink in both themes. Below 48 px it crops to the emblem.
|
|
20
|
+
*/
|
|
17
21
|
declare function KrizakaLogo({ size, animated, title, className }: MarkProps): React.JSX.Element;
|
|
18
22
|
|
|
19
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The Orazaka mark: three solid hexagonal shards in the Orazaka orange orbiting slowly around a core that breathes —
|
|
25
|
+
* the family's grammar (dashed orbit, ring, bold emblem, bright core). Below 48 px it crops to the emblem.
|
|
26
|
+
*/
|
|
20
27
|
declare function OrazakaLogo({ size, animated, title, className }: MarkProps): React.JSX.Element;
|
|
21
28
|
|
|
22
29
|
/**
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,25 @@ function cx(...parts) {
|
|
|
5
5
|
return parts.filter(Boolean).join(" ");
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
// src/marks/krizaka-geometry.ts
|
|
9
|
+
var KRIZAKA = {
|
|
10
|
+
viewBox: "0 0 400 400",
|
|
11
|
+
croppedViewBox: "86 82 228 228",
|
|
12
|
+
offset: 20,
|
|
13
|
+
/** The shield: a pointy-top hexagon (r 92 around 180,180), open at its upper-right edge. */
|
|
14
|
+
shield: "M259.7,134 L259.7,226 L180,272 L100.3,226 L100.3,134 L180,88 L212,106.5",
|
|
15
|
+
stroke: 22,
|
|
16
|
+
ink: { x1: 70, y1: 290, x2: 290, y2: 70 },
|
|
17
|
+
blue: { x1: 180, y1: 180, x2: 300, y2: 60, stops: [["0%", "#196df5"], ["100%", "#629cf8"]] },
|
|
18
|
+
/** The vertex where the shield opens: a node (the serpent's head in Orochia's grammar). */
|
|
19
|
+
node: { cx: 259.7, cy: 134, r: 19, inner: 6 },
|
|
20
|
+
core: { cx: 180, cy: 180, r: 24, inner: 8 },
|
|
21
|
+
highlight: "#dbeafe",
|
|
22
|
+
glow: { color: "#196df5", opacity: 0.16 },
|
|
23
|
+
orbit: { r: 160, dash: "8 8", width: 1.5 },
|
|
24
|
+
ring: { r: 134, width: 1 }
|
|
25
|
+
};
|
|
26
|
+
|
|
8
27
|
// src/marks/shared.ts
|
|
9
28
|
import { useId } from "react";
|
|
10
29
|
var neutral = (token, percent) => `var(${token}, color-mix(in srgb, currentColor ${percent}%, transparent))`;
|
|
@@ -17,97 +36,103 @@ var a11y = (title) => title ? { role: "img", "aria-label": title } : { "aria-hid
|
|
|
17
36
|
// src/marks/KrizakaLogo.tsx
|
|
18
37
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
38
|
var CSS = `
|
|
20
|
-
.kzm-spin { transform-origin:
|
|
21
|
-
.kzm-pulse { animation: kzm-pulse
|
|
39
|
+
.kzm-spin { transform-origin: 200px 200px; animation: kzm-spin 30s linear infinite; }
|
|
40
|
+
.kzm-pulse { transform-box: fill-box; transform-origin: center; animation: kzm-pulse 3.2s ease-in-out infinite; }
|
|
22
41
|
@keyframes kzm-spin { to { transform: rotate(360deg); } }
|
|
23
42
|
@keyframes kzm-pulse {
|
|
24
|
-
0%, 100% { filter: drop-shadow(0 0
|
|
25
|
-
50% { filter: drop-shadow(0 0
|
|
43
|
+
0%, 100% { filter: drop-shadow(0 0 6px hsla(217, 92%, 53%, .25)); opacity: .9; }
|
|
44
|
+
50% { filter: drop-shadow(0 0 14px hsla(217, 92%, 53%, .55)); opacity: 1; }
|
|
26
45
|
}
|
|
27
46
|
@media (prefers-reduced-motion: reduce) { .kzm-spin, .kzm-pulse { animation: none; } }
|
|
28
47
|
`;
|
|
29
48
|
function KrizakaLogo({ size = 32, animated = true, title, className }) {
|
|
30
|
-
const id = useIds("kzm", ["
|
|
31
|
-
const accent = "var(--kz-accent, hsl(217, 92%, 60%))";
|
|
49
|
+
const id = useIds("kzm", ["ink", "blue", "glow"]);
|
|
32
50
|
const m = (cls) => animated ? cls : void 0;
|
|
33
|
-
|
|
34
|
-
return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 400 400", fill: "none", xmlns: "http://www.w3.org/2000/svg", className, ...a11y(title), children: [
|
|
51
|
+
return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: size < 48 ? KRIZAKA.croppedViewBox : KRIZAKA.viewBox, fill: "none", xmlns: "http://www.w3.org/2000/svg", className, ...a11y(title), children: [
|
|
35
52
|
/* @__PURE__ */ jsx("style", { children: CSS }),
|
|
36
53
|
/* @__PURE__ */ jsxs("defs", { children: [
|
|
37
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: id.
|
|
38
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor:
|
|
39
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "
|
|
40
|
-
] }),
|
|
41
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: id.steel, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
|
|
42
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: neutral("--kz-text-secondary", 64) }),
|
|
43
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: neutral("--kz-text-muted", 38) })
|
|
44
|
-
] }),
|
|
45
|
-
/* @__PURE__ */ jsxs("radialGradient", { id: id.core, cx: "50%", cy: "50%", r: "50%", children: [
|
|
46
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "#60A5FA", stopOpacity: "1" }),
|
|
47
|
-
/* @__PURE__ */ jsx("stop", { offset: "35%", stopColor: accent, stopOpacity: "0.7" }),
|
|
48
|
-
/* @__PURE__ */ jsx("stop", { offset: "65%", stopColor: accent, stopOpacity: "0.02" }),
|
|
49
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: accent, stopOpacity: "0" })
|
|
54
|
+
/* @__PURE__ */ jsxs("linearGradient", { id: id.ink, gradientUnits: "userSpaceOnUse", x1: KRIZAKA.ink.x1, y1: KRIZAKA.ink.y1, x2: KRIZAKA.ink.x2, y2: KRIZAKA.ink.y2, children: [
|
|
55
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: neutral("--kz-text-secondary", 60) }),
|
|
56
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: neutral("--kz-text-primary", 92) })
|
|
50
57
|
] }),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ jsx("stop", { offset: "
|
|
58
|
+
/* @__PURE__ */ jsx("linearGradient", { id: id.blue, gradientUnits: "userSpaceOnUse", x1: KRIZAKA.blue.x1, y1: KRIZAKA.blue.y1, x2: KRIZAKA.blue.x2, y2: KRIZAKA.blue.y2, children: KRIZAKA.blue.stops.map(([offset, color]) => /* @__PURE__ */ jsx("stop", { offset, stopColor: color }, offset)) }),
|
|
59
|
+
/* @__PURE__ */ jsxs("radialGradient", { id: id.glow, cx: "50%", cy: "50%", r: "50%", children: [
|
|
60
|
+
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: KRIZAKA.glow.color, stopOpacity: KRIZAKA.glow.opacity }),
|
|
61
|
+
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: KRIZAKA.glow.color, stopOpacity: "0" })
|
|
54
62
|
] })
|
|
55
63
|
] }),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/* @__PURE__ */ jsx("
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ jsx("path", { d: "M180,240 L180,280 L200,295", stroke: `url(#${id.steel})`, strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", opacity: "0.5" }),
|
|
70
|
-
/* @__PURE__ */ jsx("path", { d: "M180,280 L160,295", stroke: `url(#${id.steel})`, strokeWidth: "3", strokeLinecap: "round", opacity: "0.5" }),
|
|
71
|
-
/* @__PURE__ */ jsx("line", { x1: "180", y1: "130", x2: "180", y2: "195", stroke: "#60A5FA", strokeWidth: "1.5", opacity: "0.3" }),
|
|
72
|
-
/* @__PURE__ */ jsx("line", { x1: "145", y1: "160", x2: "215", y2: "160", stroke: "#60A5FA", strokeWidth: "1.5", opacity: "0.3" }),
|
|
73
|
-
[[180, 130], [180, 195], [145, 160], [215, 160]].map(([x, y]) => /* @__PURE__ */ jsx("circle", { cx: x, cy: y, r: "3", fill: "#60A5FA", opacity: "0.5", ...pulse(x, y) }, `${x}-${y}`)),
|
|
74
|
-
/* @__PURE__ */ jsx("circle", { cx: "180", cy: "160", r: "18", fill: "#1E40AF", ...pulse(180, 160) }),
|
|
75
|
-
/* @__PURE__ */ jsx("circle", { cx: "180", cy: "160", r: "12", fill: "#3B82F6", ...pulse(180, 160) }),
|
|
76
|
-
/* @__PURE__ */ jsx("circle", { cx: "180", cy: "160", r: "5", fill: "#BFDBFE", ...pulse(180, 160) }),
|
|
77
|
-
/* @__PURE__ */ jsx("circle", { cx: "310", cy: "50", r: "2.5", fill: "#60A5FA", opacity: "0.6" }),
|
|
78
|
-
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "260", r: "2", fill: neutral("--kz-border-strong", 16), opacity: "0.4" })
|
|
64
|
+
size >= 48 ? /* @__PURE__ */ jsx("circle", { cx: "200", cy: "200", r: "190", fill: `url(#${id.glow})` }) : null,
|
|
65
|
+
/* @__PURE__ */ jsx("circle", { className: m("kzm-spin"), cx: "200", cy: "200", r: KRIZAKA.orbit.r, stroke: neutral("--kz-border-strong", 40), strokeWidth: KRIZAKA.orbit.width, strokeDasharray: KRIZAKA.orbit.dash, opacity: ".6" }),
|
|
66
|
+
/* @__PURE__ */ jsx("circle", { cx: "200", cy: "200", r: KRIZAKA.ring.r, stroke: neutral("--kz-border-default", 30), strokeWidth: KRIZAKA.ring.width, opacity: ".35" }),
|
|
67
|
+
/* @__PURE__ */ jsxs("g", { transform: `translate(${KRIZAKA.offset} ${KRIZAKA.offset})`, children: [
|
|
68
|
+
/* @__PURE__ */ jsx("path", { d: KRIZAKA.shield, stroke: `url(#${id.ink})`, strokeWidth: KRIZAKA.stroke, strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
69
|
+
/* @__PURE__ */ jsxs("g", { className: m("kzm-pulse"), children: [
|
|
70
|
+
/* @__PURE__ */ jsx("circle", { cx: KRIZAKA.node.cx, cy: KRIZAKA.node.cy, r: KRIZAKA.node.r, fill: `url(#${id.blue})` }),
|
|
71
|
+
/* @__PURE__ */ jsx("circle", { cx: KRIZAKA.node.cx, cy: KRIZAKA.node.cy, r: KRIZAKA.node.inner, fill: KRIZAKA.highlight })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsxs("g", { className: m("kzm-pulse"), children: [
|
|
74
|
+
/* @__PURE__ */ jsx("circle", { cx: KRIZAKA.core.cx, cy: KRIZAKA.core.cy, r: KRIZAKA.core.r, fill: `url(#${id.blue})` }),
|
|
75
|
+
/* @__PURE__ */ jsx("circle", { cx: KRIZAKA.core.cx, cy: KRIZAKA.core.cy, r: KRIZAKA.core.inner, fill: KRIZAKA.highlight })
|
|
76
|
+
] })
|
|
79
77
|
] })
|
|
80
78
|
] });
|
|
81
79
|
}
|
|
82
80
|
|
|
81
|
+
// src/marks/orazaka-geometry.ts
|
|
82
|
+
var ORAZAKA = {
|
|
83
|
+
viewBox: "0 0 400 400",
|
|
84
|
+
croppedViewBox: "76 76 248 248",
|
|
85
|
+
center: 200,
|
|
86
|
+
/**
|
|
87
|
+
* The three shards — a hexagon's cap (from the original 132-unit drawing), scaled ×1.9 around the centre and turned
|
|
88
|
+
* 0°, 120°, 240° — in view-box coordinates, so that one gradient runs across all three.
|
|
89
|
+
*/
|
|
90
|
+
shards: [
|
|
91
|
+
"M154.4,121.2 L200,94.7 L245.6,121.2 L245.6,154.4 L226.6,165.4 L226.6,132.2 L200,116.8 L173.4,132.2 L173.4,165.4 L154.4,154.4 Z",
|
|
92
|
+
"M291.1,199.9 L291.2,252.6 L245.5,278.9 L216.7,262.3 L216.6,240.3 L245.4,257 L272.1,241.6 L272,210.9 L243.2,194.3 L262.3,183.3 Z",
|
|
93
|
+
"M154.5,278.9 L108.8,252.6 L108.9,199.9 L137.7,183.3 L156.8,194.3 L128,210.9 L127.9,241.6 L154.6,257 L183.4,240.3 L183.3,262.3 Z"
|
|
94
|
+
],
|
|
95
|
+
shardStroke: 5.7,
|
|
96
|
+
amber: { x1: 90, y1: 310, x2: 310, y2: 90, stops: [["0%", "#b45309"], ["100%", "#f59e0b"]] },
|
|
97
|
+
core: { r: 21, inner: 7.6 },
|
|
98
|
+
highlight: "#fffbeb",
|
|
99
|
+
glow: { color: "#f59e0b", opacity: 0.16 },
|
|
100
|
+
orbit: { r: 160, dash: "8 8", width: 1.5 },
|
|
101
|
+
ring: { r: 134, width: 1 }
|
|
102
|
+
};
|
|
103
|
+
|
|
83
104
|
// src/marks/OrazakaLogo.tsx
|
|
84
105
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
85
106
|
var CSS2 = `
|
|
86
|
-
.ozm-orbit { transform-
|
|
87
|
-
.ozm-core { transform-box: fill-box; transform-origin: center; animation: ozm-core
|
|
107
|
+
.ozm-orbit { transform-origin: 200px 200px; animation: ozm-orbit 35s linear infinite; }
|
|
108
|
+
.ozm-core { transform-box: fill-box; transform-origin: center; animation: ozm-core 3.2s ease-in-out infinite; }
|
|
88
109
|
@keyframes ozm-orbit { to { transform: rotate(360deg); } }
|
|
89
110
|
@keyframes ozm-core {
|
|
90
|
-
0%, 100% {
|
|
91
|
-
50% {
|
|
111
|
+
0%, 100% { filter: drop-shadow(0 0 6px hsla(38, 92%, 50%, .3)); opacity: .9; }
|
|
112
|
+
50% { filter: drop-shadow(0 0 14px hsla(38, 92%, 50%, .6)); opacity: 1; }
|
|
92
113
|
}
|
|
93
114
|
@media (prefers-reduced-motion: reduce) { .ozm-orbit, .ozm-core { animation: none; } }
|
|
94
115
|
`;
|
|
95
|
-
function OrazakaLogo({ size =
|
|
96
|
-
const id = useIds("ozm", ["amber"]);
|
|
97
|
-
|
|
116
|
+
function OrazakaLogo({ size = 32, animated = true, title, className }) {
|
|
117
|
+
const id = useIds("ozm", ["amber", "glow"]);
|
|
118
|
+
const fill = `url(#${id.amber})`;
|
|
119
|
+
return /* @__PURE__ */ jsxs2("svg", { width: size, height: size, viewBox: size < 48 ? ORAZAKA.croppedViewBox : ORAZAKA.viewBox, fill: "none", xmlns: "http://www.w3.org/2000/svg", className, ...a11y(title), children: [
|
|
98
120
|
/* @__PURE__ */ jsx2("style", { children: CSS2 }),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */ jsx2("
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
/* @__PURE__ */ jsxs2("g", { className: animated ? "ozm-orbit" : void 0, children: [
|
|
106
|
-
/* @__PURE__ */ jsx2("path", { d: "M -24 -41.5 L 0 -55.4 L 24 -41.5 L 24 -24 L 14 -18.2 L 14 -35.7 L 0 -43.8 L -14 -35.7 L -14 -18.2", stroke: neutral("--kz-text-muted", 45), strokeWidth: "3.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
107
|
-
/* @__PURE__ */ jsx2("path", { d: "M -48 0 L -38 17.3 L -14 31.2 L 0 23.1 L -10 17.3 L -24 9.2 L -24 -9.2", stroke: neutral("--kz-text-secondary", 70), strokeWidth: "3.5", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
108
|
-
/* @__PURE__ */ jsx2("path", { d: "M 48 0 L 38 17.3 L 14 31.2 L 0 23.1 L 10 17.3 L 24 9.2 L 24 -9.2", stroke: `url(#${id.amber})`, strokeWidth: "3.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
121
|
+
/* @__PURE__ */ jsxs2("defs", { children: [
|
|
122
|
+
/* @__PURE__ */ jsx2("linearGradient", { id: id.amber, gradientUnits: "userSpaceOnUse", x1: ORAZAKA.amber.x1, y1: ORAZAKA.amber.y1, x2: ORAZAKA.amber.x2, y2: ORAZAKA.amber.y2, children: ORAZAKA.amber.stops.map(([offset, color]) => /* @__PURE__ */ jsx2("stop", { offset, stopColor: color }, offset)) }),
|
|
123
|
+
/* @__PURE__ */ jsxs2("radialGradient", { id: id.glow, cx: "50%", cy: "50%", r: "50%", children: [
|
|
124
|
+
/* @__PURE__ */ jsx2("stop", { offset: "0%", stopColor: ORAZAKA.glow.color, stopOpacity: ORAZAKA.glow.opacity }),
|
|
125
|
+
/* @__PURE__ */ jsx2("stop", { offset: "100%", stopColor: ORAZAKA.glow.color, stopOpacity: "0" })
|
|
126
|
+
] })
|
|
109
127
|
] }),
|
|
110
|
-
/* @__PURE__ */ jsx2("circle", { r: "
|
|
128
|
+
size >= 48 ? /* @__PURE__ */ jsx2("circle", { cx: ORAZAKA.center, cy: ORAZAKA.center, r: "190", fill: `url(#${id.glow})` }) : null,
|
|
129
|
+
/* @__PURE__ */ jsx2("circle", { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.orbit.r, stroke: neutral("--kz-border-strong", 40), strokeWidth: ORAZAKA.orbit.width, strokeDasharray: ORAZAKA.orbit.dash, opacity: ".6" }),
|
|
130
|
+
/* @__PURE__ */ jsx2("circle", { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.ring.r, stroke: neutral("--kz-border-default", 30), strokeWidth: ORAZAKA.ring.width, opacity: ".35" }),
|
|
131
|
+
/* @__PURE__ */ jsx2("g", { className: animated ? "ozm-orbit" : void 0, children: ORAZAKA.shards.map((d) => /* @__PURE__ */ jsx2("path", { d, fill, stroke: fill, strokeWidth: ORAZAKA.shardStroke, strokeLinejoin: "round" }, d)) }),
|
|
132
|
+
/* @__PURE__ */ jsxs2("g", { className: animated ? "ozm-core" : void 0, children: [
|
|
133
|
+
/* @__PURE__ */ jsx2("circle", { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.r, fill }),
|
|
134
|
+
/* @__PURE__ */ jsx2("circle", { cx: ORAZAKA.center, cy: ORAZAKA.center, r: ORAZAKA.core.inner, fill: ORAZAKA.highlight })
|
|
135
|
+
] })
|
|
111
136
|
] });
|
|
112
137
|
}
|
|
113
138
|
|