@stisla/style 3.0.0-beta.8 → 3.0.0-beta.9

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.
@@ -83,7 +83,7 @@
83
83
  background: var(--color-surface-2);
84
84
  }
85
85
 
86
- .card__header--compact {
86
+ .card__header--sm {
87
87
  --card-header-height: --spacing(11.5);
88
88
  }
89
89
 
@@ -0,0 +1,58 @@
1
+ /* @stisla/style — component barrel. Explicit @import of every component's raw CSS (grouping only,
2
+ * no compilation). This is the single list the precompiled @stisla/css bundle compiles, and what a
3
+ * build-from-source consumer imports to get everything at once:
4
+ * @import "tailwindcss"; @import "@stisla/style/theme.css"; @import "@stisla/style/components.css";
5
+ * To compose a subset instead, drop this barrel and @import only the components you want. */
6
+ @import "./accordion/accordion.css";
7
+ @import "./alert/alert.css";
8
+ @import "./autocomplete/autocomplete.css";
9
+ @import "./avatar/avatar.css";
10
+ @import "./avatar-group/avatar-group.css";
11
+ @import "./badge/badge.css";
12
+ @import "./breadcrumb/breadcrumb.css";
13
+ @import "./button/button.css";
14
+ @import "./button-group/button-group.css";
15
+ @import "./card/card.css";
16
+ @import "./carousel/carousel.css";
17
+ @import "./checkbox/checkbox.css";
18
+ @import "./collapsible/collapsible.css";
19
+ @import "./combobox/combobox.css";
20
+ @import "./combobox/combobox.tomselect.css";
21
+ @import "./dialog/dialog.css";
22
+ @import "./drawer/drawer.css";
23
+ @import "./empty-state/empty-state.css";
24
+ @import "./field/field.css";
25
+ @import "./icon-box/icon-box.css";
26
+ @import "./illustration/illustration.css";
27
+ @import "./indicator/indicator.css";
28
+ @import "./input/input.css";
29
+ @import "./input-group/input-group.css";
30
+ @import "./kbd/kbd.css";
31
+ @import "./link/link.css";
32
+ @import "./list-group/list-group.css";
33
+ @import "./media/media.css";
34
+ @import "./menu/menu.css";
35
+ @import "./meter/meter.css";
36
+ @import "./navbar/navbar.css";
37
+ @import "./page/page.css";
38
+ @import "./pagination/pagination.css";
39
+ @import "./placeholders/placeholders.css";
40
+ @import "./popover/popover.css";
41
+ @import "./progress/progress.css";
42
+ @import "./radio/radio.css";
43
+ @import "./scroll-area/scroll-area.css";
44
+ @import "./scroll-area/scroll-area.overlayscrollbars.css";
45
+ @import "./select/select.css";
46
+ @import "./separator/separator.css";
47
+ @import "./sidebar/sidebar.css";
48
+ @import "./slider/slider.css";
49
+ @import "./spinner/spinner.css";
50
+ @import "./switch/switch.css";
51
+ @import "./table/table.css";
52
+ @import "./tabs/tabs.css";
53
+ @import "./textarea/textarea.css";
54
+ @import "./timeline/timeline.css";
55
+ @import "./toast/toast.css";
56
+ @import "./toggle/toggle.css";
57
+ @import "./toggle-group/toggle-group.css";
58
+ @import "./tooltip/tooltip.css";
@@ -166,13 +166,13 @@
166
166
  }
167
167
 
168
168
  /* === Size modifiers === retune the panel width cap only. */
