@handijit/ui 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +485 -571
  2. package/build/base.css +1 -1
  3. package/build/charts.cjs +1 -1
  4. package/build/charts.cjs.map +1 -1
  5. package/build/charts.css +1 -1
  6. package/build/charts.js +350 -349
  7. package/build/charts.js.map +1 -1
  8. package/build/chat.cjs +3 -3
  9. package/build/chat.cjs.map +1 -1
  10. package/build/chat.css +1 -1
  11. package/build/chat.js +344 -343
  12. package/build/chat.js.map +1 -1
  13. package/build/components/Accordion/style.css +1 -1
  14. package/build/components/Alert/style.css +1 -1
  15. package/build/components/Avatar/style.css +1 -1
  16. package/build/components/Badge/index.cjs +1 -1
  17. package/build/components/Badge/index.cjs.map +1 -1
  18. package/build/components/Badge/index.d.ts +8 -13
  19. package/build/components/Badge/index.js +1 -1
  20. package/build/components/Badge/index.js.map +1 -1
  21. package/build/components/Badge/style.css +1 -1
  22. package/build/components/BottomSheet/style.css +1 -1
  23. package/build/components/Breadcrumb/style.css +1 -1
  24. package/build/components/Button/index.cjs +1 -1
  25. package/build/components/Button/index.cjs.map +1 -1
  26. package/build/components/Button/index.js +2 -2
  27. package/build/components/Button/index.js.map +1 -1
  28. package/build/components/Button/style.css +1 -1
  29. package/build/components/Card/style.css +1 -1
  30. package/build/components/Carousel/style.css +1 -1
  31. package/build/components/Checkbox/style.css +1 -1
  32. package/build/components/Chip/style.css +1 -1
  33. package/build/components/ChipGroup/style.css +1 -1
  34. package/build/components/CodeBadge/style.css +1 -1
  35. package/build/components/Combobox/index.cjs +1 -1
  36. package/build/components/Combobox/index.cjs.map +1 -1
  37. package/build/components/Combobox/index.js +51 -51
  38. package/build/components/Combobox/index.js.map +1 -1
  39. package/build/components/Combobox/style.css +1 -1
  40. package/build/components/CommandPalette/style.css +1 -1
  41. package/build/components/CopyField/style.css +1 -1
  42. package/build/components/DataTable/style.css +1 -1
  43. package/build/components/DateField/index.d.ts +1 -1
  44. package/build/components/DateField/style.css +1 -1
  45. package/build/components/Directory/style.css +1 -1
  46. package/build/components/Disclosure/style.css +1 -1
  47. package/build/components/Divider/style.css +1 -1
  48. package/build/components/Drawer/style.css +1 -1
  49. package/build/components/EmptyState/style.css +1 -1
  50. package/build/components/Field/style.css +1 -1
  51. package/build/components/FileUpload/style.css +1 -1
  52. package/build/components/FilterBar/style.css +1 -1
  53. package/build/components/IconButton/index.cjs +1 -1
  54. package/build/components/IconButton/index.cjs.map +1 -1
  55. package/build/components/IconButton/index.d.ts +2 -2
  56. package/build/components/IconButton/index.js +1 -1
  57. package/build/components/IconButton/index.js.map +1 -1
  58. package/build/components/IconButton/style.css +1 -1
  59. package/build/components/Input/index.d.ts +1 -1
  60. package/build/components/Input/style.css +1 -1
  61. package/build/components/Kbd/style.css +1 -1
  62. package/build/components/Menu/style.css +1 -1
  63. package/build/components/Modal/style.css +1 -1
  64. package/build/components/PageHeader/style.css +1 -1
  65. package/build/components/Pagination/style.css +1 -1
  66. package/build/components/Panel/style.css +1 -1
  67. package/build/components/PasswordInput/style.css +1 -1
  68. package/build/components/Popover/style.css +1 -1
  69. package/build/components/Price/style.css +1 -1
  70. package/build/components/Progress/style.css +1 -1
  71. package/build/components/PromptDialog/style.css +1 -1
  72. package/build/components/QuantityStepper/style.css +1 -1
  73. package/build/components/Radio/style.css +1 -1
  74. package/build/components/RadioCard/style.css +1 -1
  75. package/build/components/RangeSlider/style.css +1 -1
  76. package/build/components/Rating/style.css +1 -1
  77. package/build/components/RatingInput/style.css +1 -1
  78. package/build/components/ScrollArea/style.css +1 -1
  79. package/build/components/SectionHeader/style.css +1 -1
  80. package/build/components/SegmentedControl/style.css +1 -1
  81. package/build/components/Select/index.cjs +1 -1
  82. package/build/components/Select/index.cjs.map +1 -1
  83. package/build/components/Select/index.js +28 -28
  84. package/build/components/Select/index.js.map +1 -1
  85. package/build/components/Select/style.css +1 -1
  86. package/build/components/Skeleton/style.css +1 -1
  87. package/build/components/Spinner/style.css +1 -1
  88. package/build/components/Stat/style.css +1 -1
  89. package/build/components/StatusDot/style.css +1 -1
  90. package/build/components/Steps/style.css +1 -1
  91. package/build/components/SummaryCard/style.css +1 -1
  92. package/build/components/Switch/index.d.ts +1 -1
  93. package/build/components/Switch/style.css +1 -1
  94. package/build/components/Table/style.css +1 -1
  95. package/build/components/TableCheckbox/style.css +1 -1
  96. package/build/components/Tabs/style.css +1 -1
  97. package/build/components/TagInput/style.css +1 -1
  98. package/build/components/TextLink/style.css +1 -1
  99. package/build/components/Textarea/style.css +1 -1
  100. package/build/components/Tile/style.css +1 -1
  101. package/build/components/Timeline/style.css +1 -1
  102. package/build/components/Toast/style.css +1 -1
  103. package/build/components/Tooltip/style.css +1 -1
  104. package/build/constants/breakpoint.constants.cjs +1 -1
  105. package/build/constants/breakpoint.constants.cjs.map +1 -1
  106. package/build/constants/breakpoint.constants.d.ts +13 -8
  107. package/build/constants/breakpoint.constants.js +7 -5
  108. package/build/constants/breakpoint.constants.js.map +1 -1
  109. package/build/enums/ui-size.enum.cjs.map +1 -1
  110. package/build/enums/ui-size.enum.d.ts +5 -2
  111. package/build/enums/ui-size.enum.js.map +1 -1
  112. package/build/enums/ui-variant.enum.cjs +1 -1
  113. package/build/enums/ui-variant.enum.cjs.map +1 -1
  114. package/build/enums/ui-variant.enum.d.ts +13 -13
  115. package/build/enums/ui-variant.enum.js +1 -1
  116. package/build/enums/ui-variant.enum.js.map +1 -1
  117. package/build/helpers/theme.helper.cjs +1 -23
  118. package/build/helpers/theme.helper.cjs.map +1 -1
  119. package/build/helpers/theme.helper.d.ts +13 -44
  120. package/build/helpers/theme.helper.js +31 -69
  121. package/build/helpers/theme.helper.js.map +1 -1
  122. package/build/hooks/useUiTheme.cjs +1 -1
  123. package/build/hooks/useUiTheme.cjs.map +1 -1
  124. package/build/hooks/useUiTheme.d.ts +4 -1
  125. package/build/hooks/useUiTheme.js +34 -28
  126. package/build/hooks/useUiTheme.js.map +1 -1
  127. package/build/hooks/useUiTokens.cjs +1 -1
  128. package/build/hooks/useUiTokens.cjs.map +1 -1
  129. package/build/hooks/useUiTokens.d.ts +8 -8
  130. package/build/hooks/useUiTokens.js +24 -27
  131. package/build/hooks/useUiTokens.js.map +1 -1
  132. package/build/index.cjs +1 -1
  133. package/build/index.d.ts +3 -5
  134. package/build/index.js +194 -202
  135. package/build/index.js.map +1 -1
  136. package/build/scss/_index.scss +4 -3
  137. package/build/scss/_mixins.scss +264 -146
  138. package/build/scss/_variables.scss +216 -24
  139. package/build/styles.css +67 -67
  140. package/build/theme/UiProvider.cjs +1 -1
  141. package/build/theme/UiProvider.cjs.map +1 -1
  142. package/build/theme/UiProvider.d.ts +10 -9
  143. package/build/theme/UiProvider.js +7 -25
  144. package/build/theme/UiProvider.js.map +1 -1
  145. package/build/theme/UiThemeScript.cjs +1 -1
  146. package/build/theme/UiThemeScript.cjs.map +1 -1
  147. package/build/theme/UiThemeScript.d.ts +13 -10
  148. package/build/theme/UiThemeScript.js +2 -2
  149. package/build/theme/UiThemeScript.js.map +1 -1
  150. package/build/theme/context.js +2 -2
  151. package/build/types/charts/core/palette.d.ts +6 -8
  152. package/build/types/chat/Legend/index.d.ts +3 -2
  153. package/build/types/theme.type.d.ts +6 -48
  154. package/build/types/types/theme.type.d.ts +6 -48
  155. package/package.json +10 -10
  156. package/build/scss/_colors.generated.scss +0 -119
  157. package/build/scss/_metrics.generated.scss +0 -49
  158. package/build/theme/initUi.cjs +0 -2
  159. package/build/theme/initUi.cjs.map +0 -1
  160. package/build/theme/initUi.d.ts +0 -7
  161. package/build/theme/initUi.js +0 -10
  162. package/build/theme/initUi.js.map +0 -1
  163. package/build/theme/palette.cjs +0 -2
  164. package/build/theme/palette.cjs.map +0 -1
  165. package/build/theme/palette.d.ts +0 -219
  166. package/build/theme/palette.js +0 -148
  167. package/build/theme/palette.js.map +0 -1
  168. package/build/theme/tokens.cjs +0 -2
  169. package/build/theme/tokens.cjs.map +0 -1
  170. package/build/theme/tokens.d.ts +0 -225
  171. package/build/theme/tokens.js +0 -384
  172. package/build/theme/tokens.js.map +0 -1
  173. package/build/types/theme/palette.d.ts +0 -219
  174. package/build/types/theme/tokens.d.ts +0 -225
