@valiify/dashboard-ui 0.1.0-alpha.1

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 (61) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/LICENSE +21 -0
  3. package/README.md +373 -0
  4. package/dist/index.css +3743 -0
  5. package/package.json +82 -0
  6. package/src/base/index.css +21 -0
  7. package/src/components/ICON-SYSTEM.md +425 -0
  8. package/src/components/_template.css +109 -0
  9. package/src/components/alert.css +156 -0
  10. package/src/components/avatar.css +87 -0
  11. package/src/components/breadcrumbs.css +158 -0
  12. package/src/components/button.css +177 -0
  13. package/src/components/card.css +63 -0
  14. package/src/components/checkbox.css +181 -0
  15. package/src/components/chip.css +234 -0
  16. package/src/components/data-row.css +142 -0
  17. package/src/components/divider.css +143 -0
  18. package/src/components/dropdown-field.css +185 -0
  19. package/src/components/dropdown-menu.css +80 -0
  20. package/src/components/field-verification.css +156 -0
  21. package/src/components/filter-segment.css +163 -0
  22. package/src/components/icon-button.css +83 -0
  23. package/src/components/icon.css +145 -0
  24. package/src/components/index.css +47 -0
  25. package/src/components/input.css +180 -0
  26. package/src/components/link.css +183 -0
  27. package/src/components/loading-indicator.css +184 -0
  28. package/src/components/loading-inline.css +75 -0
  29. package/src/components/menu-item.css +138 -0
  30. package/src/components/modal.css +203 -0
  31. package/src/components/navigation-rail.css +558 -0
  32. package/src/components/pagination-item.css +196 -0
  33. package/src/components/pagination.css +108 -0
  34. package/src/components/pill.css +108 -0
  35. package/src/components/progress-bar.css +157 -0
  36. package/src/components/radio-select.css +97 -0
  37. package/src/components/section-marker.css +96 -0
  38. package/src/components/segment-selector.css +78 -0
  39. package/src/components/sensitive-data.css +77 -0
  40. package/src/components/skeleton.css +184 -0
  41. package/src/components/step.css +106 -0
  42. package/src/components/stepper.css +93 -0
  43. package/src/components/switch.css +99 -0
  44. package/src/components/tabs.css +213 -0
  45. package/src/components/tag.css +133 -0
  46. package/src/components/text-button.css +170 -0
  47. package/src/components/textarea.css +156 -0
  48. package/src/components/toast.css +182 -0
  49. package/src/components/tooltip.css +70 -0
  50. package/src/fonts.css +23 -0
  51. package/src/icons/README.md +297 -0
  52. package/src/icons/custom/help.svg +3 -0
  53. package/src/icons/custom/valiify-logo.svg +6 -0
  54. package/src/icons/icon-list.txt +2036 -0
  55. package/src/icons/sprite.svg +12223 -0
  56. package/src/index.css +35 -0
  57. package/src/library.css +34 -0
  58. package/src/themes/valiify.css +319 -0
  59. package/src/utilities/index.css +35 -0
  60. package/types/components.d.ts +630 -0
  61. package/types/index.d.ts +15 -0