169
- .dialog--compact {
169
+ .dialog--sm {
170
170
  --dialog-width: --spacing(80);
171
171
  }
172
- .dialog--roomy {
172
+ .dialog--lg {
173
173
  --dialog-width: --spacing(160);
174
174
  }
175
- .dialog--spacious {
175
+ .dialog--xl {
176
176
  --dialog-width: --spacing(240);
177
177
  }
178
178
 
@@ -13,7 +13,8 @@
13
13
  flex-wrap: wrap;
14
14
  align-items: center;
15
15
  gap: var(--navbar-gap, --spacing(3));
16
- padding: var(--navbar-padding-block, --spacing(2.5)) var(--navbar-padding-inline, --spacing(4));
16
+ padding: var(--navbar-padding-block, --spacing(2.5))
17
+ var(--navbar-padding-inline, --spacing(4));
17
18
  background-color: var(--navbar-bg, var(--color-background));
18
19
  color: var(--navbar-color, var(--color-foreground));
19
20
  }
@@ -42,7 +43,10 @@
42
43
  align-items: center;
43
44
  height: var(--navbar-button-height, --spacing(9));
44
45
  padding-block: var(--navbar-brand-padding-block, 0);
45
- padding-inline: var(--navbar-brand-padding-inline, var(--navbar-button-padding-inline, --spacing(3)));
46
+ padding-inline: var(
47
+ --navbar-brand-padding-inline,
48
+ var(--navbar-button-padding-inline, --spacing(3))
49
+ );
46
50
  color: var(--navbar-color, var(--color-foreground));
47
51
  line-height: var(--leading-none);
48
52
  text-decoration: none;
@@ -59,9 +63,19 @@
59
63
  background-color: transparent;
60
64
  color: var(--navbar-color, var(--color-foreground));
61
65
  border: 0;
62
- border-radius: var(--navbar-button-radius, calc(var(--radius-md) - --spacing(1)));
66
+ border-radius: var(
67
+ --navbar-button-radius,
68
+ calc(var(--radius-md) - --spacing(1))
69
+ );
63
70
  cursor: pointer;
64
- transition: background-color var(--navbar-transition-duration, var(--transition-duration-fast)) ease;
71
+ transition: background-color
72
+ var(--navbar-transition-duration, var(--transition-duration-fast)) ease;
73
+ }
74
+
75
+ .navbar__toggle :is(svg, i) {
76
+ width: var(--navbar-toggle-icon-size, --spacing(5));
77
+ height: var(--navbar-toggle-icon-size, --spacing(5));
78
+ flex-shrink: 0;
65
79
  }
66
80
 
67
81
  .navbar__toggle:hover,
@@ -93,14 +107,19 @@
93
107
  height: var(--navbar-button-height, --spacing(9));
94
108
  padding-block: var(--navbar-button-padding-block, 0);
95
109
  padding-inline: var(--navbar-button-padding-inline, --spacing(3));
96
- border-radius: var(--navbar-button-radius, calc(var(--radius-md) - --spacing(1)));
110
+ border-radius: var(
111
+ --navbar-button-radius,
112
+ calc(var(--radius-md) - --spacing(1))
113
+ );
97
114
  background-color: transparent;
98
115
  color: var(--navbar-button-color, var(--color-foreground));
99
116
  line-height: var(--leading-none);
100
117
  text-decoration: none;
101
118
  transition:
102
- background-color var(--navbar-transition-duration, var(--transition-duration-fast)) ease,
103
- color var(--navbar-transition-duration, var(--transition-duration-fast)) ease;
119
+ background-color
120
+ var(--navbar-transition-duration, var(--transition-duration-fast)) ease,
121
+ color var(--navbar-transition-duration, var(--transition-duration-fast))
122
+ ease;
104
123
  }
105
124
 
106
125
  .navbar__button:hover,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stisla/style",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "Stisla framework-agnostic style layer — the Tailwind @theme foundation (theme.css) + pure-JS composer + per-component configs + compiled component CSS. Zero framework deps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,8 +13,9 @@
13
13
  "types": "./dist/button/index.d.ts",
14
14
  "import": "./dist/button/index.js"
15
15
  },
16
- "./button.css": "./dist/button/button.css",
17
16
  "./theme.css": "./src/theme.css",
17
+ "./components.css": "./dist/components.css",
18
+ "./*.css": "./dist/*/*.css",
18
19
  "./package.json": "./package.json"
19
20
  },