@@ -1,17 +1,220 @@
1
- @forward 'colors.generated';
2
- @forward 'metrics.generated';
1
+ // SCSS names for the tokens of `@handijit/design`.
2
+ //
3
+ // Nothing in this file holds a colour, a size or a duration of its own: every theme-aware value is a
4
+ // `var(--hd-*)` reference, so the consuming application decides the values by loading
5
+ // `@handijit/design/tokens.css` once. `__tests__/styles/design-contract.test.ts` fails when a name
6
+ // below points at a custom property the installed design package does not define.
7
+ //
8
+ // ⚠ The values are `var()` references: they cannot go through Sass colour functions (`darken`,
9
+ // `rgba`). Mix in CSS instead: `color-mix(in srgb, #{$primary} 20%, transparent)`.
3
10
 
4
- $tracking-logo: 0.13em;
5
- $tracking-tight: -0.022em;
6
- $tracking-snug: -0.011em;
11
+ // --- Surfaces, lines, text ---
12
+ $bg-page: var(--hd-bg-page);
13
+ $bg-surface: var(--hd-bg-surface);
14
+ $bg-raised: var(--hd-bg-raised);
15
+ $bg-inset: var(--hd-bg-inset);
16
+ $bg-overlay: var(--hd-bg-overlay);
17
+ $bg-disabled: var(--hd-bg-disabled);
18
+ $border: var(--hd-border);
19
+ $border-strong: var(--hd-border-strong);
20
+ $text: var(--hd-text);
21
+ $text-2: var(--hd-text-2);
22
+ $text-3: var(--hd-text-3);
23
+ $text-disabled: var(--hd-text-disabled);
24
+
25
+ // --- Cobalt: primary action, link, selection, focus ---
26
+ $primary: var(--hd-primary);
27
+ $primary-hover: var(--hd-primary-hover);
28
+ $primary-active: var(--hd-primary-active);
29
+ $on-primary: var(--hd-on-primary);
30
+ $primary-soft: var(--hd-primary-soft);
31
+ $primary-soft-hover: var(--hd-primary-soft-hover);
32
+ $primary-line: var(--hd-primary-line);
33
+ $primary-text: var(--hd-primary-text);
34
+ $focus: var(--hd-focus);
35
+ // The ring of a control that sits IN a well (`bg-inset`): `focus` is 2.95:1 there in the light theme.
36
+ $focus-inset: var(--hd-primary-text);
37
+ $selection-bg: var(--hd-selection-bg);
38
+
39
+ // --- Coral: the conversion button and nothing else ---
40
+ $accent: var(--hd-accent);
41
+ $accent-hover: var(--hd-accent-hover);
42
+ $accent-active: var(--hd-accent-active);
43
+ $on-accent: var(--hd-on-accent);
44
+ $accent-soft: var(--hd-accent-soft);
45
+ $accent-text: var(--hd-accent-text);
46
+
47
+ // --- Turquoise: highlight and live state; a fill, never body text ---
48
+ $highlight: var(--hd-highlight);
49
+ $on-highlight: var(--hd-on-highlight);
50
+ $highlight-soft: var(--hd-highlight-soft);
51
+ $highlight-text: var(--hd-highlight-text);
52
+
53
+ // --- Status ---
54
+ $success-bg: var(--hd-success-bg);
55
+ $success-fg: var(--hd-success-fg);
56
+ $success-line: var(--hd-success-line);
57
+ $success-solid: var(--hd-success-solid);
58
+ $success-on-solid: var(--hd-success-on-solid);
59
+ $warning-bg: var(--hd-warning-bg);
60
+ $warning-fg: var(--hd-warning-fg);
61
+ $warning-line: var(--hd-warning-line);
62
+ $warning-solid: var(--hd-warning-solid);
63
+ $warning-on-solid: var(--hd-warning-on-solid);
64
+ $danger-bg: var(--hd-danger-bg);
65
+ $danger-fg: var(--hd-danger-fg);
66
+ $danger-line: var(--hd-danger-line);
67
+ $danger-solid: var(--hd-danger-solid);
68
+ $danger-on-solid: var(--hd-danger-on-solid);
69
+ $info-bg: var(--hd-info-bg);
70
+ $info-fg: var(--hd-info-fg);
71
+ $info-line: var(--hd-info-line);
72
+ $info-solid: var(--hd-info-solid);
73
+ $info-on-solid: var(--hd-info-on-solid);
74
+
75
+ // --- Data series ---
76
+ $chart-1: var(--hd-chart-1);
77
+ $chart-2: var(--hd-chart-2);
78
+ $chart-3: var(--hd-chart-3);
79
+ $chart-4: var(--hd-chart-4);
80
+ $chart-5: var(--hd-chart-5);
81
+ $chart-6: var(--hd-chart-6);
82
+
83
+ // --- Brand band: deep cobalt in both themes ---
84
+ $band-bg: var(--hd-band-bg);
85
+ $band-deep: var(--hd-band-deep);
86
+ $band-line: var(--hd-band-line);
87
+ $band-line-strong: var(--hd-band-line-strong);
88
+ $band-text: var(--hd-band-text);
89
+ $band-text-2: var(--hd-band-text-2);
90
+
91
+ // --- Inverse surface: dark in both themes (tooltip, terminal output, code badge) ---
92
+ // Static slate steps, so the block does not flip with the theme the way a `bg-*` role does.
93
+ $inverse-bg: var(--hd-slate-900);
94
+ $inverse-bg-2: var(--hd-slate-800);
95
+ $inverse-line: var(--hd-slate-700);
96
+ $inverse-text: var(--hd-slate-50);
97
+ $inverse-text-2: var(--hd-slate-300);
98
+ $inverse-danger: var(--hd-danger-300);
99
+
100
+ // --- Elevation ---
101
+ $shadow-1: var(--hd-shadow-1);
102
+ $shadow-2: var(--hd-shadow-2);
103
+ $shadow-3: var(--hd-shadow-3);
104
+ // A sheet rises from the bottom edge, so its shadow falls upwards; built from the theme's own shadow
105
+ // colour and strength.
106
+ $shadow-up: 0 -12px 32px -12px rgb(var(--hd-shadow-color) / calc(var(--hd-shadow-alpha) * 2));
107
+ $scrim: var(--hd-scrim);
108
+
109
+ // State layers for a row inside a floating surface (menu item, option, command). `bg-raised` is the
110
+ // hover fill on a page surface, but it is DARKER than `bg-overlay` in the dark theme; a veil of the
111
+ // text colour lightens the row in the dark theme and darkens it in the light one, on any surface.
112
+ $state-hover: color-mix(in srgb, var(--hd-text) 8%, transparent);
113
+ $state-pressed: color-mix(in srgb, var(--hd-text) 14%, transparent);
114
+
115
+ // The soft halo a text field shows around its focused border, next to the focus outline colour.
116
+ $focus-halo: 0 0 0 3px color-mix(in srgb, var(--hd-focus) 32%, transparent);
117
+ $danger-halo: 0 0 0 3px color-mix(in srgb, var(--hd-danger-solid) 28%, transparent);
118
+
119
+ // --- Typography ---
120
+ $font-display: var(--hd-font-display);
121
+ $font-body: var(--hd-font-body);
122
+ $font-mono: var(--hd-font-mono);
123
+
124
+ $weight-regular: var(--hd-font-weight-regular);
125
+ $weight-medium: var(--hd-font-weight-medium);
126
+ $weight-semibold: var(--hd-font-weight-semibold);
127
+ $weight-bold: var(--hd-font-weight-bold);
128
+
129
+ // One size per design type role. The `type` mixin applies a whole role (size, line height, weight,
130
+ // letter spacing, stretch); these are for controls that only need the size.
131
+ $font-size-caption: var(--hd-type-caption-size);
132
+ $font-size-small: var(--hd-type-small-size);
133
+ $font-size-body: var(--hd-type-body-size);
134
+ $font-size-lead: var(--hd-type-lead-size);
135
+ $font-size-h4: var(--hd-type-h4-size);
136
+ $font-size-h3: var(--hd-type-h3-size);
137
+ $font-size-h2: var(--hd-type-h2-size);
138
+ $font-size-h1: var(--hd-type-h1-size);
139
+ $font-size-display: var(--hd-type-display-size);
140
+ $font-size-code: var(--hd-type-code-size);
141
+
142
+ // iOS Safari zooms the page when a focused field is smaller than 16px; text entry never goes below.
143
+ $font-size-control: #{'max(16px, var(--hd-type-body-size))'};
144
+
145
+ $type-roles: display, h1, h2, h3, h4, lead, body, small, caption, code;
146
+
147
+ $leading-none: 1;
148
+ $leading-tight: var(--hd-type-h2-line-height);
149
+ $leading-snug: var(--hd-type-h4-line-height);
150
+ $leading-normal: var(--hd-type-body-line-height);
151
+
152
+ $tracking-tight: var(--hd-type-h2-letter-spacing);
153
+ $tracking-snug: var(--hd-type-h4-letter-spacing);
154
+ // Uppercase overlines and table headings; the design roles carry no uppercase tracking.
7
155
  $tracking-wide: 0.045em;