@@ -0,0 +1,156 @@
1
+ /**
2
+ * Textarea Component
3
+ *
4
+ * Multi-line text input field with labels, help text, and error messages.
5
+ * Extracted from Figma Text Field Container (854:24876) — 12 variants
6
+ * (state × filled × error).
7
+ *
8
+ * WHAT IS AND IS NOT FROM FIGMA
9
+ * Figma defines one geometry — 12px / 7px padding, 6px radius, 0.5px
10
+ * stroke-divider hairline, Body 1 text — and no Size property.
11
+ *
12
+ * HEIGHT IS DELIBERATELY NOT STYLED. The field hugs its <textarea>, so the
13
+ * consumer decides: `rows` for an initial line count, a height utility for a
14
+ * fixed box, or the resize handle. There are no size variants.
15
+ *
16
+ * .textarea-counter is a library extension, not in the design file.
17
+ *
18
+ * Structure:
19
+ * <div class="textarea-container">
20
+ * <div class="textarea-label">...</div> <!-- Optional -->
21
+ * <div class="textarea-field">...</div> <!-- Required -->
22
+ * <div class="textarea-error-message">...</div> <!-- Optional -->
23
+ * </div>
24
+ *
25
+ * Usage:
26
+ * <div class="textarea-container">
27
+ * <div class="textarea-field">
28
+ * <textarea class="textarea" rows="4" placeholder="Enter text..."></textarea>
29
+ * </div>
30
+ * </div>
31
+ */
32
+
33
+ @layer components {
34
+ /* --- Container ---------------------------------------------------- */
35
+
36
+ .textarea-container {
37
+ @apply flex flex-col items-start w-full;
38
+ }
39
+
40
+ /* --- Label ------------------------------------------------------- */
41
+
42
+ .textarea-label {
43
+ @apply flex items-center w-full pb-1.5; /* 6px bottom padding */
44
+ @apply text-[10px] font-semibold uppercase tracking-[1px] leading-[12px];
45
+ @apply text-content-tertiary;
46
+ }
47
+
48
+ .textarea-label > span {
49
+ @apply flex-1;
50
+ }
51
+
52
+ /* Note: Help button uses .icon-button .icon-button-xs from icon-button.css */
53
+
54
+ /* --- Textarea Field ---------------------------------------------- */
55
+
56
+ .textarea-field {
57
+ /* Layout */
58
+ @apply flex items-start w-full; /* items-start for top alignment */
59
+ @apply px-3 py-1.75; /* 12px / 7px, per Figma */
60
+
61
+ /* No height of its own — the field hugs the <textarea> inside it, so the
62
+ consumer sets the size with `rows`, a height utility, or by dragging. */
63
+
64
+ /* Shape */
65
+ @apply rounded-control; /* 6px */
66
+
67
+ /* Border */
68
+ @apply border border-[length:var(--border-thin)] border-stroke-divider;
69
+
70
+ /* Background - default: white */
71
+ @apply bg-surface-paper;
72
+
73
+ /* Interaction */
74
+ @apply transition-colors duration-150;
75
+ }
76
+
77
+ /* --- Actual Textarea Element ------------------------------------- */
78
+
79
+ .textarea {
80
+ /* Layout */
81
+ @apply flex-1 w-full;
82
+ min-width: 0;
83
+
84
+ /* Remove default styling */
85
+ @apply appearance-none bg-transparent border-none outline-none;
86
+ @apply p-0 m-0;
87
+
88
+ /* The consumer owns the height: `rows` sets the initial size, and the
89
+ user can drag to grow it. Set `resize-none` alongside an explicit
90
+ height utility for a fixed box. */
91
+ @apply resize-y;
92
+ @apply block;
93
+
94
+ /* Typography */
95
+ @apply text-body-1; /* 13px / 19.5px / 400 */
96
+ @apply text-content-primary;
97
+
98
+ /* Placeholder */
99
+ &::placeholder {
100
+ @apply text-content-faint;
101
+ }
102
+ }
103
+
104
+ /* No size variants. Figma defines no Size property for this component, and
105
+ a multi-line box's height is a usage decision, not a design token — drive
106
+ it with `rows`, a height utility, or the resize handle. */
107
+
108
+ /* --- Background Variants ----------------------------------------- */
109
+
110
+ .textarea-bg-neutral {
111
+ @apply bg-surface-card; /* Figma BG=Neutral is Surface/Card #fafafb */
112
+ }
113
+
114
+ /* --- States ------------------------------------------------------ */
115
+
116
+ /* Hover */
117
+ .textarea-field:hover:not(:has(:disabled)):not(.textarea-disabled) {
118
+ @apply border-stroke-border;
119
+ }
120
+
121
+ /* Focus */
122
+ .textarea-field:focus-within {
123
+ @apply focus-ring;
124
+ }
125
+
126
+ /* Error */
127
+ .textarea-field.textarea-error {
128
+ @apply border-critical;
129
+ }
130
+
131
+ /* Disabled */
132
+ .textarea-field:has(:disabled),
133
+ .textarea-field.textarea-disabled {
134
+ @apply bg-action-subtle border-stroke-divider cursor-not-allowed;
135
+ }
136
+
137
+ .textarea:disabled {
138
+ @apply cursor-not-allowed;
139
+ }
140
+
141
+ /* --- Error Message ----------------------------------------------- */
142
+
143
+ .textarea-error-message {
144
+ @apply flex items-center w-full pt-1.5; /* 6px top padding */
145
+ @apply text-[11px] leading-[normal] font-normal;
146
+ @apply text-critical-strong;
147
+ }
148
+
149
+ /* --- Character Counter (Optional) -------------------------------- */
150
+
151
+ .textarea-counter {
152
+ @apply flex items-center justify-end w-full pt-1;
153
+ @apply text-[11px] leading-[normal] font-normal;
154
+ @apply text-content-secondary;
155
+ }
156
+ }
@@ -0,0 +1,182 @@
1
+ /**
2
+ * Toast Component
3
+ *
4
+ * Transient floating notification for brief status feedback. Extracted from
5
+ * Figma Toast (880:31121) — Type (success / error / info) x Style (Full /
6
+ * Simple).
7
+ *
8
+ * Usage — Full:
9
+ * <div class="toast toast-success" role="status">
10
+ * <div class="toast-header">
11
+ * <div class="toast-main">
12
+ * <svg class="toast-icon icon icon-size-18" aria-hidden="true">
13
+ * <use href="#circle-check" />
14
+ * </svg>
15
+ * <div class="toast-text">
16
+ * <p class="toast-title">Document request sent</p>
17
+ * <p class="toast-message">Client has been notified to upload their W-9.</p>
18
+ * </div>
19
+ * </div>
20
+ * <button class="icon-button icon-button-md" aria-label="Dismiss">
21
+ * <svg class="icon icon-size-14" aria-hidden="true"><use href="#x" /></svg>
22
+ * </button>
23
+ * </div>
24
+ * <div class="toast-footer">
25
+ * <span class="toast-timestamp">just now</span>
26
+ * <button class="text-button text-button-primary">Retry</button>
27
+ * </div>
28
+ * </div>
29
+ *
30
+ * Usage — Simple:
31
+ * <div class="toast toast-simple" role="status">
32
+ * <svg class="icon icon-size-15" aria-hidden="true"><use href="#check" /></svg>
33
+ * Template Saved
34
+ * </div>
35
+ *
36
+ * THE TWO STYLES SHARE ALMOST NOTHING. Figma models them as one component, but
37
+ * Full is a 356px white card and Simple is a 280px dark pill — different
38
+ * background, radius, padding, direction, width, shadow and text colour. `.toast`
39
+ * carries Full, which is Figma's default Style and its only populated axis;
40
+ * `.toast-simple` overrides essentially all of it.
41
+ *
42
+ * THE ACTION AND CLOSE ARE EXISTING COMPONENTS, not new parts. Figma's "Retry"
43
+ * is a literal Text Button instance (Type=Primary) and its close is an Icon
44
+ * Button, so they use `.text-button text-button-primary` and
45
+ * `.icon-button icon-button-md`. Nothing new is defined for either.
46
+ *
47
+ * THE ICON IS A SLOT. Type only sets its colour; the glyph is the consumer's.
48
+ * What Figma draws:
49
+ * success #circle-check Approved/Main
50
+ * error #triangle-alert Critical/Main
51
+ * info #refresh-cw Primary/Main
52
+ * simple #check Content/Contrast (inherits)
53
+ *
54
+ * THREE FIGMA GAPS, reported rather than papered over:
55
+ * - Simple exists ONLY for Type=info. There is no success or error Simple, so
56
+ * `.toast-simple` ignores the type classes rather than invent two variants.
57
+ * - That single Simple variant is typed `info` but draws a success check.
58
+ * - Its Figma description reads "Dark contextual popover for hover
59
+ * explanations… Maps to DaisyUI tooltip" — copied from Tooltip.
60
+ * All three are on the designer list.
61
+ *
62
+ * TWO SHADOWS, DELIBERATELY. Full uses a local effect, tokenised here as
63
+ * `--shadow-toast`; Simple uses the named General Drop Shadow, which is already
64
+ * `--shadow-panel`. They are not interchangeable.
65
+ *
66
+ * SIMPLE'S 35px HEIGHT IS PINNED, and must be. Figma draws strokes without
67
+ * adding to the frame, so its 10 + 15 + 10 = 35 ignores the 1px border; under
68
+ * border-box the same values derive 37. The pin restores Figma's rendered size
69
+ * and flex centring keeps the 15px icon centred. Same trap button.css and
70
+ * pill.css document — a bordered box must be sized, never derived.
71
+ *
72
+ * DIVERGENCE: Figma pins Full's text group to 280px inside the 356px card,
73
+ * leaving a fixed 26px gutter before the close button. It flexes here instead,
74
+ * so a widened toast still uses its space. No visible difference at Figma's own
75
+ * content; it only shows if the toast is resized.
76
+ */
77
+
78
+ @layer components {
79
+ .toast {
80
+ /* Layout — Full */
81
+ @apply flex w-89 flex-col items-start gap-3; /* 356px, 12px */
82
+ @apply p-4; /* 16px */
83
+
84
+ /* Shape */
85
+ @apply rounded-surface; /* 8px */
86
+ @apply border border-[length:var(--border-line)] border-stroke-divider;
87
+
88
+ /* Colors */
89
+ @apply bg-surface-paper text-content-primary;
90
+
91
+ /* Elevation — local effect, NOT --shadow-panel. See the header. */
92
+ @apply shadow-toast;
93
+ }
94
+
95
+ /* --- Full parts --------------------------------------------------------- */
96
+
97
+ .toast-header {
98
+ @apply flex w-full items-start justify-between;
99
+ }
100
+
101
+ .toast-main {
102
+ @apply flex flex-1 items-start gap-3; /* 12px */
103
+ min-width: 0;
104
+ }
105
+
106
+ /* 18px. Colour comes from the type class; the glyph is the consumer's. */
107
+ .toast-icon {
108
+ @apply shrink-0;
109
+ }
110
+
111
+ .toast-text {
112
+ @apply flex flex-1 flex-col items-start gap-1; /* 4px */
113
+ min-width: 0;
114
+ }
115
+
116
+ /* 12.5px with a 12.5px line-height — the line box is exactly the cap height,
117
+ which is intentional in Figma and keeps the two lines tight. */
118
+ .toast-title {
119
+ @apply text-body-2-bold; /* 12.5px / 12.5px / 500 */
120
+ @apply text-content-primary;
121
+ }
122
+
123
+ .toast-message {
124
+ @apply text-caption; /* 12px / 18px / 400 */
125
+ @apply text-content-secondary;
126
+ }
127
+
128
+ .toast-footer {
129
+ @apply flex w-full items-center justify-between;
130
+ }
131
+
132
+ /* Data/Data xs needs font-mono — --text-* carries no family. See CLAUDE.md. */
133
+ .toast-timestamp {
134
+ @apply text-data-xs font-mono; /* 12px / 16.5px / 400, JetBrains Mono */
135
+ @apply text-content-faint;
136
+ }
137
+
138
+ /* --- Types -------------------------------------------------------------- */
139
+
140
+ /* Type sets the icon colour and nothing else. Unlike Modal, all three follow
141
+ the same pattern — no exceptions to reproduce. */
142
+ .toast-success .toast-icon {
143
+ @apply text-approved;
144
+ }
145
+
146
+ .toast-error .toast-icon {
147
+ @apply text-critical;
148
+ }
149
+
150
+ .toast-info .toast-icon {
151
+ @apply text-primary;
152
+ }
153
+
154
+ /* --- Style = Simple ----------------------------------------------------- */
155
+
156
+ /* A different shape wearing the same name — see the header. Every property
157
+ Full sets and Simple contradicts has to be restated, so this block is
158
+ exhaustive on purpose rather than relying on what happens to cascade. */
159
+ .toast-simple {
160
+ @apply inline-flex w-70 flex-row items-center justify-center gap-2.25; /* 280px, 9px */
161
+ @apply px-4 py-2.5; /* 16px / 10px */
162
+ @apply h-[35px]; /* pinned — see the header */
163
+
164
+ @apply rounded-pill;
165
+ @apply border border-[length:var(--border-line)] border-stroke-divider;
166
+
167
+ /* The dark surface, as with Tooltip. */
168
+ @apply bg-content-primary text-content-contrast;
169
+
170
+ @apply text-body-2; /* 12.5px / 12.5px / 400 — Regular, not the Bold above */
171
+
172
+ /* The NAMED General Drop Shadow, where Full uses its own local effect. */
173
+ @apply shadow-panel;
174
+ }
175
+
176
+ /* Simple has no type variants in Figma, so a stray type class must not tint
177
+ its icon — it is Content/Contrast like the rest of the pill. */
178
+ .toast-simple .toast-icon,
179
+ .toast-simple .icon {
180
+ @apply shrink-0 text-content-contrast;
181
+ }
182
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Tooltip Component
3
+ *
4
+ * Dark contextual popover for hover explanations and helper text. Extracted
5
+ * from Figma Tooltip (880:31125) — a single symbol, no variants.
6
+ *
7
+ * Structure (Figma's own property names):
8
+ * <div class="tooltip" role="tooltip">
9
+ * <p class="tooltip-title">INDUSTRY / NAICS</p>
10
+ * <p class="tooltip-content">North American Industry Classification …</p>
11
+ * <hr class="tooltip-divider" />
12
+ * <p class="tooltip-subtext">Middesk · Secretary of State</p>
13
+ * </div>
14
+ *
15
+ * All four parts are optional in markup. Figma models title / content /
16
+ * subtext as TEXT properties rather than boolean toggles, so it draws them
17
+ * always — but a tooltip with only `.tooltip-content` is the common case and
18
+ * nothing here depends on the siblings being present.
19
+ *
20
+ * This is the only DARK surface in the library: the background is
21
+ * `Content/Primary`, and the text tokens invert accordingly — `Content/Faint`
22
+ * for the title and subtext, `Content/Contrast` for the body.
23
+ *
24
+ * POSITIONING IS THE CONSUMER'S JOB. Figma models the bubble only — no arrow,
25
+ * no placement, no collision handling. There is no pointer/caret layer in the
26
+ * component at all.
27
+ */
28
+
29
+ @layer components {
30
+ .tooltip {
31
+ /* Layout */
32
+ @apply flex w-70 flex-col items-start gap-1.5; /* 280px, 6px */
33
+ @apply px-4 py-3; /* 16px / 12px */
34
+
35
+ /* Shape */
36
+ @apply rounded-control; /* 6px */
37
+ @apply border border-[length:var(--border-line)] border-stroke-divider;
38
+
39
+ /* Colors — dark surface */
40
+ @apply bg-content-primary;
41
+
42
+ /* Elevation — Figma General Drop Shadow */
43
+ @apply shadow-panel;
44
+ }
45
+
46
+ /* --- Parts ------------------------------------------------------------ */
47
+
48
+ /* Title and subtext are styled identically in Figma — same size, same
49
+ token. Kept as one rule so they cannot drift apart. */
50
+ .tooltip-title,
51
+ .tooltip-subtext {
52
+ @apply w-full;
53
+ @apply text-micro-l text-content-faint; /* 11px / 400 */
54
+ }
55
+
56
+ .tooltip-content {
57
+ @apply w-full;
58
+ @apply text-caption text-content-contrast; /* 12px / 18px / 400 */
59
+ }
60
+
61
+ /* A 0.5px rule in Content/Secondary — NOT Stroke/Divider, which would be
62
+ invisible on this dark background. Drawn as a filled box rather than a
63
+ border because Chrome rounds sub-pixel border widths up to a full 1px;
64
+ a background box can render the half pixel at 2x. */
65
+ .tooltip-divider {
66
+ @apply w-full border-none;
67
+ height: var(--border-thin);
68
+ @apply bg-content-secondary;
69
+ }
70
+ }
package/src/fonts.css ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Valiify Dashboard UI — webfonts (optional).
3
+ *
4
+ * Exposed as `@valiify/dashboard-ui/fonts`.
5
+ *
6
+ * The design system assumes Inter (UI) and JetBrains Mono (data). This file is
7
+ * kept separate, and deliberately NOT bundled into dist/index.css, because CSS
8
+ * requires every `@import` to precede all other rules — a font import inside the
9
+ * compiled bundle lands mid-file the moment a consumer imports that bundle, and
10
+ * the browser silently discards it.
11
+ *
12
+ * So import this FIRST in your own stylesheet, before anything else:
13
+ *
14
+ * @import "@valiify/dashboard-ui/fonts";
15
+ * @import "tailwindcss";
16
+ * @import "@valiify/dashboard-ui/source";
17
+ *
18
+ * Or skip it entirely and self-host the two families, which is usually better
19
+ * for performance and privacy. The library only needs `--font-sans` and
20
+ * `--font-mono` to resolve to something real.
21
+ */
22
+
23
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");