@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.
- package/CHANGELOG.md +104 -0
- package/LICENSE +21 -0
- package/README.md +373 -0
- package/dist/index.css +3743 -0
- package/package.json +82 -0
- package/src/base/index.css +21 -0
- package/src/components/ICON-SYSTEM.md +425 -0
- package/src/components/_template.css +109 -0
- package/src/components/alert.css +156 -0
- package/src/components/avatar.css +87 -0
- package/src/components/breadcrumbs.css +158 -0
- package/src/components/button.css +177 -0
- package/src/components/card.css +63 -0
- package/src/components/checkbox.css +181 -0
- package/src/components/chip.css +234 -0
- package/src/components/data-row.css +142 -0
- package/src/components/divider.css +143 -0
- package/src/components/dropdown-field.css +185 -0
- package/src/components/dropdown-menu.css +80 -0
- package/src/components/field-verification.css +156 -0
- package/src/components/filter-segment.css +163 -0
- package/src/components/icon-button.css +83 -0
- package/src/components/icon.css +145 -0
- package/src/components/index.css +47 -0
- package/src/components/input.css +180 -0
- package/src/components/link.css +183 -0
- package/src/components/loading-indicator.css +184 -0
- package/src/components/loading-inline.css +75 -0
- package/src/components/menu-item.css +138 -0
- package/src/components/modal.css +203 -0
- package/src/components/navigation-rail.css +558 -0
- package/src/components/pagination-item.css +196 -0
- package/src/components/pagination.css +108 -0
- package/src/components/pill.css +108 -0
- package/src/components/progress-bar.css +157 -0
- package/src/components/radio-select.css +97 -0
- package/src/components/section-marker.css +96 -0
- package/src/components/segment-selector.css +78 -0
- package/src/components/sensitive-data.css +77 -0
- package/src/components/skeleton.css +184 -0
- package/src/components/step.css +106 -0
- package/src/components/stepper.css +93 -0
- package/src/components/switch.css +99 -0
- package/src/components/tabs.css +213 -0
- package/src/components/tag.css +133 -0
- package/src/components/text-button.css +170 -0
- package/src/components/textarea.css +156 -0
- package/src/components/toast.css +182 -0
- package/src/components/tooltip.css +70 -0
- package/src/fonts.css +23 -0
- package/src/icons/README.md +297 -0
- package/src/icons/custom/help.svg +3 -0
- package/src/icons/custom/valiify-logo.svg +6 -0
- package/src/icons/icon-list.txt +2036 -0
- package/src/icons/sprite.svg +12223 -0
- package/src/index.css +35 -0
- package/src/library.css +34 -0
- package/src/themes/valiify.css +319 -0
- package/src/utilities/index.css +35 -0
- package/types/components.d.ts +630 -0
- package/types/index.d.ts +15 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal Component
|
|
3
|
+
*
|
|
4
|
+
* Dialog overlay for confirmations and focused workflows. Extracted from Figma
|
|
5
|
+
* Modal (908:1580) — 3 variants on a single `Action` axis, plus two booleans
|
|
6
|
+
* (Context Window, Leading Icon).
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <dialog class="modal modal-destructive">
|
|
10
|
+
* <div class="modal-header">
|
|
11
|
+
* <div class="modal-title-group">
|
|
12
|
+
* <span class="modal-icon">
|
|
13
|
+
* <svg class="icon icon-size-20" aria-hidden="true">
|
|
14
|
+
* <use href="#triangle-alert" />
|
|
15
|
+
* </svg>
|
|
16
|
+
* </span>
|
|
17
|
+
* <h2 class="modal-title">Decline this application?</h2>
|
|
18
|
+
* </div>
|
|
19
|
+
* <button class="icon-button icon-button-lg" aria-label="Close">
|
|
20
|
+
* <svg class="icon icon-size-16" aria-hidden="true"><use href="#x" /></svg>
|
|
21
|
+
* </button>
|
|
22
|
+
* </div>
|
|
23
|
+
*
|
|
24
|
+
* <div class="modal-subtitles">
|
|
25
|
+
* <p class="modal-subtitle">The applicant is notified through the portal.</p>
|
|
26
|
+
* <p class="modal-description">Two blocking items remain unresolved.</p>
|
|
27
|
+
* </div>
|
|
28
|
+
*
|
|
29
|
+
* <div class="modal-context">
|
|
30
|
+
* <p class="modal-context-text">#BA-204417 · Northwind Freight LLC</p>
|
|
31
|
+
* </div>
|
|
32
|
+
*
|
|
33
|
+
* <div class="modal-footer">
|
|
34
|
+
* <button class="btn btn-empty btn-lg">Cancel</button>
|
|
35
|
+
* <button class="btn btn-critical btn-lg">Decline application</button>
|
|
36
|
+
* </div>
|
|
37
|
+
* </dialog>
|
|
38
|
+
*
|
|
39
|
+
* THE THREE VARIANTS ARE STRUCTURALLY IDENTICAL. Only the header icon and its
|
|
40
|
+
* container colour differ. Figma's 299px (positive) vs 317px (destructive,
|
|
41
|
+
* neutral) heights are the subtitle wrapping to a second line, NOT a spec
|
|
42
|
+
* difference — the modal is auto-height and only its 480px width is fixed.
|
|
43
|
+
*
|
|
44
|
+
* ACTION ALSO PICKS THE CONFIRM BUTTON, which no amount of metadata reveals —
|
|
45
|
+
* it took a screenshot to catch. Figma renders it as a Button instance with a
|
|
46
|
+
* per-variant override:
|
|
47
|
+
* positive -> .btn-primary (blue)
|
|
48
|
+
* neutral -> .btn-outline (white)
|
|
49
|
+
* destructive -> .btn-critical (red)
|
|
50
|
+
* The variant classes here style ONLY the icon container; the footer button is
|
|
51
|
+
* the consumer's to pick, because it is an instance slot in Figma too.
|
|
52
|
+
*
|
|
53
|
+
* `.btn-critical` did not exist — Button's own variant set (73:180) has just
|
|
54
|
+
* primary / outline / empty. It is added in button.css and documented there.
|
|
55
|
+
*
|
|
56
|
+
* TWO TOKEN INCONSISTENCIES REPRODUCED, not corrected:
|
|
57
|
+
* - positive uses `Approved/Content` for the icon where the other two use
|
|
58
|
+
* `{Action}/Main`.
|
|
59
|
+
* - neutral fills its container with `Surface/Neutral` (opaque #f1f1f4)
|
|
60
|
+
* where the other two use `{Action}/Soft` (a 9% tint). `Neutral/Soft`
|
|
61
|
+
* exists and would have been the consistent choice.
|
|
62
|
+
* Both are flagged with the designer; faithful here.
|
|
63
|
+
*
|
|
64
|
+
* TWO VALUES ARE NOT TOKENISED IN FIGMA, and they are handled differently:
|
|
65
|
+
* - the 12px corner radius stays raw. Our scale stops at 8px
|
|
66
|
+
* (`--radius-surface`) and Figma hardcodes 12 too, so inventing a sixth
|
|
67
|
+
* radius token for one component would imply a system that does not exist.
|
|
68
|
+
* - the drop shadow IS recorded, as `--shadow-modal` in
|
|
69
|
+
* tokens/figma-tokens.json. It is a local effect rather than the named
|
|
70
|
+
* "General Drop Shadow" style behind `--shadow-panel` (34px/-12px against
|
|
71
|
+
* this one's 16px/0), but Switch Knob Shadow set the precedent:
|
|
72
|
+
* component-local effects get tokens, they just do not get style names.
|
|
73
|
+
*
|
|
74
|
+
* POSITIONING AND THE BACKDROP ARE THE CONSUMER'S, as with Tooltip — Figma
|
|
75
|
+
* draws the dialog frame only, with no scrim layer. The one concession is a
|
|
76
|
+
* `::backdrop` rule for when `.modal` is used on a native `<dialog>`, since a
|
|
77
|
+
* modal with no backdrop is not shippable. Marked as an extension below.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
@layer components {
|
|
81
|
+
.modal {
|
|
82
|
+
/* Layout — 480px fixed width, height follows content */
|
|
83
|
+
@apply flex w-120 flex-col items-start gap-6; /* 480px, 24px between sections */
|
|
84
|
+
@apply p-8; /* 32px */
|
|
85
|
+
|
|
86
|
+
/* Shape — 12px is a raw Figma value, not a token; see the header */
|
|
87
|
+
@apply rounded-[12px];
|
|
88
|
+
@apply border border-[length:var(--border-line)] border-stroke-divider;
|
|
89
|
+
|
|
90
|
+
/* Colors */
|
|
91
|
+
@apply bg-surface-paper text-content-primary;
|
|
92
|
+
|
|
93
|
+
/* Elevation — see the header: a local effect, NOT --shadow-panel */
|
|
94
|
+
@apply shadow-modal;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* --- Header ------------------------------------------------------------ */
|
|
98
|
+
|
|
99
|
+
.modal-header {
|
|
100
|
+
@apply flex w-full items-start justify-between;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.modal-title-group {
|
|
104
|
+
@apply flex flex-1 items-center gap-3; /* 12px */
|
|
105
|
+
min-width: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* 36px circle = a 20px icon plus 8px of padding. Defaults to the neutral
|
|
109
|
+
treatment; the variant classes below override it. */
|
|
110
|
+
.modal-icon {
|
|
111
|
+
@apply inline-flex shrink-0 items-center justify-center;
|
|
112
|
+
@apply p-2; /* 8px -> 36px overall */
|
|
113
|
+
@apply rounded-pill;
|
|
114
|
+
@apply bg-surface-neutral text-neutral;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.modal-title {
|
|
118
|
+
@apply flex-1;
|
|
119
|
+
min-width: 0;
|
|
120
|
+
@apply text-h1; /* 19px / 21.8px / 600 */
|
|
121
|
+
@apply text-content-primary;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* --- Subtitles ---------------------------------------------------------- */
|
|
125
|
+
|
|
126
|
+
.modal-subtitles {
|
|
127
|
+
@apply flex w-full flex-col items-start gap-2; /* 8px */
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Two different 12px styles, and they are not interchangeable — the line
|
|
131
|
+
heights differ (18px vs 14px), as do the colours. */
|
|
132
|
+
.modal-subtitle {
|
|
133
|
+
@apply w-full;
|
|
134
|
+
@apply text-caption; /* 12px / 18px / 400 */
|
|
135
|
+
@apply text-content-secondary;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.modal-description {
|
|
139
|
+
@apply w-full;
|
|
140
|
+
@apply text-help-caption; /* 12px / 14px / 400 */
|
|
141
|
+
@apply text-content-tertiary;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* --- Context window (Figma's Context Window boolean) -------------------- */
|
|
145
|
+
|
|
146
|
+
.modal-context {
|
|
147
|
+
@apply flex w-full items-center;
|
|
148
|
+
@apply p-3; /* 12px */
|
|
149
|
+
@apply rounded-surface; /* 8px */
|
|
150
|
+
@apply border border-[length:var(--border-line)] border-stroke-border;
|
|
151
|
+
@apply bg-surface-frame;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.modal-context-text {
|
|
155
|
+
@apply flex-1;
|
|
156
|
+
min-width: 0;
|
|
157
|
+
@apply text-data-xs font-mono; /* 12px / 16.5px / 400, JetBrains Mono */
|
|
158
|
+
@apply text-content-primary;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* --- Footer ------------------------------------------------------------- */
|
|
162
|
+
|
|
163
|
+
.modal-footer {
|
|
164
|
+
@apply flex w-full items-center justify-end gap-3; /* 12px */
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Figma dims the cancel label to Content/Secondary, where .btn-empty is
|
|
168
|
+
Content/Primary. This is an INSTANCE OVERRIDE in the Modal, not a change to
|
|
169
|
+
the Button component — Button's own set (73:180) is untouched — so it is
|
|
170
|
+
scoped to the footer rather than pushed into button.css. Flagged with the
|
|
171
|
+
designer: if empty buttons are meant to be Secondary everywhere, this rule
|
|
172
|
+
should move and this scoping should disappear. */
|
|
173
|
+
.modal-footer .btn-empty:not(:hover):not(:active) {
|
|
174
|
+
@apply text-content-secondary;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* --- Action variants ---------------------------------------------------- */
|
|
178
|
+
|
|
179
|
+
/* These style the icon container only. The footer button is a slot — see the
|
|
180
|
+
header for which .btn variant each Action pairs with. */
|
|
181
|
+
|
|
182
|
+
.modal-destructive .modal-icon {
|
|
183
|
+
@apply bg-critical-soft text-critical;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Approved/Content, not Approved/Main — Figma's own inconsistency. */
|
|
187
|
+
.modal-positive .modal-icon {
|
|
188
|
+
@apply bg-approved-soft text-approved-content;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Surface/Neutral, not Neutral/Soft — Figma's own inconsistency. */
|
|
192
|
+
.modal-neutral .modal-icon {
|
|
193
|
+
@apply bg-surface-neutral text-neutral;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* --- Native <dialog> support (extension, not from Figma) ---------------- */
|
|
197
|
+
|
|
198
|
+
/* `<dialog>` centres itself and supplies a backdrop for free; both of its
|
|
199
|
+
UA defaults (1em padding, inset border) are already overridden above. */
|
|
200
|
+
dialog.modal::backdrop {
|
|
201
|
+
background-color: oklch(0.2027 0.0395 282.3 / 0.4);
|
|
202
|
+
}
|
|
203
|
+
}
|