@exsto/ds 0.0.1-rc.1 → 0.0.1-rc.13
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 +108 -27
- package/dist/chunks/date-range-picker-CWVcHgy2.js +204 -0
- package/dist/chunks/date-range-picker-CWVcHgy2.js.map +1 -0
- package/dist/chunks/input-syWxjY2U.js +172 -0
- package/dist/chunks/input-syWxjY2U.js.map +1 -0
- package/dist/chunks/toggle-Bxg8P-61.js +490 -0
- package/dist/chunks/toggle-Bxg8P-61.js.map +1 -0
- package/dist/date-picker.js +345 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/ds/src/date-picker.d.ts +9 -0
- package/dist/ds/src/index.d.ts +2 -3
- package/dist/ds/src/rich-text-editor.d.ts +8 -0
- package/dist/index.js +4514 -2
- package/dist/index.js.map +1 -0
- package/dist/rich-text-editor.js +905 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/source-hash.txt +1 -0
- package/dist/styles.css +938 -235
- package/dist/theme.css +308 -0
- package/dist/theme.css.d.ts +2 -0
- package/dist/ui/src/components/edyn/animated-number/animated-number.d.ts +30 -0
- package/dist/ui/src/components/edyn/animated-number/animated-number.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/animated-number/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/audio-player/audio-player.d.ts +3 -2
- package/dist/ui/src/components/edyn/date-picker/date-picker.d.ts +76 -0
- package/dist/ui/src/components/edyn/date-picker/date-picker.state.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/date-picker/date-text.d.ts +40 -0
- package/dist/ui/src/components/edyn/date-picker/index.d.ts +2 -0
- package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.d.ts +28 -0
- package/dist/ui/src/components/edyn/date-range-picker/date-range-picker.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/date-range-picker/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/initials-avatar/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.d.ts +54 -0
- package/dist/ui/src/components/edyn/initials-avatar/initials-avatar.test.d.ts +10 -0
- package/dist/ui/src/components/edyn/multi-select/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.d.ts +106 -0
- package/dist/ui/src/components/edyn/multi-select/multi-select.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/progress-line/index.d.ts +1 -0
- package/dist/ui/src/components/edyn/progress-line/progress-line.d.ts +23 -0
- package/dist/ui/src/components/edyn/progress-line/progress-line.test.d.ts +9 -0
- package/dist/ui/src/components/edyn/rich-text-content/allow-list.d.ts +11 -0
- package/dist/ui/src/components/edyn/rich-text-content/index.d.ts +2 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.d.ts +22 -0
- package/dist/ui/src/components/edyn/rich-text-content/rich-text-content.test.d.ts +8 -0
- package/dist/ui/src/components/edyn/rich-text-editor/extensions.d.ts +18 -0
- package/dist/ui/src/components/edyn/rich-text-editor/index.d.ts +3 -0
- package/dist/ui/src/components/edyn/rich-text-editor/mention-list.d.ts +17 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.d.ts +53 -0
- package/dist/ui/src/components/edyn/rich-text-editor/rich-text-editor.test.d.ts +6 -0
- package/dist/ui/src/components/edyn/rich-text-editor/serialize.d.ts +13 -0
- package/dist/ui/src/components/edyn/rich-text-editor/sync.d.ts +19 -0
- package/dist/ui/src/components/edyn/rich-text-editor/sync.test.d.ts +11 -0
- package/dist/ui/src/components/edyn/rich-text-editor/toolbar.d.ts +20 -0
- package/dist/ui/src/components/edyn/rich-text-editor/types.d.ts +68 -0
- package/dist/ui/src/components/edyn/video-player/video-player.d.ts +2 -2
- package/dist/ui/src/components/forwarded-props.test.d.ts +8 -0
- package/dist/ui/src/components/ui/accordion/accordion.d.ts +9 -8
- package/dist/ui/src/components/ui/attachment/attachment.d.ts +1 -1
- package/dist/ui/src/components/ui/badge/badge.d.ts +1 -1
- package/dist/ui/src/components/ui/button/button.behavior.test.d.ts +8 -0
- package/dist/ui/src/components/ui/button/button.d.ts +1 -1
- package/dist/ui/src/components/ui/command/command.d.ts +17 -1
- package/dist/ui/src/components/ui/dropdown-menu/dropdown-menu.d.ts +12 -1
- package/dist/ui/src/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/ui/src/components/ui/item/item.d.ts +1 -1
- package/dist/ui/src/components/ui/pagination/pagination.d.ts +3 -2
- package/dist/ui/src/components/ui/popover/popover.d.ts +1 -1
- package/dist/ui/src/components/ui/progress/progress.behavior.test.d.ts +8 -0
- package/dist/ui/src/components/ui/progress/progress.d.ts +43 -1
- package/dist/ui/src/components/ui/scroll-area/scroll-area.behavior.test.d.ts +12 -0
- package/dist/ui/src/components/ui/scroll-area/scroll-area.d.ts +59 -6
- package/dist/ui/src/components/ui/separator/separator.behavior.test.d.ts +14 -0
- package/dist/ui/src/components/ui/separator/separator.d.ts +14 -0
- package/dist/ui/src/components/ui/table/table.behavior.test.d.ts +4 -5
- package/dist/ui/src/components/ui/table/table.d.ts +8 -1
- package/dist/ui/src/components/ui/tabs/tabs.d.ts +9 -8
- package/dist/ui/src/index.d.ts +6 -0
- package/dist/ui/src/lib/first-weekday.d.ts +6 -0
- package/dist/ui/src/lib/focus-ring.test.d.ts +8 -0
- package/dist/ui/src/lib/popup-list.d.ts +53 -0
- package/dist/ui/src/lib/popup-list.test.d.ts +10 -0
- package/package.json +32 -8
- package/dist/chunks/toggle-group-ByNq8g7H.js +0 -4263
- package/dist/chunks/toggle-group-ByNq8g7H.js.map +0 -1
- package/dist/dom/src/context.d.ts +0 -34
- package/dist/dom/src/define-element.d.ts +0 -11
- package/dist/dom/src/field-control.d.ts +0 -5
- package/dist/dom/src/index.d.ts +0 -6
- package/dist/dom/src/mode.d.ts +0 -8
- package/dist/dom/src/styles.d.ts +0 -6
- package/dist/dom/src/theme-state.d.ts +0 -1
- package/dist/dom/src/types.d.ts +0 -65
- package/dist/ds/src/elements.d.ts +0 -12
- package/dist/elements/src/edx-accordion.d.ts +0 -14
- package/dist/elements/src/edx-accordion.test.d.ts +0 -1
- package/dist/elements/src/edx-alert.d.ts +0 -14
- package/dist/elements/src/edx-audio-player.d.ts +0 -11
- package/dist/elements/src/edx-avatar.d.ts +0 -10
- package/dist/elements/src/edx-badge.d.ts +0 -12
- package/dist/elements/src/edx-breadcrumb.d.ts +0 -11
- package/dist/elements/src/edx-button-group.d.ts +0 -7
- package/dist/elements/src/edx-button.d.ts +0 -20
- package/dist/elements/src/edx-calendar.d.ts +0 -21
- package/dist/elements/src/edx-card.d.ts +0 -8
- package/dist/elements/src/edx-checkbox.d.ts +0 -18
- package/dist/elements/src/edx-combobox.d.ts +0 -28
- package/dist/elements/src/edx-content-components.d.ts +0 -2
- package/dist/elements/src/edx-dialog.d.ts +0 -20
- package/dist/elements/src/edx-drawer.d.ts +0 -21
- package/dist/elements/src/edx-dropdown-menu.d.ts +0 -29
- package/dist/elements/src/edx-field.d.ts +0 -9
- package/dist/elements/src/edx-field.test.d.ts +0 -1
- package/dist/elements/src/edx-indicator.d.ts +0 -14
- package/dist/elements/src/edx-input-group.d.ts +0 -32
- package/dist/elements/src/edx-input-otp.d.ts +0 -19
- package/dist/elements/src/edx-input.d.ts +0 -31
- package/dist/elements/src/edx-interactive-components.d.ts +0 -2
- package/dist/elements/src/edx-label.d.ts +0 -6
- package/dist/elements/src/edx-pagination.d.ts +0 -8
- package/dist/elements/src/edx-popover.d.ts +0 -24
- package/dist/elements/src/edx-progress.d.ts +0 -10
- package/dist/elements/src/edx-radio-group.d.ts +0 -22
- package/dist/elements/src/edx-radio-group.test.d.ts +0 -1
- package/dist/elements/src/edx-scroll-area.d.ts +0 -15
- package/dist/elements/src/edx-scroll-area.test.d.ts +0 -1
- package/dist/elements/src/edx-select.d.ts +0 -34
- package/dist/elements/src/edx-separator.d.ts +0 -10
- package/dist/elements/src/edx-skeleton.d.ts +0 -8
- package/dist/elements/src/edx-slider.d.ts +0 -17
- package/dist/elements/src/edx-slider.test.d.ts +0 -1
- package/dist/elements/src/edx-switch.d.ts +0 -18
- package/dist/elements/src/edx-table.d.ts +0 -13
- package/dist/elements/src/edx-table.test.d.ts +0 -1
- package/dist/elements/src/edx-tabs.d.ts +0 -15
- package/dist/elements/src/edx-tabs.test.d.ts +0 -1
- package/dist/elements/src/edx-textarea.d.ts +0 -25
- package/dist/elements/src/edx-toggle-group.d.ts +0 -27
- package/dist/elements/src/edx-toggle-group.test.d.ts +0 -1
- package/dist/elements/src/edx-toggle.d.ts +0 -18
- package/dist/elements/src/edx-tooltip.d.ts +0 -28
- package/dist/elements/src/edx-video-player.d.ts +0 -16
- package/dist/elements/src/field-control-bridge.d.ts +0 -7
- package/dist/elements/src/index.d.ts +0 -14
- package/dist/elements/src/projected-content.test.d.ts +0 -1
- package/dist/elements/src/registry.d.ts +0 -39
- package/dist/elements/src/registry.test.d.ts +0 -1
- package/dist/elements.js +0 -4020
- package/dist/elements.js.map +0 -1
- /package/dist/{dom/src/define-element.test.d.ts → ui/src/components/edyn/date-picker/date-text.test.d.ts} +0 -0
- /package/dist/{dom/src/native-slot.test.d.ts → ui/src/lib/first-weekday.test.d.ts} +0 -0
package/dist/theme.css
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @exsto/ds design tokens and their Tailwind mapping, uncompiled.
|
|
3
|
+
*
|
|
4
|
+
* Import this when you want the design system vocabulary (bg-card,
|
|
5
|
+
* text-muted-foreground, rounded-lg, font-sans, text-2xs, ...) in your OWN
|
|
6
|
+
* markup. styles.css styles the components; this gives your Tailwind build the
|
|
7
|
+
* tokens behind them.
|
|
8
|
+
*
|
|
9
|
+
* ORDER, for a consumer who runs Tailwind:
|
|
10
|
+
*
|
|
11
|
+
* @import "@exsto/ds/styles.css";
|
|
12
|
+
* @import "tailwindcss";
|
|
13
|
+
* @import "@exsto/ds/theme.css";
|
|
14
|
+
*
|
|
15
|
+
* The @source line below is what makes that order enough. styles.css is a
|
|
16
|
+
* compiled Tailwind build, so its utilities share the utilities layer with the
|
|
17
|
+
* ones your build emits, and between two rules of equal weight the later one
|
|
18
|
+
* wins. Two separate builds cannot agree on a single order: ours put .hidden
|
|
19
|
+
* after your .md:block, and a sidebar marked `hidden md:block` stayed hidden at
|
|
20
|
+
* every width. The line points your build at the components' shipped code, so
|
|
21
|
+
* your build emits their utilities as well, each responsive variant after its
|
|
22
|
+
* own base, in one consistent order that lands last.
|
|
23
|
+
*
|
|
24
|
+
* Importing styles.css after your Tailwind entry puts its compiled utilities
|
|
25
|
+
* last instead, and they then outrank yours. Keep it first.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
@source "./**/*.js";
|
|
29
|
+
|
|
30
|
+
@custom-variant dark (&:is(.dark *));
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* Brand layer.
|
|
34
|
+
*
|
|
35
|
+
* The colour ramps come from Tailwind v4 unchanged. The design system is built on
|
|
36
|
+
* the stock palette so the Figma library (Tailwind v4 + shadcn, style Nova) and the
|
|
37
|
+
* code cannot drift apart: there is no value here to keep in sync, because nothing
|
|
38
|
+
* here redefines a colour. The exact shadcn neutral semantic theme lives in
|
|
39
|
+
* tokens.css.
|
|
40
|
+
*
|
|
41
|
+
* The legacy Exsto palette this file used to carry was dropped when the design team
|
|
42
|
+
* moved to Tailwind defaults. It is in git history if a legacy surface ever needs it.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
@theme {
|
|
46
|
+
/* Inter is the typeface for the whole system. */
|
|
47
|
+
--font-sans: 'Inter', sans-serif;
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
* The one step Tailwind's type scale does not have: a 10/14 footnote, used by
|
|
51
|
+
* badges, chips and dense table headers. Everything else is stock.
|
|
52
|
+
*/
|
|
53
|
+
--text-2xs: 10px;
|
|
54
|
+
--text-2xs--line-height: 14px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@layer base {
|
|
58
|
+
:root {
|
|
59
|
+
color-scheme: light;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:root.dark,
|
|
63
|
+
.dark {
|
|
64
|
+
color-scheme: dark;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Current shadcn Base Nova neutral theme. Product branding belongs in a separate layer. */
|
|
69
|
+
/* Base Nova deliberately uses the same black/10 backdrop in both modes; component-level backdrop blur supplies the remaining separation. */
|
|
70
|
+
|
|
71
|
+
:root {
|
|
72
|
+
--radius: 0.625rem;
|
|
73
|
+
|
|
74
|
+
--background: oklch(1 0 0);
|
|
75
|
+
--foreground: oklch(0.145 0 0);
|
|
76
|
+
|
|
77
|
+
--card: oklch(1 0 0);
|
|
78
|
+
--card-foreground: oklch(0.145 0 0);
|
|
79
|
+
|
|
80
|
+
--popover: oklch(1 0 0);
|
|
81
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
82
|
+
--overlay: oklch(0 0 0 / 10%);
|
|
83
|
+
|
|
84
|
+
--primary: oklch(0.205 0 0);
|
|
85
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
86
|
+
|
|
87
|
+
--secondary: oklch(0.97 0 0);
|
|
88
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
89
|
+
|
|
90
|
+
--muted: oklch(0.97 0 0);
|
|
91
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
92
|
+
|
|
93
|
+
--accent: oklch(0.97 0 0);
|
|
94
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
95
|
+
|
|
96
|
+
--destructive: oklch(0.505 0.213 27.518);
|
|
97
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
98
|
+
|
|
99
|
+
--success: oklch(0.448 0.119 151.328);
|
|
100
|
+
--success-foreground: oklch(0.979 0.021 166.113);
|
|
101
|
+
--success-ring: oklch(0.905 0.093 164.15);
|
|
102
|
+
|
|
103
|
+
--warning: oklch(0.473 0.137 46.201);
|
|
104
|
+
--warning-foreground: oklch(0.987 0.022 95.277);
|
|
105
|
+
--warning-ring: oklch(0.924 0.12 95.746);
|
|
106
|
+
|
|
107
|
+
--info: oklch(0.5 0.134 242.749);
|
|
108
|
+
--info-foreground: oklch(0.977 0.013 236.62);
|
|
109
|
+
--info-ring: oklch(0.901 0.058 230.902);
|
|
110
|
+
|
|
111
|
+
--border: oklch(0.922 0 0);
|
|
112
|
+
--input: oklch(0.922 0 0);
|
|
113
|
+
--ring: oklch(0.6 0 0);
|
|
114
|
+
|
|
115
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
116
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
117
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
118
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
119
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
120
|
+
|
|
121
|
+
--sidebar: oklch(0.985 0 0);
|
|
122
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
123
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
124
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
125
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
126
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
127
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
128
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
129
|
+
|
|
130
|
+
/*
|
|
131
|
+
* Avatar palette: twelve hues, each a pair at an even perceived lightness, a
|
|
132
|
+
* soft tint with strong text of the same hue in the light theme and a deep tint
|
|
133
|
+
* with light text in the dark one. No yellows, olives or browns: they turn muddy.
|
|
134
|
+
* InitialsAvatar picks one by hashing the initials; every pair clears 4.5:1
|
|
135
|
+
* (packages/ui/src/components/edyn/initials-avatar/initials-avatar.test.tsx checks it).
|
|
136
|
+
*/
|
|
137
|
+
--avatar-1-bg: oklch(0.93 0.045 259); /* blue */
|
|
138
|
+
--avatar-1-fg: oklch(0.45 0.15 259);
|
|
139
|
+
--avatar-2-bg: oklch(0.93 0.045 277); /* indigo */
|
|
140
|
+
--avatar-2-fg: oklch(0.45 0.15 277);
|
|
141
|
+
--avatar-3-bg: oklch(0.93 0.045 293); /* violet */
|
|
142
|
+
--avatar-3-fg: oklch(0.45 0.15 293);
|
|
143
|
+
--avatar-4-bg: oklch(0.93 0.045 322); /* fuchsia */
|
|
144
|
+
--avatar-4-fg: oklch(0.45 0.15 322);
|
|
145
|
+
--avatar-5-bg: oklch(0.93 0.045 354); /* pink */
|
|
146
|
+
--avatar-5-fg: oklch(0.45 0.15 354);
|
|
147
|
+
--avatar-6-bg: oklch(0.93 0.045 16); /* rose */
|
|
148
|
+
--avatar-6-fg: oklch(0.45 0.15 16);
|
|
149
|
+
--avatar-7-bg: oklch(0.93 0.045 27); /* red */
|
|
150
|
+
--avatar-7-fg: oklch(0.45 0.15 27);
|
|
151
|
+
--avatar-8-bg: oklch(0.93 0.045 47); /* orange */
|
|
152
|
+
--avatar-8-fg: oklch(0.45 0.15 47);
|
|
153
|
+
--avatar-9-bg: oklch(0.93 0.045 163); /* emerald */
|
|
154
|
+
--avatar-9-fg: oklch(0.45 0.15 163);
|
|
155
|
+
--avatar-10-bg: oklch(0.93 0.045 183); /* teal */
|
|
156
|
+
--avatar-10-fg: oklch(0.45 0.15 183);
|
|
157
|
+
--avatar-11-bg: oklch(0.93 0.045 215); /* cyan */
|
|
158
|
+
--avatar-11-fg: oklch(0.45 0.15 215);
|
|
159
|
+
--avatar-12-bg: oklch(0.93 0.045 237); /* sky */
|
|
160
|
+
--avatar-12-fg: oklch(0.45 0.15 237);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.dark {
|
|
164
|
+
--background: oklch(0.145 0 0);
|
|
165
|
+
--foreground: oklch(0.985 0 0);
|
|
166
|
+
|
|
167
|
+
--card: oklch(0.205 0 0);
|
|
168
|
+
--card-foreground: oklch(0.985 0 0);
|
|
169
|
+
|
|
170
|
+
--popover: oklch(0.205 0 0);
|
|
171
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
172
|
+
--overlay: oklch(0 0 0 / 10%);
|
|
173
|
+
|
|
174
|
+
--primary: oklch(0.922 0 0);
|
|
175
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
176
|
+
|
|
177
|
+
--secondary: oklch(0.269 0 0);
|
|
178
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
179
|
+
|
|
180
|
+
--muted: oklch(0.269 0 0);
|
|
181
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
182
|
+
|
|
183
|
+
--accent: oklch(0.269 0 0);
|
|
184
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
185
|
+
|
|
186
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
187
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
188
|
+
|
|
189
|
+
--success: oklch(0.792 0.209 151.711);
|
|
190
|
+
--success-foreground: oklch(0.262 0.051 172.552);
|
|
191
|
+
--success-ring: oklch(0.432 0.095 166.913);
|
|
192
|
+
|
|
193
|
+
--warning: oklch(0.879 0.169 91.605);
|
|
194
|
+
--warning-foreground: oklch(0.279 0.077 45.635);
|
|
195
|
+
--warning-ring: oklch(0.473 0.137 46.201);
|
|
196
|
+
|
|
197
|
+
--info: oklch(0.828 0.111 230.318);
|
|
198
|
+
--info-foreground: oklch(0.293 0.066 243.157);
|
|
199
|
+
--info-ring: oklch(0.443 0.11 240.79);
|
|
200
|
+
|
|
201
|
+
--border: oklch(1 0 0 / 10%);
|
|
202
|
+
--input: oklch(1 0 0 / 15%);
|
|
203
|
+
--ring: oklch(0.556 0 0);
|
|
204
|
+
|
|
205
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
206
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
207
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
208
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
209
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
210
|
+
|
|
211
|
+
--sidebar: oklch(0.205 0 0);
|
|
212
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
213
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
214
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
215
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
216
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
217
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
218
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
219
|
+
|
|
220
|
+
--avatar-1-bg: oklch(0.32 0.07 259); /* blue */
|
|
221
|
+
--avatar-1-fg: oklch(0.86 0.09 259);
|
|
222
|
+
--avatar-2-bg: oklch(0.32 0.07 277); /* indigo */
|
|
223
|
+
--avatar-2-fg: oklch(0.86 0.09 277);
|
|
224
|
+
--avatar-3-bg: oklch(0.32 0.07 293); /* violet */
|
|
225
|
+
--avatar-3-fg: oklch(0.86 0.09 293);
|
|
226
|
+
--avatar-4-bg: oklch(0.32 0.07 322); /* fuchsia */
|
|
227
|
+
--avatar-4-fg: oklch(0.86 0.09 322);
|
|
228
|
+
--avatar-5-bg: oklch(0.32 0.07 354); /* pink */
|
|
229
|
+
--avatar-5-fg: oklch(0.86 0.09 354);
|
|
230
|
+
--avatar-6-bg: oklch(0.32 0.07 16); /* rose */
|
|
231
|
+
--avatar-6-fg: oklch(0.86 0.09 16);
|
|
232
|
+
--avatar-7-bg: oklch(0.32 0.07 27); /* red */
|
|
233
|
+
--avatar-7-fg: oklch(0.86 0.09 27);
|
|
234
|
+
--avatar-8-bg: oklch(0.32 0.07 47); /* orange */
|
|
235
|
+
--avatar-8-fg: oklch(0.86 0.09 47);
|
|
236
|
+
--avatar-9-bg: oklch(0.32 0.07 163); /* emerald */
|
|
237
|
+
--avatar-9-fg: oklch(0.86 0.09 163);
|
|
238
|
+
--avatar-10-bg: oklch(0.32 0.07 183); /* teal */
|
|
239
|
+
--avatar-10-fg: oklch(0.86 0.09 183);
|
|
240
|
+
--avatar-11-bg: oklch(0.32 0.07 215); /* cyan */
|
|
241
|
+
--avatar-11-fg: oklch(0.86 0.09 215);
|
|
242
|
+
--avatar-12-bg: oklch(0.32 0.07 237); /* sky */
|
|
243
|
+
--avatar-12-fg: oklch(0.86 0.09 237);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@theme inline {
|
|
247
|
+
--radius-sm: calc(var(--radius) * 0.6);
|
|
248
|
+
--radius-md: calc(var(--radius) * 0.8);
|
|
249
|
+
--radius-lg: var(--radius);
|
|
250
|
+
--radius-xl: calc(var(--radius) * 1.4);
|
|
251
|
+
--radius-2xl: calc(var(--radius) * 1.8);
|
|
252
|
+
--radius-3xl: calc(var(--radius) * 2.2);
|
|
253
|
+
--radius-4xl: calc(var(--radius) * 2.6);
|
|
254
|
+
--color-background: var(--background);
|
|
255
|
+
--color-foreground: var(--foreground);
|
|
256
|
+
--color-card: var(--card);
|
|
257
|
+
--color-card-foreground: var(--card-foreground);
|
|
258
|
+
--color-popover: var(--popover);
|
|
259
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
260
|
+
--color-overlay: var(--overlay);
|
|
261
|
+
--color-primary: var(--primary);
|
|
262
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
263
|
+
--color-secondary: var(--secondary);
|
|
264
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
265
|
+
--color-muted: var(--muted);
|
|
266
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
267
|
+
--color-accent: var(--accent);
|
|
268
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
269
|
+
--color-destructive: var(--destructive);
|
|
270
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
271
|
+
--color-success: var(--success);
|
|
272
|
+
--color-success-foreground: var(--success-foreground);
|
|
273
|
+
--color-success-ring: var(--success-ring);
|
|
274
|
+
--color-warning: var(--warning);
|
|
275
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
276
|
+
--color-warning-ring: var(--warning-ring);
|
|
277
|
+
--color-info: var(--info);
|
|
278
|
+
--color-info-foreground: var(--info-foreground);
|
|
279
|
+
--color-info-ring: var(--info-ring);
|
|
280
|
+
--color-border: var(--border);
|
|
281
|
+
--color-input: var(--input);
|
|
282
|
+
--color-ring: var(--ring);
|
|
283
|
+
--color-chart-1: var(--chart-1);
|
|
284
|
+
--color-chart-2: var(--chart-2);
|
|
285
|
+
--color-chart-3: var(--chart-3);
|
|
286
|
+
--color-chart-4: var(--chart-4);
|
|
287
|
+
--color-chart-5: var(--chart-5);
|
|
288
|
+
--color-sidebar: var(--sidebar);
|
|
289
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
290
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
291
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
292
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
293
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
294
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
295
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Indeterminate progress: a one-third-width bar sweeping the track.
|
|
299
|
+
Percentages are relative to the indicator's own width (w-1/3 of the track),
|
|
300
|
+
so -100% starts fully off the left edge and 300% exits the right edge. */
|
|
301
|
+
@keyframes progress-indeterminate {
|
|
302
|
+
from {
|
|
303
|
+
translate: -100% 0;
|
|
304
|
+
}
|
|
305
|
+
to {
|
|
306
|
+
translate: 300% 0;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, RefObject } from 'react';
|
|
2
|
+
/** Thousands separated, rounded to a whole number: the default way a count reads. */
|
|
3
|
+
export declare const formatCount: (value: number) => string;
|
|
4
|
+
/**
|
|
5
|
+
* The values to show for `targets` this frame, all on one clock and one curve, so a
|
|
6
|
+
* count and its bar move together. They start from 0 and move once `element` has
|
|
7
|
+
* been on screen.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useAnimatedValues: (targets: number[], element: RefObject<Element | null>) => number[];
|
|
10
|
+
export interface IAnimatedNumberProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'className'> {
|
|
11
|
+
value: number;
|
|
12
|
+
/** What it shows while it moves and once there (formatCount by default; a percentage formatter for shares). */
|
|
13
|
+
format?: (value: number) => string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A number that moves to its new value. Its width holds the widest of where it starts
|
|
18
|
+
* and where it lands, in tabular figures, so nothing beside it moves while the digits
|
|
19
|
+
* change. Assistive technology reads only the final value.
|
|
20
|
+
*/
|
|
21
|
+
export declare const AnimatedNumber: ({ value, format, className, ...props }: IAnimatedNumberProps) => import('react').JSX.Element;
|
|
22
|
+
export interface INumberTextProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'className'> {
|
|
23
|
+
element?: RefObject<HTMLSpanElement | null>;
|
|
24
|
+
shown: number;
|
|
25
|
+
value: number;
|
|
26
|
+
format?: (value: number) => string;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
/** The text of a moving number: what it shows now, held at its widest, with the final value for assistive technology. */
|
|
30
|
+
export declare const NumberText: ({ element, shown, value, format, className, ...props }: INumberTextProps) => import('react').JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnimatedNumber: a number that moves to its new value, announced once.
|
|
3
|
+
*
|
|
4
|
+
* PATH TAKEN: the formatting, the markup and the reduced-motion and no-change
|
|
5
|
+
* paths are plain logic and run in happy-dom. The motion itself (a number really
|
|
6
|
+
* passing through values, a width that holds) needs a real clock and layout, so
|
|
7
|
+
* e2e/animated-number.spec.ts measures it in the browser.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './animated-number';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TCssLength } from '../../../lib/utils';
|
|
2
|
-
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
export interface IAudioPlayerProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'className' | 'onPlay' | 'onPause' | 'onEnded' | 'onTimeUpdate' | 'role'> {
|
|
3
4
|
/** Audio source URL. */
|
|
4
5
|
src?: string;
|
|
5
6
|
/** Start muted. The volume control still works from here. */
|
|
@@ -26,4 +27,4 @@ export interface IAudioPlayerProps {
|
|
|
26
27
|
* time, a seekable timeline, and volume. Four elements in one rounded row, per
|
|
27
28
|
* the design-system anatomy.
|
|
28
29
|
*/
|
|
29
|
-
export declare const AudioPlayer: ({ src, muted, loop, disabled, width, className, "aria-label": ariaLabel, onPlay, onPause, onEnded, onTimeUpdate, }: IAudioPlayerProps) => import('react').JSX.Element;
|
|
30
|
+
export declare const AudioPlayer: ({ src, muted, loop, disabled, width, className, "aria-label": ariaLabel, style, onPlay, onPause, onEnded, onTimeUpdate, ...props }: IAudioPlayerProps) => import('react').JSX.Element;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Locale } from 'react-day-picker';
|
|
2
|
+
import { TDisabledDays } from './date-text';
|
|
3
|
+
/** Every word the component prints, so a product can translate it. */
|
|
4
|
+
export interface IDatePickerLabels {
|
|
5
|
+
/** The calendar button's accessible name. */
|
|
6
|
+
choose: string;
|
|
7
|
+
/** Said when the text is not a date; `pattern` is what to type, written the locale's way (`DD/MM/YYYY`). */
|
|
8
|
+
format: (pattern: string) => string;
|
|
9
|
+
notReal: string;
|
|
10
|
+
/** `min` and `max` are written the locale's way. */
|
|
11
|
+
beforeMin: (min: string) => string;
|
|
12
|
+
afterMax: (max: string) => string;
|
|
13
|
+
unavailable: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const DEFAULT_DATE_PICKER_LABELS: IDatePickerLabels;
|
|
16
|
+
/**
|
|
17
|
+
* What the field holds when it reports, so a parent can tell three things apart that all arrive as `undefined`:
|
|
18
|
+
* - `day`: a usable day, typed or picked.
|
|
19
|
+
* - `empty`: the field was emptied, or nothing has been put in it. A required field is right to ask for a date.
|
|
20
|
+
* - `refused`: the field holds text it will not take (not a day, not a real one, or outside `min`, `max` or
|
|
21
|
+
* `disabledDates`). `text` is what was typed and `problem` the message the picker shows under the field, already
|
|
22
|
+
* in the picker's `labels`. The picker is saying so itself, so the page should not add a second message.
|
|
23
|
+
*/
|
|
24
|
+
export type TDatePickerState = {
|
|
25
|
+
kind: 'day';
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'empty';
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'refused';
|
|
30
|
+
text: string;
|
|
31
|
+
problem: string;
|
|
32
|
+
};
|
|
33
|
+
export interface IDatePickerProps {
|
|
34
|
+
/** For a Label's htmlFor; inside a Field the Field's label is already wired. */
|
|
35
|
+
id?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The chosen day as `yyyy-mm-dd`, or `undefined` for none (an empty string counts as none, so a value kept for an
|
|
38
|
+
* `<input type="date">` drops in). A string and not a Date, on purpose: a Date is an instant, and the instant for
|
|
39
|
+
* "5 March" is another calendar day in another time zone, so a Date serialised for an API drifts a day. The text is
|
|
40
|
+
* what `<input type="date">`, JSON and a .NET `DateOnly` use, and it compares as a day.
|
|
41
|
+
*/
|
|
42
|
+
value: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Called with a valid day, or with `undefined` when the field is emptied or its text is not a usable day. The second
|
|
45
|
+
* argument says which of the two it was (see `TDatePickerState`); a caller that has no use for it can ignore it.
|
|
46
|
+
* Text that is refused is reported each time it changes, also when the field held no day before, so a form that
|
|
47
|
+
* tracks the state hears about it. Emptying the field after that reports `empty`.
|
|
48
|
+
*/
|
|
49
|
+
onValueChange: (value: string | undefined, state: TDatePickerState) => void;
|
|
50
|
+
/** The earliest and latest day that can be chosen, as `yyyy-mm-dd`, both included. */
|
|
51
|
+
min?: string;
|
|
52
|
+
max?: string;
|
|
53
|
+
/** Days that cannot be chosen: a list of `yyyy-mm-dd`, or a function that says so for one (weekends, say). */
|
|
54
|
+
disabledDates?: TDisabledDays;
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/** How a day is written and in which order it is typed (BCP 47); en-GB reads 05/03/2026. */
|
|
57
|
+
locale?: string;
|
|
58
|
+
/** The calendar's own words (month and weekday names), as a date-fns locale; English by default. The first weekday follows `locale`. */
|
|
59
|
+
calendarLocale?: Locale;
|
|
60
|
+
/** What the empty field shows; the pattern for the locale (`DD/MM/YYYY`) by default. */
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
/** An accessible name, when there is no visible label to point at. */
|
|
63
|
+
'aria-label'?: string;
|
|
64
|
+
/** Marks the field invalid (the kit's destructive border), as a Field's invalid state does. */
|
|
65
|
+
'aria-invalid'?: boolean | 'true' | 'false';
|
|
66
|
+
/** The id of the text that explains it. Added to what a Field names already, and to the picker's own error. */
|
|
67
|
+
'aria-describedby'?: string;
|
|
68
|
+
labels?: Partial<IDatePickerLabels>;
|
|
69
|
+
/** Layout only (a width); the look is the kit's. */
|
|
70
|
+
className?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* One calendar day, typed or picked. The field takes the day in the locale's order (05/03/2026 in en-GB) and reads it
|
|
74
|
+
* when it loses focus, saying inline what is wrong with it; the button, or Alt+ArrowDown in the field, opens a calendar.
|
|
75
|
+
*/
|
|
76
|
+
export declare const DatePicker: ({ id, value, onValueChange, min, max, disabledDates, disabled, locale, calendarLocale, placeholder, "aria-label": ariaLabel, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, labels: labelOverrides, className, }: IDatePickerProps) => import('react').JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a DatePicker tells the page. `undefined` alone cannot say whether the field was emptied or holds text the picker
|
|
3
|
+
* refused, so a required field would add "Enter the date" under the picker's own message. The second argument of
|
|
4
|
+
* `onValueChange` says which, and these tests hold it.
|
|
5
|
+
*
|
|
6
|
+
* PATH TAKEN: the report and the attributes do not depend on layout, so happy-dom is enough. The Playwright spec
|
|
7
|
+
* (`e2e/date-picker.spec.ts`) covers it again in a browser, through a required Field.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reading and writing a calendar day as the text a person types.
|
|
3
|
+
*
|
|
4
|
+
* A day is the string `yyyy-mm-dd` everywhere here, never a Date: a Date is an instant, and the instant for "5 March" is a
|
|
5
|
+
* different calendar day in another time zone (local midnight serialised as UTC lands on the 4th east of Greenwich). The
|
|
6
|
+
* string is also what `<input type="date">`, JSON and a .NET `DateOnly` use. Strings of that shape sort and compare as
|
|
7
|
+
* days, so min, max and disabled days are compared as plain strings with no Date involved.
|
|
8
|
+
*/
|
|
9
|
+
export type TDatePart = 'day' | 'month' | 'year';
|
|
10
|
+
/** Why a typed text is not a day the picker can use. */
|
|
11
|
+
export type TDateProblem = 'format' | 'notReal' | 'beforeMin' | 'afterMax' | 'unavailable';
|
|
12
|
+
export type TParsedDay = {
|
|
13
|
+
kind: 'empty';
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'day';
|
|
16
|
+
day: string;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'problem';
|
|
19
|
+
problem: 'format' | 'notReal';
|
|
20
|
+
};
|
|
21
|
+
/** The order a locale writes day, month and year in: en-GB is day, month, year; en-US month, day, year; sv year first. */
|
|
22
|
+
export declare const datePartsOf: (locale: string) => TDatePart[];
|
|
23
|
+
/** What to type, written the locale's way: `DD/MM/YYYY` for en-GB. */
|
|
24
|
+
export declare const datePatternOf: (locale: string) => string;
|
|
25
|
+
/** A day written the locale's way: `05/03/2026` for en-GB. */
|
|
26
|
+
export declare const formatDay: (day: string, locale: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Reads typed text as a day. The locale's order decides which number is the day; a first number of four digits is always
|
|
29
|
+
* a year (so `2026-03-05` is read the same everywhere); the separator can be anything that is not a digit, and eight
|
|
30
|
+
* digits with none (`05032026`) are split by the order. A year must have four digits: `5/3/26` is refused, not guessed.
|
|
31
|
+
*/
|
|
32
|
+
export declare const parseDateText: (text: string, locale: string) => TParsedDay;
|
|
33
|
+
export type TDisabledDays = readonly string[] | ((day: string) => boolean);
|
|
34
|
+
export interface IDayLimits {
|
|
35
|
+
min?: string;
|
|
36
|
+
max?: string;
|
|
37
|
+
disabledDates?: TDisabledDays;
|
|
38
|
+
}
|
|
39
|
+
/** Whether a day is allowed, and if not, which limit it breaks. */
|
|
40
|
+
export declare const dayProblem: (day: string, { min, max, disabledDates }: IDayLimits) => TDateProblem | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/** A range of calendar days as yyyy-mm-dd, either end optional. */
|
|
3
|
+
export type TDateRange = {
|
|
4
|
+
from?: string;
|
|
5
|
+
to?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const dayToDate: (value: string | undefined) => Date | undefined;
|
|
8
|
+
export declare const dateToDay: (date: Date | undefined) => string | undefined;
|
|
9
|
+
/** Anything else a button takes (data-*, aria-*, title) goes to the trigger. */
|
|
10
|
+
export interface IDateRangePickerProps extends Omit<ComponentPropsWithoutRef<'button'>, 'value' | 'defaultValue' | 'placeholder' | 'id' | 'className' | 'children' | 'onChange' | 'type'> {
|
|
11
|
+
id?: string;
|
|
12
|
+
value: TDateRange;
|
|
13
|
+
onValueChange: (value: TDateRange) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/**
|
|
16
|
+
* What the trigger says once a range is set. `range` (default) writes the ends; `label` keeps the label, so a
|
|
17
|
+
* range the page shows elsewhere (as a removable chip, say) is not repeated here. In both, the trigger carries
|
|
18
|
+
* `data-set` while either end is set, for a look of its own.
|
|
19
|
+
*/
|
|
20
|
+
summary?: 'range' | 'label';
|
|
21
|
+
/** How the ends are written on the trigger, and which weekday the calendar starts on (BCP 47); en-GB reads 05 Mar 2026 and starts on Monday. */
|
|
22
|
+
locale?: string;
|
|
23
|
+
/** An accessible name for the trigger, when there is no visible label to point at. */
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/** A range of calendar days, either end optional; two months side by side, one on a phone. */
|
|
28
|
+
export declare const DateRangePicker: ({ id, value, onValueChange, placeholder, locale, summary, "aria-label": ariaLabel, className, ...props }: IDateRangePickerProps) => import('react').JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DateRangePicker: the day arithmetic and the trigger's text.
|
|
3
|
+
*
|
|
4
|
+
* PATH TAKEN: converting a calendar day to a Date and back, and how the ends are
|
|
5
|
+
* written, are plain logic and run in happy-dom. Opening the calendar, picking two
|
|
6
|
+
* days and the one-month layout on a phone need a real browser and layout, so
|
|
7
|
+
* e2e/date-range-picker.spec.ts covers those.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './date-range-picker';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './initials-avatar';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
/** How many colour pairs the theme defines (--avatar-1-bg, --avatar-1-fg ... in @edyn/theme tokens.css). */
|
|
3
|
+
export declare const AVATAR_TONES = 12;
|
|
4
|
+
/**
|
|
5
|
+
* The palette entry the text gets, from 1: the same text always gets the same one.
|
|
6
|
+
* FNV-1a, because a plain multiply-and-add hash puts two letters on a few entries
|
|
7
|
+
* only (it reduces to 7 x first + second, modulo 12).
|
|
8
|
+
*/
|
|
9
|
+
export declare const avatarTone: (text: string) => number;
|
|
10
|
+
/** Up to two initials, upper-cased: the first letter of the first two words. */
|
|
11
|
+
export declare const initialsOf: (name: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* The circle and its letters together, so the initials always fit. The font size
|
|
14
|
+
* is inline rather than a class on purpose: 9px and 15px are not on Tailwind's
|
|
15
|
+
* type scale, a custom `text-*` token would be read by tailwind-merge as a colour
|
|
16
|
+
* and could drop the wrong class, and an inline size cannot be fought by the
|
|
17
|
+
* fallback's own `text-sm`.
|
|
18
|
+
*/
|
|
19
|
+
declare const SIZES: {
|
|
20
|
+
readonly xs: {
|
|
21
|
+
readonly box: "size-5";
|
|
22
|
+
readonly fontSize: 9;
|
|
23
|
+
};
|
|
24
|
+
readonly sm: {
|
|
25
|
+
readonly box: "size-6";
|
|
26
|
+
readonly fontSize: 10;
|
|
27
|
+
};
|
|
28
|
+
readonly md: {
|
|
29
|
+
readonly box: "size-8";
|
|
30
|
+
readonly fontSize: 12;
|
|
31
|
+
};
|
|
32
|
+
readonly lg: {
|
|
33
|
+
readonly box: "size-10";
|
|
34
|
+
readonly fontSize: 15;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export type TInitialsAvatarSize = keyof typeof SIZES;
|
|
38
|
+
export interface IInitialsAvatarProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children' | 'className' | 'role'> {
|
|
39
|
+
name: string;
|
|
40
|
+
photoUrl?: string | null;
|
|
41
|
+
/** xs 20px, sm 24px in table rows, md 32px in a sidebar, lg 40px in a menu's header. */
|
|
42
|
+
size?: TInitialsAvatarSize;
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Colour the initials from the palette (on by default); off, they take the muted look. */
|
|
45
|
+
autoColor?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* An accessible name. Left out, the avatar is decoration, which is right beside
|
|
48
|
+
* the person's name; give one when it stands alone.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
51
|
+
}
|
|
52
|
+
/** A person's photo, or their initials on a circle in the palette colour they pick; both themes switch by themselves. */
|
|
53
|
+
export declare const InitialsAvatar: ({ name, photoUrl, size, className, autoColor, label, "aria-label": ariaLabel, ...props }: IInitialsAvatarProps) => import('react').JSX.Element;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InitialsAvatar: a stable colour per person, initials that fit, and a palette
|
|
3
|
+
* that stays readable.
|
|
4
|
+
*
|
|
5
|
+
* PATH TAKEN: the hash, the initials and the markup are plain logic, so happy-dom
|
|
6
|
+
* covers them. The palette claim ("every pair is readable") is checked against
|
|
7
|
+
* the real tokens.css, converting OKLCH to sRGB and measuring WCAG contrast, so
|
|
8
|
+
* the numbers cannot drift from the file.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './multi-select';
|