8
156
 
9
- $weight-regular: 400;
10
- $weight-medium: 500;
11
- $weight-semibold: 600;
12
- $weight-bold: 700;
157
+ // --- Spacing: step × 4px ---
158
+ $space-0: var(--hd-space-0);
159
+ $space-1: var(--hd-space-1);
160
+ $space-2: var(--hd-space-2);
161
+ $space-3: var(--hd-space-3);
162
+ $space-4: var(--hd-space-4);
163
+ $space-5: var(--hd-space-5);
164
+ $space-6: var(--hd-space-6);
165
+ $space-8: var(--hd-space-8);
166
+ $space-10: var(--hd-space-10);
167
+ $space-12: var(--hd-space-12);
168
+ $space-16: var(--hd-space-16);
169
+ $space-20: var(--hd-space-20);
170
+ $space-24: var(--hd-space-24);
171
+
172
+ // --- Radii ---
173
+ $radius-xs: var(--hd-radius-xs);
174
+ $radius-sm: var(--hd-radius-sm);
175
+ $radius-md: var(--hd-radius-md);
176
+ $radius-lg: var(--hd-radius-lg);
177
+ $radius-pill: var(--hd-radius-pill);
178
+
179
+ // --- Motion ---
180
+ // The design package turns the three durations into ~0 under `prefers-reduced-motion`.
181
+ $duration-fast: var(--hd-duration-fast);
182
+ $duration-base: var(--hd-duration-base);
183
+ $duration-slow: var(--hd-duration-slow);
184
+ $ease-standard: var(--hd-ease-standard);
185
+ $ease-enter: var(--hd-ease-enter);
186
+ $ease-exit: var(--hd-ease-exit);
187
+
188
+ // Looping animations have no design token (a loop is not a transition); `reduced-motion` stops them.
189
+ $duration-spin: 700ms;
190
+ $duration-shimmer: 1400ms;
191
+ $duration-pulse: 1600ms;
13
192
 
