@nextlyhq/ui 0.0.2-alpha.74 → 0.0.2-alpha.76

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.
@@ -27,16 +27,36 @@ type UiPreset = {
27
27
  destructive: {
28
28
  DEFAULT: string;
29
29
  solid: string;
30
+ hover: string;
30
31
  foreground: string;
31
32
  };
32
33
  success: {
33
34
  DEFAULT: string;
34
35
  solid: string;
35
36
  foreground: string;
37
+ surface: string;
38
+ border: string;
39
+ text: string;
36
40
  };
37
41
  warning: {
38
42
  DEFAULT: string;
39
43
  foreground: string;
44
+ solid: string;
45
+ surface: string;
46
+ border: string;
47
+ text: string;
48
+ };
49
+ danger: {
50
+ surface: string;
51
+ border: string;
52
+ text: string;
53
+ solid: string;
54
+ };
55
+ info: {
56
+ surface: string;
57
+ border: string;
58
+ text: string;
59
+ solid: string;
40
60
  };
41
61
  muted: {
42
62
  DEFAULT: string;
@@ -27,16 +27,36 @@ type UiPreset = {
27
27
  destructive: {
28
28
  DEFAULT: string;
29
29
  solid: string;
30
+ hover: string;
30
31
  foreground: string;
31
32
  };
32
33
  success: {
33
34
  DEFAULT: string;
34
35
  solid: string;
35
36
  foreground: string;
37
+ surface: string;
38
+ border: string;
39
+ text: string;
36
40
  };
37
41
  warning: {
38
42
  DEFAULT: string;
39
43
  foreground: string;
44
+ solid: string;
45
+ surface: string;
46
+ border: string;
47
+ text: string;
48
+ };
49
+ danger: {
50
+ surface: string;
51
+ border: string;
52
+ text: string;
53
+ solid: string;
54
+ };
55
+ info: {
56
+ surface: string;
57
+ border: string;
58
+ text: string;
59
+ solid: string;
40
60
  };
41
61
  muted: {
42
62
  DEFAULT: string;
@@ -78,6 +78,7 @@ const uiPreset = { theme: { extend: {
78
78
  destructive: {
79
79
  DEFAULT: "var(--nx-destructive)",
80
80
  solid: "var(--nx-destructive-solid)",
81
+ hover: "var(--nx-destructive-hover)",
81
82
  foreground: "var(--nx-destructive-foreground)",
82
83
  ...tintScale("--nx-destructive")
83
84
  },
@@ -85,13 +86,32 @@ const uiPreset = { theme: { extend: {
85
86
  DEFAULT: "var(--nx-success)",
86
87
  solid: "var(--nx-success-solid)",
87
88
  foreground: "var(--nx-success-foreground)",
89
+ surface: "var(--nx-success-surface)",
90
+ border: "var(--nx-success-border)",
91
+ text: "var(--nx-success-text)",
88
92
  ...tintScale("--nx-success")
89
93
  },
90
94
  warning: {
91
95
  DEFAULT: "var(--nx-warning)",
92
96
  foreground: "var(--nx-warning-foreground)",
97
+ solid: "var(--nx-warning-solid)",
98
+ surface: "var(--nx-warning-surface)",
99
+ border: "var(--nx-warning-border)",
100
+ text: "var(--nx-warning-text)",
93
101
  ...tintScale("--nx-warning")
94
102
  },
103
+ danger: {
104
+ surface: "var(--nx-danger-surface)",
105
+ border: "var(--nx-danger-border)",
106
+ text: "var(--nx-danger-text)",
107
+ solid: "var(--nx-danger-solid)"
108
+ },
109
+ info: {
110
+ surface: "var(--nx-info-surface)",
111
+ border: "var(--nx-info-border)",
112
+ text: "var(--nx-info-text)",
113
+ solid: "var(--nx-info-solid)"
114
+ },
95
115
  muted: {
96
116
  DEFAULT: "var(--nx-muted)",
97
117
  foreground: "var(--nx-muted-foreground)"
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind-preset.mjs","names":[],"sources":["../src/tailwind-preset.ts"],"sourcesContent":["/**\n * Tailwind CSS preset for @nextlyhq/ui components.\n *\n * Defines the CSS custom property contract that all UI components expect.\n * Consumers must provide the actual CSS variable values in their stylesheets.\n *\n * Usage (Tailwind v3, ESM):\n * // tailwind.config.ts\n * import uiPreset from \"@nextlyhq/ui/tailwind-preset\";\n * export default { presets: [uiPreset], ... };\n *\n * Usage (Tailwind v3, CommonJS):\n * // tailwind.config.js\n * const { uiPreset } = require(\"@nextlyhq/ui/tailwind-preset\");\n * module.exports = { presets: [uiPreset], ... };\n *\n * Usage (Tailwind v4 with @config):\n * Consumers define the equivalent @theme tokens in their CSS.\n * This file serves as the reference contract.\n *\n * Scope: tokens and the utilities derived from them, and nothing else. The\n * component classes the library writes into its own markup — `.nx-page-shell`,\n * `.nx-bleed`, `.nx-form-section-rows` — are CSS rules rather than token\n * mappings, and they ship in `theme.css` for every consumer alike. Restating\n * one of them here would express a single decision in two places that agree\n * until one of them is edited, and would still leave the others missing; the\n * boundary holds for all of them or it holds for none. `theme.css` is\n * therefore required alongside this preset, not an alternative to it, and\n * `tailwind-preset.test.ts` fails if a component selector reappears here.\n */\n/**\n * The numbered shade scale for a color, mixed from its base the same way the v4\n * `@theme` block does, so v3 preset consumers get the same utilities the\n * components emit (`bg-destructive-700`, `bg-primary-500`, `border-primary-300`).\n *\n * Named for the derivation rather than for one caller: the status colors, the\n * primary and the accent all use it, and `@theme` derives all five identically.\n */\nconst tintScale = (base: string): Record<number, string> => ({\n 50: `color-mix(in srgb, var(${base}), white 95%)`,\n 100: `color-mix(in srgb, var(${base}), white 90%)`,\n 200: `color-mix(in srgb, var(${base}), white 70%)`,\n 300: `color-mix(in srgb, var(${base}), white 50%)`,\n 400: `color-mix(in srgb, var(${base}), white 30%)`,\n 500: `var(${base})`,\n 600: `color-mix(in srgb, var(${base}), black 10%)`,\n 700: `color-mix(in srgb, var(${base}), black 30%)`,\n 800: `color-mix(in srgb, var(${base}), black 50%)`,\n 900: `color-mix(in srgb, var(${base}), black 70%)`,\n 950: `color-mix(in srgb, var(${base}), black 85%)`,\n});\n\n/** The shape of {@link uiPreset}: the tokens it maps, each to its CSS custom property. */\ntype UiPreset = {\n theme: {\n extend: {\n colors: {\n overlay: string;\n \"overlay-soft\": string;\n \"overlay-strong\": string;\n border: {\n DEFAULT: string;\n subtle: string;\n strong: string;\n };\n input: string;\n \"control-border\": string;\n ring: string;\n background: string;\n foreground: string;\n primary: {\n DEFAULT: string;\n foreground: string;\n };\n secondary: {\n DEFAULT: string;\n foreground: string;\n };\n destructive: {\n DEFAULT: string;\n solid: string;\n foreground: string;\n };\n success: {\n DEFAULT: string;\n solid: string;\n foreground: string;\n };\n warning: {\n DEFAULT: string;\n foreground: string;\n };\n muted: {\n DEFAULT: string;\n foreground: string;\n };\n accent: {\n DEFAULT: string;\n foreground: string;\n };\n highlight: {\n DEFAULT: string;\n foreground: string;\n };\n code: {\n bg: string;\n fg: string;\n comment: string;\n keyword: string;\n string: string;\n number: string;\n function: string;\n operator: string;\n punctuation: string;\n variable: string;\n tag: string;\n deleted: string;\n inserted: string;\n };\n sidebar: {\n DEFAULT: string;\n background: string;\n foreground: string;\n primary: string;\n \"primary-foreground\": string;\n accent: string;\n \"accent-background\": string;\n \"accent-foreground\": string;\n border: string;\n ring: string;\n };\n popover: {\n DEFAULT: string;\n foreground: string;\n };\n card: {\n DEFAULT: string;\n foreground: string;\n };\n };\n borderRadius: {\n lg: string;\n md: string;\n sm: string;\n };\n keyframes: {\n \"accordion-down\": {\n from: {\n height: string;\n };\n to: {\n height: string;\n };\n };\n \"accordion-up\": {\n from: {\n height: string;\n };\n to: {\n height: string;\n };\n };\n };\n animation: {\n \"accordion-down\": string;\n \"accordion-up\": string;\n };\n };\n };\n};\n\n/** @experimental */\nconst uiPreset: UiPreset = {\n theme: {\n extend: {\n colors: {\n // The modal scrim. Mapped here as well as in the v4 `@theme` block,\n // because this preset is the documented Tailwind v3 path and reads\n // none of that: without these two, `bg-overlay` generates no rule at\n // all and every backdrop is transparent rather than merely unthemed.\n overlay: \"var(--nx-overlay)\",\n \"overlay-soft\": \"var(--nx-overlay-soft)\",\n \"overlay-strong\": \"var(--nx-overlay-strong)\",\n border: {\n DEFAULT: \"var(--nx-border)\",\n subtle: \"var(--nx-border-subtle)\",\n strong: \"var(--nx-border-strong)\",\n },\n input: \"var(--nx-input)\",\n // The boundary of a control that draws no fill of its own -- an\n // unchecked checkbox, radio or switch. Separate from `input` because\n // that one is the field border weight, which sits below the 3:1\n // non-text minimum by design.\n \"control-border\": \"var(--nx-control-border)\",\n ring: \"var(--nx-ring)\",\n background: \"var(--nx-background)\",\n foreground: \"var(--nx-foreground)\",\n primary: {\n DEFAULT: \"var(--nx-primary)\",\n foreground: \"var(--nx-primary-foreground)\",\n ...tintScale(\"--nx-primary\"),\n },\n secondary: {\n DEFAULT: \"var(--nx-secondary)\",\n foreground: \"var(--nx-secondary-foreground)\",\n },\n destructive: {\n DEFAULT: \"var(--nx-destructive)\",\n // Saturated fill for solid buttons, distinct from the text-tuned base.\n solid: \"var(--nx-destructive-solid)\",\n foreground: \"var(--nx-destructive-foreground)\",\n ...tintScale(\"--nx-destructive\"),\n },\n success: {\n DEFAULT: \"var(--nx-success)\",\n solid: \"var(--nx-success-solid)\",\n foreground: \"var(--nx-success-foreground)\",\n ...tintScale(\"--nx-success\"),\n },\n warning: {\n DEFAULT: \"var(--nx-warning)\",\n foreground: \"var(--nx-warning-foreground)\",\n ...tintScale(\"--nx-warning\"),\n },\n muted: {\n DEFAULT: \"var(--nx-muted)\",\n foreground: \"var(--nx-muted-foreground)\",\n },\n accent: {\n DEFAULT: \"var(--nx-accent)\",\n foreground: \"var(--nx-accent-foreground)\",\n ...tintScale(\"--nx-accent\"),\n },\n // The editor's highlight mark, and the syntax colors, so authored\n // content and code blocks theme like everything else.\n highlight: {\n DEFAULT: \"var(--nx-highlight)\",\n foreground: \"var(--nx-highlight-foreground)\",\n },\n code: {\n bg: \"var(--nx-code-bg)\",\n fg: \"var(--nx-code-fg)\",\n comment: \"var(--nx-code-comment)\",\n keyword: \"var(--nx-code-keyword)\",\n string: \"var(--nx-code-string)\",\n number: \"var(--nx-code-number)\",\n function: \"var(--nx-code-function)\",\n operator: \"var(--nx-code-operator)\",\n punctuation: \"var(--nx-code-punctuation)\",\n variable: \"var(--nx-code-variable)\",\n tag: \"var(--nx-code-tag)\",\n deleted: \"var(--nx-code-deleted)\",\n inserted: \"var(--nx-code-inserted)\",\n },\n // `sidebar` and `sidebar-background` are the same value under two\n // names, and `sidebar-accent` and `sidebar-accent-background` likewise.\n // Both pairs exist in the v4 block and both spellings are in use, so\n // dropping either here would leave a live utility generating nothing.\n sidebar: {\n DEFAULT: \"var(--nx-sidebar-background)\",\n background: \"var(--nx-sidebar-background)\",\n foreground: \"var(--nx-sidebar-foreground)\",\n primary: \"var(--nx-sidebar-primary)\",\n \"primary-foreground\": \"var(--nx-sidebar-primary-foreground)\",\n accent: \"var(--nx-sidebar-accent)\",\n \"accent-background\": \"var(--nx-sidebar-accent)\",\n \"accent-foreground\": \"var(--nx-sidebar-accent-foreground)\",\n border: \"var(--nx-sidebar-border)\",\n ring: \"var(--nx-sidebar-ring)\",\n },\n popover: {\n DEFAULT: \"var(--nx-popover)\",\n foreground: \"var(--nx-popover-foreground)\",\n },\n card: {\n DEFAULT: \"var(--nx-card)\",\n foreground: \"var(--nx-card-foreground)\",\n },\n },\n borderRadius: {\n lg: \"var(--radius)\",\n md: \"calc(var(--radius) - 2px)\",\n sm: \"calc(var(--radius) - 4px)\",\n },\n keyframes: {\n \"accordion-down\": {\n from: { height: \"0\" },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n \"accordion-up\": {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: \"0\" },\n },\n },\n animation: {\n \"accordion-down\": \"accordion-down 0.3s cubic-bezier(0.87, 0, 0.13, 1)\",\n \"accordion-up\": \"accordion-up 0.3s cubic-bezier(0.87, 0, 0.13, 1)\",\n },\n },\n },\n};\n\n// Exported both ways on purpose. CommonJS cannot represent a default-only\n// module without `module.exports =`, which makes the emitted declarations\n// disagree with the runtime shape (attw's FalseExportDefault); a named export\n// alongside it keeps `require()` and `import` consistent and typed.\nexport { uiPreset };\nexport default uiPreset;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,aAAa,UAA0C;CAC3D,IAAI,0BAA0B,KAAK;CACnC,KAAK,0BAA0B,KAAK;CACpC,KAAK,0BAA0B,KAAK;CACpC,KAAK,0BAA0B,KAAK;CACpC,KAAK,0BAA0B,KAAK;CACpC,KAAK,OAAO,KAAK;CACjB,KAAK,0BAA0B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W;EACT,kBAAkB;GAChB,MAAM,EAAE,QAAQ,IAAI;GACpB,IAAI,EAAE,QAAQ,wCAAwC;EACxD;EACA,gBAAgB;GACd,MAAM,EAAE,QAAQ,wCAAwC;GACxD,IAAI,EAAE,QAAQ,IAAI;EACpB;CACF;CACA,WAAW;EACT,kBAAkB;EAClB,gBAAgB;CAClB;AACF,EACF,EACF"}
1
+ {"version":3,"file":"tailwind-preset.mjs","names":[],"sources":["../src/tailwind-preset.ts"],"sourcesContent":["/**\n * Tailwind CSS preset for @nextlyhq/ui components.\n *\n * Defines the CSS custom property contract that all UI components expect.\n * Consumers must provide the actual CSS variable values in their stylesheets.\n *\n * Usage (Tailwind v3, ESM):\n * // tailwind.config.ts\n * import uiPreset from \"@nextlyhq/ui/tailwind-preset\";\n * export default { presets: [uiPreset], ... };\n *\n * Usage (Tailwind v3, CommonJS):\n * // tailwind.config.js\n * const { uiPreset } = require(\"@nextlyhq/ui/tailwind-preset\");\n * module.exports = { presets: [uiPreset], ... };\n *\n * Usage (Tailwind v4 with @config):\n * Consumers define the equivalent @theme tokens in their CSS.\n * This file serves as the reference contract.\n *\n * Scope: tokens and the utilities derived from them, and nothing else. The\n * component classes the library writes into its own markup — `.nx-page-shell`,\n * `.nx-bleed`, `.nx-form-section-rows` — are CSS rules rather than token\n * mappings, and they ship in `theme.css` for every consumer alike. Restating\n * one of them here would express a single decision in two places that agree\n * until one of them is edited, and would still leave the others missing; the\n * boundary holds for all of them or it holds for none. `theme.css` is\n * therefore required alongside this preset, not an alternative to it, and\n * `tailwind-preset.test.ts` fails if a component selector reappears here.\n */\n/**\n * The numbered shade scale for a color, mixed from its base the same way the v4\n * `@theme` block does, so v3 preset consumers get the same utilities the\n * components emit (`bg-destructive-700`, `bg-primary-500`, `border-primary-300`).\n *\n * Named for the derivation rather than for one caller: the status colors, the\n * primary and the accent all use it, and `@theme` derives all five identically.\n */\nconst tintScale = (base: string): Record<number, string> => ({\n 50: `color-mix(in srgb, var(${base}), white 95%)`,\n 100: `color-mix(in srgb, var(${base}), white 90%)`,\n 200: `color-mix(in srgb, var(${base}), white 70%)`,\n 300: `color-mix(in srgb, var(${base}), white 50%)`,\n 400: `color-mix(in srgb, var(${base}), white 30%)`,\n 500: `var(${base})`,\n 600: `color-mix(in srgb, var(${base}), black 10%)`,\n 700: `color-mix(in srgb, var(${base}), black 30%)`,\n 800: `color-mix(in srgb, var(${base}), black 50%)`,\n 900: `color-mix(in srgb, var(${base}), black 70%)`,\n 950: `color-mix(in srgb, var(${base}), black 85%)`,\n});\n\n/** The shape of {@link uiPreset}: the tokens it maps, each to its CSS custom property. */\ntype UiPreset = {\n theme: {\n extend: {\n colors: {\n overlay: string;\n \"overlay-soft\": string;\n \"overlay-strong\": string;\n border: {\n DEFAULT: string;\n subtle: string;\n strong: string;\n };\n input: string;\n \"control-border\": string;\n ring: string;\n background: string;\n foreground: string;\n primary: {\n DEFAULT: string;\n foreground: string;\n };\n secondary: {\n DEFAULT: string;\n foreground: string;\n };\n destructive: {\n DEFAULT: string;\n solid: string;\n hover: string;\n foreground: string;\n };\n success: {\n DEFAULT: string;\n solid: string;\n foreground: string;\n surface: string;\n border: string;\n text: string;\n };\n warning: {\n DEFAULT: string;\n foreground: string;\n solid: string;\n surface: string;\n border: string;\n text: string;\n };\n danger: {\n surface: string;\n border: string;\n text: string;\n solid: string;\n };\n info: {\n surface: string;\n border: string;\n text: string;\n solid: string;\n };\n muted: {\n DEFAULT: string;\n foreground: string;\n };\n accent: {\n DEFAULT: string;\n foreground: string;\n };\n highlight: {\n DEFAULT: string;\n foreground: string;\n };\n code: {\n bg: string;\n fg: string;\n comment: string;\n keyword: string;\n string: string;\n number: string;\n function: string;\n operator: string;\n punctuation: string;\n variable: string;\n tag: string;\n deleted: string;\n inserted: string;\n };\n sidebar: {\n DEFAULT: string;\n background: string;\n foreground: string;\n primary: string;\n \"primary-foreground\": string;\n accent: string;\n \"accent-background\": string;\n \"accent-foreground\": string;\n border: string;\n ring: string;\n };\n popover: {\n DEFAULT: string;\n foreground: string;\n };\n card: {\n DEFAULT: string;\n foreground: string;\n };\n };\n borderRadius: {\n lg: string;\n md: string;\n sm: string;\n };\n keyframes: {\n \"accordion-down\": {\n from: {\n height: string;\n };\n to: {\n height: string;\n };\n };\n \"accordion-up\": {\n from: {\n height: string;\n };\n to: {\n height: string;\n };\n };\n };\n animation: {\n \"accordion-down\": string;\n \"accordion-up\": string;\n };\n };\n };\n};\n\n/** @experimental */\nconst uiPreset: UiPreset = {\n theme: {\n extend: {\n colors: {\n // The modal scrim. Mapped here as well as in the v4 `@theme` block,\n // because this preset is the documented Tailwind v3 path and reads\n // none of that: without these two, `bg-overlay` generates no rule at\n // all and every backdrop is transparent rather than merely unthemed.\n overlay: \"var(--nx-overlay)\",\n \"overlay-soft\": \"var(--nx-overlay-soft)\",\n \"overlay-strong\": \"var(--nx-overlay-strong)\",\n border: {\n DEFAULT: \"var(--nx-border)\",\n subtle: \"var(--nx-border-subtle)\",\n strong: \"var(--nx-border-strong)\",\n },\n input: \"var(--nx-input)\",\n // The boundary of a control that draws no fill of its own -- an\n // unchecked checkbox, radio or switch. Separate from `input` because\n // that one is the field border weight, which sits below the 3:1\n // non-text minimum by design.\n \"control-border\": \"var(--nx-control-border)\",\n ring: \"var(--nx-ring)\",\n background: \"var(--nx-background)\",\n foreground: \"var(--nx-foreground)\",\n primary: {\n DEFAULT: \"var(--nx-primary)\",\n foreground: \"var(--nx-primary-foreground)\",\n ...tintScale(\"--nx-primary\"),\n },\n secondary: {\n DEFAULT: \"var(--nx-secondary)\",\n foreground: \"var(--nx-secondary-foreground)\",\n },\n destructive: {\n DEFAULT: \"var(--nx-destructive)\",\n // Saturated fill for solid buttons, distinct from the text-tuned base.\n solid: \"var(--nx-destructive-solid)\",\n // The solid button's hover, set per mode in the theme so its label\n // keeps 4.5:1 with room to spare. Named, so no caller reaches for a\n // shade.\n hover: \"var(--nx-destructive-hover)\",\n foreground: \"var(--nx-destructive-foreground)\",\n ...tintScale(\"--nx-destructive\"),\n },\n success: {\n DEFAULT: \"var(--nx-success)\",\n solid: \"var(--nx-success-solid)\",\n foreground: \"var(--nx-success-foreground)\",\n surface: \"var(--nx-success-surface)\",\n border: \"var(--nx-success-border)\",\n text: \"var(--nx-success-text)\",\n ...tintScale(\"--nx-success\"),\n },\n warning: {\n DEFAULT: \"var(--nx-warning)\",\n foreground: \"var(--nx-warning-foreground)\",\n solid: \"var(--nx-warning-solid)\",\n surface: \"var(--nx-warning-surface)\",\n border: \"var(--nx-warning-border)\",\n text: \"var(--nx-warning-text)\",\n ...tintScale(\"--nx-warning\"),\n },\n // Status tokens with no base colour of their own: `danger` is a\n // status, kept apart from `destructive`, the colour of an action.\n danger: {\n surface: \"var(--nx-danger-surface)\",\n border: \"var(--nx-danger-border)\",\n text: \"var(--nx-danger-text)\",\n solid: \"var(--nx-danger-solid)\",\n },\n info: {\n surface: \"var(--nx-info-surface)\",\n border: \"var(--nx-info-border)\",\n text: \"var(--nx-info-text)\",\n solid: \"var(--nx-info-solid)\",\n },\n muted: {\n DEFAULT: \"var(--nx-muted)\",\n foreground: \"var(--nx-muted-foreground)\",\n },\n accent: {\n DEFAULT: \"var(--nx-accent)\",\n foreground: \"var(--nx-accent-foreground)\",\n ...tintScale(\"--nx-accent\"),\n },\n // The editor's highlight mark, and the syntax colors, so authored\n // content and code blocks theme like everything else.\n highlight: {\n DEFAULT: \"var(--nx-highlight)\",\n foreground: \"var(--nx-highlight-foreground)\",\n },\n code: {\n bg: \"var(--nx-code-bg)\",\n fg: \"var(--nx-code-fg)\",\n comment: \"var(--nx-code-comment)\",\n keyword: \"var(--nx-code-keyword)\",\n string: \"var(--nx-code-string)\",\n number: \"var(--nx-code-number)\",\n function: \"var(--nx-code-function)\",\n operator: \"var(--nx-code-operator)\",\n punctuation: \"var(--nx-code-punctuation)\",\n variable: \"var(--nx-code-variable)\",\n tag: \"var(--nx-code-tag)\",\n deleted: \"var(--nx-code-deleted)\",\n inserted: \"var(--nx-code-inserted)\",\n },\n // `sidebar` and `sidebar-background` are the same value under two\n // names, and `sidebar-accent` and `sidebar-accent-background` likewise.\n // Both pairs exist in the v4 block and both spellings are in use, so\n // dropping either here would leave a live utility generating nothing.\n sidebar: {\n DEFAULT: \"var(--nx-sidebar-background)\",\n background: \"var(--nx-sidebar-background)\",\n foreground: \"var(--nx-sidebar-foreground)\",\n primary: \"var(--nx-sidebar-primary)\",\n \"primary-foreground\": \"var(--nx-sidebar-primary-foreground)\",\n accent: \"var(--nx-sidebar-accent)\",\n \"accent-background\": \"var(--nx-sidebar-accent)\",\n \"accent-foreground\": \"var(--nx-sidebar-accent-foreground)\",\n border: \"var(--nx-sidebar-border)\",\n ring: \"var(--nx-sidebar-ring)\",\n },\n popover: {\n DEFAULT: \"var(--nx-popover)\",\n foreground: \"var(--nx-popover-foreground)\",\n },\n card: {\n DEFAULT: \"var(--nx-card)\",\n foreground: \"var(--nx-card-foreground)\",\n },\n },\n borderRadius: {\n lg: \"var(--radius)\",\n md: \"calc(var(--radius) - 2px)\",\n sm: \"calc(var(--radius) - 4px)\",\n },\n keyframes: {\n \"accordion-down\": {\n from: { height: \"0\" },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n \"accordion-up\": {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: \"0\" },\n },\n },\n animation: {\n \"accordion-down\": \"accordion-down 0.3s cubic-bezier(0.87, 0, 0.13, 1)\",\n \"accordion-up\": \"accordion-up 0.3s cubic-bezier(0.87, 0, 0.13, 1)\",\n },\n },\n },\n};\n\n// Exported both ways on purpose. CommonJS cannot represent a default-only\n// module without `module.exports =`, which makes the emitted declarations\n// disagree with the runtime shape (attw's FalseExportDefault); a named export\n// alongside it keeps `require()` and `import` consistent and typed.\nexport { uiPreset };\nexport default uiPreset;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,aAAa,UAA0C;CAC3D,IAAI,0BAA0B,KAAK;CACnC,KAAK,0BA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UAAU;GACV,aAAa;GACb,UAAU;GACV,KAAK;GACL,SAAS;GACT,UAAU;EACZ;EAKA,SAAS;GACP,SAAS;GACT,YAAY;GACZ,YAAY;GACZ,SAAS;GACT,sBAAsB;GACtB,QAAQ;GACR,qBAAqB;GACrB,qBAAqB;GACrB,QAAQ;GACR,MAAM;EACR;EACA,SAAS;GACP,SAAS;GACT,YAAY;EACd;EACA,MAAM;GACJ,SAAS;GACT,YAAY;EACd;CACF;CACA,cAAc;EACZ,IAAI;EACJ,IAAI;EACJ,IAAI;CACN;CACA,WAAW;EACT,kBAAkB;GAChB,MAAM,EAAE,QAAQ,IAAI;GACpB,IAAI,EAAE,QAAQ,wCAAwC;EACxD;EACA,gBAAgB;GACd,MAAM,EAAE,QAAQ,wCAAwC;GACxD,IAAI,EAAE,QAAQ,IAAI;EACpB;CACF;CACA,WAAW;EACT,kBAAkB;EAClB,gBAAgB;CAClB;AACF,EACF,EACF"}
package/dist/theme.css CHANGED
@@ -36,6 +36,9 @@
36
36
  --animate-slide-in-from-right-2: slide-in-from-right-2 0.2s ease-out;
37
37
  --animate-brand-orbit: brand-orbit 2.4s linear infinite;
38
38
  --animate-brand-pulse: brand-pulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
39
+ /* The thin line under the admin's bar while a screen's data is on its way:
40
+ a short segment crossing the full width, then again. */
41
+ --animate-loading-line: loading-line 1.4s ease-in-out infinite;
39
42
 
40
43
  /* ============================================
41
44
  * COLOR PALETTE (Tailwind v4.1)
@@ -168,7 +171,12 @@
168
171
  * shades exist because a status needs more than its solid colour: a tinted
169
172
  * surface, a border on that surface, and text dark enough to read on it.
170
173
  * Mixing toward white and black keeps 50 pale and 900 deep in both modes,
171
- * which is what a `dark:` pair at the call site already assumes. */
174
+ * which is what a `dark:` pair at the call site already assumes.
175
+ *
176
+ * Deprecated for status colour: the status tokens below (`-surface`,
177
+ * `-border`, `-text`, `-solid`) replace these shades wherever a status is
178
+ * drawn. The shades stay so existing callers and plugins keep building,
179
+ * and are removed in a later minor release. */
172
180
  --color-destructive: var(--nx-destructive);
173
181
  --color-destructive-50: color-mix(in srgb, var(--nx-destructive), white 95%);
174
182
  --color-destructive-100: color-mix(in srgb, var(--nx-destructive), white 90%);
@@ -185,6 +193,9 @@
185
193
  * so each can be solved for its own job. The ink that lands on it is
186
194
  * `-foreground`, which is white in light mode and black in dark. */
187
195
  --color-destructive-solid: var(--nx-destructive-solid);
196
+ /* The solid button's hover, set per mode beside its fill. Named, so no
197
+ * caller draws it from a numbered shade. */
198
+ --color-destructive-hover: var(--nx-destructive-hover);
188
199
  --color-destructive-foreground: var(--nx-destructive-foreground);
189
200
 
190
201
  --color-success: var(--nx-success);
@@ -217,6 +228,25 @@
217
228
  --color-warning-950: color-mix(in srgb, var(--nx-warning), black 85%);
218
229
  --color-warning-foreground: var(--nx-warning-foreground);
219
230
 
231
+ /* Status tokens: surface, border, text and solid per status (theme.css
232
+ * :root explains each). The numbered shades above stay for existing callers
233
+ * and are deprecated; new code uses these. */
234
+ --color-success-surface: var(--nx-success-surface);
235
+ --color-success-border: var(--nx-success-border);
236
+ --color-success-text: var(--nx-success-text);
237
+ --color-warning-surface: var(--nx-warning-surface);
238
+ --color-warning-border: var(--nx-warning-border);
239
+ --color-warning-text: var(--nx-warning-text);
240
+ --color-warning-solid: var(--nx-warning-solid);
241
+ --color-danger-surface: var(--nx-danger-surface);
242
+ --color-danger-border: var(--nx-danger-border);
243
+ --color-danger-text: var(--nx-danger-text);
244
+ --color-danger-solid: var(--nx-danger-solid);
245
+ --color-info-surface: var(--nx-info-surface);
246
+ --color-info-border: var(--nx-info-border);
247
+ --color-info-text: var(--nx-info-text);
248
+ --color-info-solid: var(--nx-info-solid);
249
+
220
250
  /* The editor's highlight mark. A token rather than a literal because it
221
251
  * styles authored content, which an integrator restyles to their own site
222
252
  * and which has to stay readable on a dark page. */
@@ -617,6 +647,20 @@
617
647
  }
618
648
  }
619
649
 
650
+ /* From fully off the left edge to fully off the right one, so the segment
651
+ never sits still at either end. Driven by `transform`, never by `left`: a
652
+ moving box counts as a layout shift, and a transform does not. The segment
653
+ is 30% of the line, so the line's far edge is 100 / 30 of its own widths
654
+ from its start. */
655
+ @keyframes loading-line {
656
+ from {
657
+ transform: translateX(-100%);
658
+ }
659
+ to {
660
+ transform: translateX(333.34%);
661
+ }
662
+ }
663
+
620
664
  @keyframes brand-pulse {
621
665
  0%,
622
666
  100% {
@@ -792,6 +836,12 @@
792
836
  * affected pairings with their measured ratios. */
793
837
  --nx-destructive: oklch(0.63 0.19 23.03);
794
838
  --nx-destructive-solid: oklch(0.63 0.19 23.03);
839
+ /* Hover deepens the fill toward black, which its white label reads better on. */
840
+ --nx-destructive-hover: color-mix(
841
+ in srgb,
842
+ var(--nx-destructive-solid),
843
+ black 20%
844
+ );
795
845
  --nx-destructive-foreground: oklch(1 0 0);
796
846
  /* white */
797
847
  /* Darkened from green-600; renders as #00852c, ~4.8:1 as text on white. */
@@ -816,6 +866,29 @@
816
866
  --nx-warning-foreground: oklch(0.2079 0.0399 265.73);
817
867
  /* slate-900 - REQUIRED for AA contrast (warning-500 on white = 3.4:1, fails AA) */
818
868
 
869
+ /* Status tokens. Each status has a faint SURFACE (an alert, a highlighted
870
+ * row), a BORDER for anything drawn on that surface, TEXT that reads at 4.5:1
871
+ * on its surface, on a card and on the page, and a SOLID for dots and icons
872
+ * that meets 3:1 on the page. They replace the white/black mixes of the
873
+ * numbered shades (`success-100`, `warning-700`), which tinted every chip.
874
+ * `danger` is a status (Failed, Error); `destructive` stays the colour of a
875
+ * destructive action. Success keeps its existing `-solid`. */
876
+ --nx-success-surface: oklch(0.975 0.013 150);
877
+ --nx-success-border: oklch(0.86 0.06 150);
878
+ --nx-success-text: oklch(0.43 0.12 150);
879
+ --nx-warning-surface: oklch(0.978 0.018 80);
880
+ --nx-warning-border: oklch(0.86 0.08 80);
881
+ --nx-warning-text: oklch(0.47 0.11 65);
882
+ --nx-warning-solid: oklch(0.64 0.15 62);
883
+ --nx-danger-surface: oklch(0.975 0.013 25);
884
+ --nx-danger-border: oklch(0.86 0.06 25);
885
+ --nx-danger-text: oklch(0.5 0.17 27);
886
+ --nx-danger-solid: oklch(0.6 0.2 27);
887
+ --nx-info-surface: oklch(0.975 0.012 250);
888
+ --nx-info-border: oklch(0.86 0.05 250);
889
+ --nx-info-text: oklch(0.45 0.13 255);
890
+ --nx-info-solid: oklch(0.58 0.16 255);
891
+
819
892
  /* The highlighter mark in authored content. Kept a light yellow in both
820
893
  * modes on purpose: it stands for a marker pen drawn over the text, and the
821
894
  * pairing below is what keeps that readable rather than the page's own
@@ -1087,6 +1160,13 @@
1087
1160
  /* Same value as the base: the button fill needs no darkening here because
1088
1161
  its ink is black rather than white. */
1089
1162
  --nx-destructive-solid: oklch(0.69 0.2 23.91);
1163
+ /* Hover lightens the fill, since its label here is black: deepening it
1164
+ would take the label toward the fill. */
1165
+ --nx-destructive-hover: color-mix(
1166
+ in srgb,
1167
+ var(--nx-destructive-solid),
1168
+ white 15%
1169
+ );
1090
1170
  /* Black, not white. The dark-mode fill is light enough that black on-color
1091
1171
  text reads at 6.90:1 where white would fall below the minimum. */
1092
1172
  --nx-destructive-foreground: oklch(0 0 0);
@@ -1112,6 +1192,24 @@
1112
1192
  --nx-warning-foreground: oklch(0.2079 0.0399 265.73);
1113
1193
  /* slate-900 */
1114
1194
 
1195
+ /* Status tokens, dark: a deep tinted surface, a mid border, light text and a
1196
+ * bright solid, so each reads on the black page as its light twin does. */
1197
+ --nx-success-surface: oklch(0.22 0.03 150);
1198
+ --nx-success-border: oklch(0.37 0.07 150);
1199
+ --nx-success-text: oklch(0.82 0.13 150);
1200
+ --nx-warning-surface: oklch(0.23 0.035 75);
1201
+ --nx-warning-border: oklch(0.4 0.08 75);
1202
+ --nx-warning-text: oklch(0.85 0.12 80);
1203
+ --nx-warning-solid: oklch(0.78 0.15 75);
1204
+ --nx-danger-surface: oklch(0.23 0.04 25);
1205
+ --nx-danger-border: oklch(0.4 0.09 25);
1206
+ --nx-danger-text: oklch(0.8 0.11 25);
1207
+ --nx-danger-solid: oklch(0.68 0.19 25);
1208
+ --nx-info-surface: oklch(0.22 0.035 255);
1209
+ --nx-info-border: oklch(0.38 0.08 255);
1210
+ --nx-info-text: oklch(0.82 0.09 250);
1211
+ --nx-info-solid: oklch(0.68 0.14 255);
1212
+
1115
1213
  /* Dimmed so the mark reads as highlighted rather than as a lamp on a dark
1116
1214
  * page, while its own foreground stays dark enough to read against it. */
1117
1215
  --nx-highlight: oklch(0.8 0.1425 101.06);
@@ -1266,6 +1364,26 @@
1266
1364
  align-content: start;
1267
1365
  }
1268
1366
 
1367
+ /* A list page's inset: the shell's gutter as padding on a plain block, for a
1368
+ * page that must stay a block (it hands its height down through
1369
+ * `height: 100%`, which a grid area sized by `align-content: start` would
1370
+ * collapse). */
1371
+ .nx-page-pad {
1372
+ padding-inline: var(--nx-gutter);
1373
+ }
1374
+
1375
+ /* A start-aligned shell keeps the leading gutter fixed and gives all the
1376
+ * surplus to the trailing track, so a bounded column starts at the same edge
1377
+ * as the page header and every list instead of drifting right as the screen
1378
+ * widens. A `full` column still fills the row. */
1379
+ .nx-page-shell[data-align="start"] {
1380
+ grid-template-columns:
1381
+ [full-start] var(--nx-gutter)
1382
+ [content-start] minmax(0, var(--nx-shell-measure))
1383
+ [content-end] minmax(var(--nx-gutter), 1fr)
1384
+ [full-end];
1385
+ }
1386
+
1269
1387
  /* `min-width: 0` because a grid item's default `min-width: auto` refuses to
1270
1388
  * shrink below its content, which lets one wide descendant — a long code
1271
1389
  * string, a table — push the column past the measure it was given. */
@@ -1293,13 +1411,15 @@
1293
1411
  * `:root` or `.nextly-admin` — both ancestors of the `<main>` that declares it —
1294
1412
  * never matches, and the gutter keeps its widest value at every panel size. */
1295
1413
  @container content (max-width: 1024px) {
1296
- .nx-page-shell {
1414
+ .nx-page-shell,
1415
+ .nx-page-pad {
1297
1416
  --nx-gutter: 1.5rem;
1298
1417
  }
1299
1418
  }
1300
1419
 
1301
1420
  @container content (max-width: 768px) {
1302
- .nx-page-shell {
1421
+ .nx-page-shell,
1422
+ .nx-page-pad {
1303
1423
  --nx-gutter: 1rem;
1304
1424
  }
1305
1425
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextlyhq/ui",
3
- "version": "0.0.2-alpha.74",
3
+ "version": "0.0.2-alpha.76",
4
4
  "description": "Nextly UI — Reusable React component library for Nextly plugins and custom admin UIs",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -87,9 +87,9 @@
87
87
  "react-dom": "^19.3.0"
88
88
  },
89
89
  "devDependencies": {
90
- "@nextlyhq/admin-css": "0.0.2-alpha.74",
91
- "@nextlyhq/module-specifiers": "0.0.2-alpha.74",
92
- "@nextlyhq/tsconfig": "0.0.2-alpha.74",
90
+ "@nextlyhq/admin-css": "0.0.2-alpha.76",
91
+ "@nextlyhq/module-specifiers": "0.0.2-alpha.76",
92
+ "@nextlyhq/tsconfig": "0.0.2-alpha.76",
93
93
  "@tailwindcss/cli": "^4.3.2",
94
94
  "@testing-library/react": "^16.3.0",
95
95
  "@types/culori": "^4.0.1",