20
21
  "files": [
package/src/theme.css CHANGED
@@ -4,9 +4,9 @@
4
4
  * colors → var(--color-*) type → var(--text-*) / var(--leading-*) / var(--font-weight-*)
5
5
  * radius → var(--radius-*) shadow → var(--shadow-*) spacing → --spacing(n)
6
6
  * tint → --alpha(var(--color-x) / N%)
7
- * z-index + duration ride Tailwind's namespaces (--z-index-*, --transition-duration-*) in a
8
- * @theme static block: that generates z-* / duration-* utilities AND force-emits the vars so our
9
- * raw var() refs resolve. Only border-width has no namespace slot, so it stays --st-*.
7
+ * z-index + duration ride Tailwind's namespaces (--z-index-*, --transition-duration-*), declared
8
+ * inline below with everything else; components reference them via raw var(), which keeps each
9
+ * referenced token in the output. Only border-width has no namespace slot, so it stays --st-*.
10
10
  * Dark mode overrides --color-* in a scope.
11
11
  *
12
12
  * This file is a PURE @theme — it does NOT import Tailwind. Tailwind is pulled in once by the
@@ -56,9 +56,20 @@
56
56
  --color-ring: var(--color-primary);
57
57
 
58
58
  /* Geometry — our tuned radius + shadow (override Tailwind's defaults; spacing/type stay) */
59
- --radius-sm: 0.65rem;
60
- --radius-md: 0.75rem;
61
- --radius-lg: 1rem;
59
+ /* --radius is the single knob: a theme generator scales the whole ramp by rewriting it.
60
+ The steps keep our tuned curve as multipliers, so sm/md/lg stay pixel-identical to the
61
+ old literals (1rem * 0.65 = 0.65rem, etc.). We override Tailwind's full scale — not just
62
+ sm/md/lg — so the knob governs every tier and the ramp stays monotonic above lg.
63
+ Pills stay at 50%/9999px, off this knob. */
64
+ --radius: 1rem;
65
+ --radius-xs: calc(var(--radius) * 0.4);
66
+ --radius-sm: calc(var(--radius) * 0.65);
67
+ --radius-md: calc(var(--radius) * 0.75);
68
+ --radius-lg: var(--radius);
69
+ --radius-xl: calc(var(--radius) * 1.5);
70
+ --radius-2xl: calc(var(--radius) * 2);
71
+ --radius-3xl: calc(var(--radius) * 3);
72
+ --radius-4xl: calc(var(--radius) * 4);
62
73
  --shadow-sm:
63
74
  0 1px 2px 0 color-mix(in oklch, black 5%, transparent),
64
75
  0 1px 3px 0 color-mix(in oklch, black 4%, transparent);
@@ -81,37 +92,16 @@
81
92
  "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
82
93
  "Liberation Mono", monospace;
83
94
 
84
- /* Line-height scale — re-declared with Tailwind's default values (not changed). Tailwind v4 only
85
- emits a theme var to :root when a UTILITY uses it; our components reference var(--leading-*) in
86
- raw component CSS, and no leading-* utility is used anywhere, so without this they'd be
87
- tree-shaken away and every `line-height: var(--leading-*)` would fall back to the inherited 1.5.
88
- Declaring them here forces emission so the component line-heights actually apply. */
95
+ /* Line-height scale (Tailwind's default values, declared so the scale is ours to tune). */
89
96
  --leading-none: 1;
90
97
  --leading-tight: 1.25;
91
98
  --leading-snug: 1.375;
92
99
  --leading-normal: 1.5;
93
- }
94
-
95
- @variant dark {
96
- --color-background: oklch(0.155 0 0);
97
- --color-foreground: oklch(0.97 0 0);
98
- --color-surface: oklch(0.18 0 0);
99
- --color-surface-2: oklch(0.21 0 0);
100
- --color-surface-3: oklch(0.23 0 0);
101
- --color-border: oklch(0.25 0 0);
102
- --color-border-strong: oklch(0.32 0 0);
103
- --color-muted-foreground: oklch(0.72 0 0);
104
- --color-neutral: oklch(0.27 0 0);
105
- --color-neutral-foreground: oklch(0.97 0 0);
106
- --color-accent: oklch(0.26 0 0);
107
- --color-accent-foreground: oklch(0.97 0 0);
108
- }
109
100
 
110
- /* z-index + duration scales — Tailwind owns these namespaces, so naming them --z-index-* /
111
- * --transition-duration-* generates utilities (z-modal, duration-fast, …). `static` forces
112
- * unconditional emission: our component CSS references them via raw var(), which Tailwind can't
113
- * see, so without `static` a zero-utility-usage var would be tree-shaken (the --leading-* trap). */
114
- @theme static {
101
+ /* z-index + duration scales — Tailwind owns these namespaces, so naming them --z-index-* /
102
+ --transition-duration-* generates the matching utilities; components also reference them via
103
+ raw var(). Unused steps simply don't appear in the precompiled bundle (they stay in source for
104
+ build-from-source consumers). */
115
105
  --z-index-base: 0;
116
106
  --z-index-dropdown: 1000;
117
107
  --z-index-sticky: 1020;
@@ -126,6 +116,23 @@
126
116
  --transition-duration-slow: 320ms;
127
117
  }
128
118
 
119
+ :root {
120
+ @variant dark {
121
+ --color-background: oklch(0.155 0 0);
122
+ --color-foreground: oklch(0.97 0 0);
123
+ --color-surface: oklch(0.18 0 0);
124
+ --color-surface-2: oklch(0.21 0 0);
125
+ --color-surface-3: oklch(0.23 0 0);
126
+ --color-border: oklch(0.25 0 0);
127
+ --color-border-strong: oklch(0.32 0 0);
128
+ --color-muted-foreground: oklch(0.72 0 0);
129
+ --color-neutral: oklch(0.27 0 0);
130
+ --color-neutral-foreground: oklch(0.97 0 0);
131
+ --color-accent: oklch(0.26 0 0);
132
+ --color-accent-foreground: oklch(0.97 0 0);
133
+ }
134
+ }
135
+
129
136
  /* Single global default border thickness — NOT a scale, so no Tailwind namespace fits
130
137
  * (--border-width-* needs named steps; a bare --border-width generates nothing). Stays --st-*. */
131
138
  :root {