14
- $font-steps: 2xs, xs, sm, base, body, lg, xl, 2xl, 3xl, 4xl;
193
+ // --- Layers ---
194
+ $z-base: var(--hd-z-base);
195
+ $z-raised: var(--hd-z-raised);
196
+ $z-sticky: var(--hd-z-sticky);
197
+ $z-dropdown: var(--hd-z-dropdown);
198
+ $z-overlay: var(--hd-z-overlay);
199
+ $z-modal: var(--hd-z-modal);
200
+ $z-popover: var(--hd-z-popover);
201
+ $z-toast: var(--hd-z-toast);
202
+ $z-tooltip: var(--hd-z-tooltip);
203
+
204
+ // --- Breakpoints ---
205
+ // Media queries cannot read custom properties, so these are the design values as numbers; the
206
+ // contract test compares them with `breakpoints` from `@handijit/design`.
207
+ $breakpoint-sm: 640px;
208
+ $breakpoint-md: 768px;
209
+ $breakpoint-lg: 1024px;
210
+ $breakpoint-xl: 1280px;
211
+
212
+ // --- Library metrics (not theme values) ---
213
+ $icon-xs: 14px;
214
+ $icon-sm: 16px;
215
+ $icon-md: 18px;
216
+ $icon-lg: 20px;
217
+ $icon-xl: 24px;
15
218
 
16
219
  $measure: 68ch;
17
220
  $measure-narrow: 56ch;
@@ -20,27 +223,16 @@ $desktop-padding: 32px;
20
223
  $tablet-padding: 24px;
21
224
  $mobile-padding: 16px;
22
225
 
23
- $container-max-width: 1360px;
226
+ $container-max-width: $breakpoint-xl;
24
227
  $container-narrow: 880px;
25
228
  $container-split: 1000px;
26
229
  $container-prose: 720px;
27
-
28
230
  $sidebar-width: 272px;
29
231
 
232
+ // WCAG 2.5.5: the smallest area a finger hits reliably.
30
233
  $tap-target-size: 44px;
31
234
 
32
- $breakpoint-mobile: 640px;
33
- $breakpoint-tablet-portrait: 768px;
34
- $breakpoint-tablet: 1024px;
35
- $breakpoint-desktop: 1360px;
36
-
37
- $z-base: 1;
38
- $z-raised: 10;
39
- $z-dropdown: 200;
40
-
41
- $z-tooltip: 450;
42
- $z-toast: 500;
43
-
235
+ // --- Shared animations (keyframes live in `base.css`) ---
44
236
  $anim-shimmer: var(--ui-anim-shimmer);
45
237
  $anim-spin: var(--ui-anim-spin);
46
238
  $anim-fade-in-up: var(--ui-anim-fade-in-up);