@nubisco/ui 5.32.0 → 5.32.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/dist/{AiLabel-oCXAwOV7.cjs → AiLabel-BK3oecvT.cjs} +1 -1
- package/dist/{AiLabel--bFL3RGP.js → AiLabel-CPINOrQd.js} +1 -1
- package/dist/{AiProvider-Hcn5HI7d.cjs → AiProvider-CXkNWwzy.cjs} +1 -1
- package/dist/{AiProvider-e52qwD9B.js → AiProvider-TIZP0M_z.js} +3 -3
- package/dist/{Briefing-B3DkTnx2.js → Briefing-BhnZ6WVQ.js} +2 -2
- package/dist/{Briefing-j9BVOjgG.cjs → Briefing-CZ2bGU7N.cjs} +1 -1
- package/dist/{ColorStrip-BU-ulOHD.js → ColorStrip-Cvg8SDbi.js} +1 -1
- package/dist/{ColorStrip-BYyRIRcm.cjs → ColorStrip-D9Y0q4F3.cjs} +1 -1
- package/dist/{Confirm-D4efGS9N.js → Confirm-PX-ztREx.js} +2 -2
- package/dist/{Confirm-dbr67RaT.cjs → Confirm-f5dXOogg.cjs} +1 -1
- package/dist/{DataTable-Crff50H9.js → DataTable-pqZtxJyw.js} +1 -1
- package/dist/{DataTable-CEn_t_gK.cjs → DataTable-pukt9JVj.cjs} +1 -1
- package/dist/{DatePicker-BE8UNh5e.cjs → DatePicker-BtQGKawo.cjs} +1 -1
- package/dist/{DatePicker-DdC1K_r4.js → DatePicker-D-V0rt-j.js} +1 -1
- package/dist/{Form-CCIMliw5.cjs → Form-CTlKzud3.cjs} +1 -1
- package/dist/{Form-C6D7J3uE.js → Form-CU8I3tRi.js} +1 -1
- package/dist/{Grid-Hbvbu16k.js → Grid-CJFQvcko.js} +1 -1
- package/dist/{Grid-CDrItyQ7.cjs → Grid-CXE0B85G.cjs} +1 -1
- package/dist/{ImageCropper-BdB5u2KL.js → ImageCropper-DJdFeFEa.js} +1 -1
- package/dist/{ImageCropper-ujxFwNFt.cjs → ImageCropper-DsPY_FK-.cjs} +1 -1
- package/dist/{Modal-B5o-iCST.cjs → Modal-BsjO-Q-K.cjs} +1 -1
- package/dist/{Modal-DmNuqKOf.js → Modal-CN35LB5_.js} +1 -1
- package/dist/{Pagination-R0xsDurI.js → Pagination-DyoObjwm.js} +1 -1
- package/dist/{Pagination-DC0orqR2.cjs → Pagination-zLxu_xGl.cjs} +1 -1
- package/dist/{Select-Rt3Y2VD4.js → Select-Djtr68yO.js} +1 -1
- package/dist/{Select-CjkBXtFi.cjs → Select-tqEDoa5r.cjs} +1 -1
- package/dist/{ShellPanel-7EmMevry.cjs → ShellPanel-COJIhqCY.cjs} +1 -1
- package/dist/{ShellPanel-6slzyDrP.js → ShellPanel-Dway28Hw.js} +1 -1
- package/dist/{Slider-YLBEViRc.js → Slider-CUonOhgJ.js} +1 -1
- package/dist/{Slider-NUU1SB6V.cjs → Slider-CojrFGb_.cjs} +1 -1
- package/dist/{Switch-CZUy_hrg.js → Switch-8zEBXjF9.js} +1 -1
- package/dist/{Switch-BNIi6Xxq.cjs → Switch-D6Yh4B_9.cjs} +1 -1
- package/dist/{TextInput-BaRumauo.js → TextInput-D5vlfecS.js} +1 -1
- package/dist/{TextInput-bj61DMdd.cjs → TextInput-IAk1KYb5.cjs} +1 -1
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +17 -17
- package/dist/components/AiLabel.cjs +1 -1
- package/dist/components/AiLabel.mjs +1 -1
- package/dist/components/AiProvider.cjs +1 -1
- package/dist/components/AiProvider.mjs +1 -1
- package/dist/components/Briefing.cjs +1 -1
- package/dist/components/Briefing.mjs +1 -1
- package/dist/components/ColorStrip.cjs +1 -1
- package/dist/components/ColorStrip.mjs +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DatePicker.cjs +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/Form.cjs +1 -1
- package/dist/components/Form.mjs +1 -1
- package/dist/components/Grid.cjs +1 -1
- package/dist/components/Grid.mjs +1 -1
- package/dist/components/Grid.vue.d.ts.map +1 -1
- package/dist/components/ImageCropper.cjs +1 -1
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/ShellPanel.cjs +1 -1
- package/dist/components/ShellPanel.mjs +1 -1
- package/dist/components/ShellPanel.vue.d.ts.map +1 -1
- package/dist/components/Slider.cjs +1 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Switch.cjs +1 -1
- package/dist/components/Switch.mjs +1 -1
- package/dist/components/TextInput.cjs +1 -1
- package/dist/components/TextInput.mjs +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +17 -17
- package/dist/styles/Button.css +1 -1
- package/dist/styles/FileUploader.css +1 -1
- package/dist/styles/ShellPanel.css +1 -1
- package/dist/ui.css +3 -3
- package/package.json +1 -1
- package/src/styles/_theme-api.scss +31 -13
- package/src/styles/_theme.scss +16 -15
- package/src/styles/grid/_mixins.scss +26 -3
- package/src/styles/grid/index.scss +5 -0
- package/src/styles/logic/_ink.scss +54 -15
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
@use 'sass:string';
|
|
55
55
|
@use 'accent' as accent;
|
|
56
56
|
@use 'logic' as logic;
|
|
57
|
+
@use 'logic/ink' as ink;
|
|
57
58
|
@use 'variables/categories' as categories;
|
|
58
59
|
|
|
59
60
|
/// The tints every palette colour is expanded into, matching the library's own
|
|
@@ -177,6 +178,7 @@ $a11y-roles:
|
|
|
177
178
|
@if $palette != () or map.keys($light) != () or $light != () {
|
|
178
179
|
[data-nb-theme='#{$id}'] {
|
|
179
180
|
@include _palette($palette);
|
|
181
|
+
@include _ink-reset($light);
|
|
180
182
|
@include _emit($light, $palette);
|
|
181
183
|
}
|
|
182
184
|
}
|
|
@@ -187,31 +189,47 @@ $a11y-roles:
|
|
|
187
189
|
* single-attribute block above, so the dark half wins inside a dark document
|
|
188
190
|
* regardless of the order the stylesheets happen to be concatenated in.
|
|
189
191
|
*/
|
|
190
|
-
@if map.keys($dark) != () or $dark != () {
|
|
192
|
+
@if map.keys($dark) != () or $dark != () or _has-ink($light) {
|
|
191
193
|
.dark[data-nb-theme='#{$id}'],
|
|
192
194
|
.dark [data-nb-theme='#{$id}'] {
|
|
193
|
-
@include _ink-reset($dark);
|
|
195
|
+
@include _ink-reset($dark, $light);
|
|
194
196
|
@include _emit($dark, $palette);
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
|
|
199
|
-
///
|
|
200
|
-
$
|
|
201
|
+
/// Whether a token map colours any variant that ink applies to.
|
|
202
|
+
@function _has-ink($tokens) {
|
|
203
|
+
@each $variant in ink.$variants {
|
|
204
|
+
@if map.has-key($tokens, $variant) {
|
|
205
|
+
@return true;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
@return false;
|
|
209
|
+
}
|
|
201
210
|
|
|
202
|
-
/// Turns the
|
|
203
|
-
/// colour.
|
|
211
|
+
/// Turns the ink lift off for every variant a theme gives its own colour.
|
|
204
212
|
///
|
|
205
|
-
/// The library's
|
|
206
|
-
///
|
|
207
|
-
///
|
|
208
|
-
///
|
|
209
|
-
///
|
|
213
|
+
/// The library's lifts (`--nb-c-<variant>-ink-lift`, see `logic/_ink.scss`)
|
|
214
|
+
/// are sized for the library's own colours. A theme that picks a colour has
|
|
215
|
+
/// picked it for contrast already (every category accent clears AA on all four
|
|
216
|
+
/// layers of its mode), and moving it further would only wash it out or muddy
|
|
217
|
+
/// it. Emitted before the theme's own keys, so a theme that does want a lift
|
|
210
218
|
/// can still pass `primary-ink-lift` and win.
|
|
211
|
-
|
|
212
|
-
|
|
219
|
+
///
|
|
220
|
+
/// The light scope applies in both modes, so its reset would also reach a dark
|
|
221
|
+
/// document. A variant the theme colours only in light therefore gets the
|
|
222
|
+
/// library's dark lift back in the dark scope: its light colour is what shows
|
|
223
|
+
/// there, and it was not picked for a dark layer.
|
|
224
|
+
///
|
|
225
|
+
/// @param {Map} $tokens - the mode being emitted
|
|
226
|
+
/// @param {Map} $light - the light map, when emitting the dark scope
|
|
227
|
+
@mixin _ink-reset($tokens, $light: ()) {
|
|
228
|
+
@each $variant in ink.$variants {
|
|
213
229
|
@if map.has-key($tokens, $variant) {
|
|
214
230
|
--nb-c-#{$variant}-ink-lift: 0%;
|
|
231
|
+
} @else if map.has-key($light, $variant) {
|
|
232
|
+
--nb-c-#{$variant}-ink-lift: #{map.get(ink.$dark-lifts, $variant) or 0%};
|
|
215
233
|
}
|
|
216
234
|
}
|
|
217
235
|
}
|
package/src/styles/_theme.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
2
|
@use 'sass:map';
|
|
3
3
|
@use 'accent';
|
|
4
|
+
@use 'logic/ink';
|
|
4
5
|
@use 'config';
|
|
5
6
|
@use 'variables/layout';
|
|
6
7
|
@use 'variables/colors';
|
|
@@ -168,6 +169,13 @@
|
|
|
168
169
|
--nb-c-secondary-active: var(--nb-c-plain-black-850);
|
|
169
170
|
--nb-c-secondary-active-a11y: var(--nb-c-plain-black-850-a11y);
|
|
170
171
|
|
|
172
|
+
// Ink: a semantic colour drawn as text or an outline straight onto a
|
|
173
|
+
// layer (an outlined button, a drop-zone label) moves away from the
|
|
174
|
+
// surface, toward black here and toward white in .dark, by a per-variant
|
|
175
|
+
// lift sized for WCAG AA on every layer. See `logic/_ink.scss`.
|
|
176
|
+
--nb-c-ink-toward: var(--nb-c-black);
|
|
177
|
+
@include ink.lifts(ink.$light-lifts);
|
|
178
|
+
|
|
171
179
|
--nb-c-success: var(--nb-c-emerald-reflection-600);
|
|
172
180
|
--nb-c-success-a11y: var(--nb-c-emerald-reflection-600-a11y);
|
|
173
181
|
--nb-c-success-hover: var(--nb-c-emerald-reflection-700);
|
|
@@ -668,12 +676,14 @@
|
|
|
668
676
|
// fighting the components' scoped-style specificity.
|
|
669
677
|
--nb-shell-panel-header-height: calc(var(--nb-base-unit) * 3.5); // 28px
|
|
670
678
|
--nb-shell-panel-gap: 1px; // hairline separator, not a spacing step
|
|
671
|
-
--nb-shell-panel-bg
|
|
672
|
-
|
|
679
|
+
// --nb-shell-panel-bg, -border and -header-border are deliberately NOT
|
|
680
|
+
// declared here. Their defaults read the panel's own layer (`--nb-c-surface`
|
|
681
|
+
// and `--nb-c-border` on the panel), which only resolves on the panel
|
|
682
|
+
// element: declared at :root they froze to layer 1 and every NbShellPanel
|
|
683
|
+
// painted layer 1 wherever it sat. ShellPanel.vue writes the fallbacks.
|
|
673
684
|
// Transparent by default so the header reads as part of the panel; set it
|
|
674
685
|
// when a product wants the header bar tinted against its own content.
|
|
675
686
|
--nb-shell-panel-header-bg: transparent;
|
|
676
|
-
--nb-shell-panel-header-border: 1px solid var(--nb-c-border);
|
|
677
687
|
// How much of the body a bottom panel claims at its intermediate (`default`)
|
|
678
688
|
// size. A share rather than a length: the point of that size is to show part
|
|
679
689
|
// of the panel and part of the page at once, which has to hold at any window
|
|
@@ -912,18 +922,9 @@
|
|
|
912
922
|
colors.get-color('chicken-comb', 400)
|
|
913
923
|
)};
|
|
914
924
|
|
|
915
|
-
// Ink
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
// smallest whole lift that clears WCAG AA on all four dark layers and on
|
|
919
|
-
// the 14% pressed wash, plus two points of margin. The light theme
|
|
920
|
-
// declares none, so ink there is the colour itself.
|
|
921
|
-
--nb-c-primary-ink-lift: 48%;
|
|
922
|
-
--nb-c-secondary-ink-lift: 56%;
|
|
923
|
-
--nb-c-success-ink-lift: 21%;
|
|
924
|
-
--nb-c-info-ink-lift: 43%;
|
|
925
|
-
--nb-c-warning-ink-lift: 6%;
|
|
926
|
-
--nb-c-danger-ink-lift: 46%;
|
|
925
|
+
// Ink moves toward white on a dark layer. Lifts in `logic/_ink.scss`.
|
|
926
|
+
--nb-c-ink-toward: var(--nb-c-white);
|
|
927
|
+
@include ink.lifts(ink.$dark-lifts);
|
|
927
928
|
|
|
928
929
|
// Component states
|
|
929
930
|
--nb-c-component-inactive: #{colors.get-color('nouveau-gray', 500)};
|
|
@@ -4,11 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
@mixin generate-styles($prefix) {
|
|
6
6
|
// grid
|
|
7
|
+
//
|
|
8
|
+
// A span is its share of the row minus its share of the gaps, so spans that
|
|
9
|
+
// add up to the full row fit beside each other with the parent's gap
|
|
10
|
+
// between them: 8 + 8 is (100% - gap) / 2 each. The parent tells its
|
|
11
|
+
// children its gap and whether it is laid out as a row (only a row's gap is
|
|
12
|
+
// horizontal) through two custom properties it sets on them directly, below.
|
|
7
13
|
@each $column in common.$var-columns-top {
|
|
8
14
|
&.#{$prefix}grid-#{$column} {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
$span: calc(
|
|
16
|
+
(100% * #{$column}) /
|
|
17
|
+
#{grid.$grid-columns} - var(--nb-grid-parent-gap, 0px) *
|
|
18
|
+
var(--nb-grid-parent-row, 1) *
|
|
19
|
+
#{grid.$grid-columns -
|
|
20
|
+
$column} /
|
|
21
|
+
#{grid.$grid-columns}
|
|
22
|
+
);
|
|
23
|
+
flex-basis: $span;
|
|
24
|
+
max-width: $span;
|
|
25
|
+
min-width: $span;
|
|
12
26
|
}
|
|
13
27
|
}
|
|
14
28
|
@each $column in common.$var-columns-bottom {
|
|
@@ -22,10 +36,16 @@
|
|
|
22
36
|
flex-direction: row;
|
|
23
37
|
// width: 100%;
|
|
24
38
|
// overflow-x: hidden;
|
|
39
|
+
> * {
|
|
40
|
+
--nb-grid-parent-row: 1;
|
|
41
|
+
}
|
|
25
42
|
}
|
|
26
43
|
&.#{$prefix}col {
|
|
27
44
|
flex-direction: column;
|
|
28
45
|
// width: 100%;
|
|
46
|
+
> * {
|
|
47
|
+
--nb-grid-parent-row: 0;
|
|
48
|
+
}
|
|
29
49
|
}
|
|
30
50
|
|
|
31
51
|
// wrap
|
|
@@ -112,6 +132,9 @@
|
|
|
112
132
|
@each $gap in map.keys(grid.$gap-ratios) {
|
|
113
133
|
&.#{$prefix}gap-#{$gap} {
|
|
114
134
|
gap: map.get(grid.$gap-ratios, $gap);
|
|
135
|
+
> * {
|
|
136
|
+
--nb-grid-parent-gap: #{map.get(grid.$gap-ratios, $gap)};
|
|
137
|
+
}
|
|
115
138
|
}
|
|
116
139
|
}
|
|
117
140
|
}
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
@mixin defaults-root-styles {
|
|
10
10
|
box-sizing: border-box;
|
|
11
11
|
display: flex;
|
|
12
|
+
// A grid without a gap class has no gap for its spans to share, whatever
|
|
13
|
+
// the grid around it uses. Its gap class, being more specific, sets it.
|
|
14
|
+
> * {
|
|
15
|
+
--nb-grid-parent-gap: 0px;
|
|
16
|
+
}
|
|
12
17
|
&.flex {
|
|
13
18
|
flex: 1;
|
|
14
19
|
}
|
|
@@ -1,34 +1,73 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
1
3
|
/// A semantic colour drawn as ink: text, an outline or an icon set directly on a
|
|
2
4
|
/// surface, with no fill of its own behind it.
|
|
3
5
|
///
|
|
4
6
|
/// The semantic colours (`--nb-c-primary`, `--nb-c-secondary`, ...) are picked
|
|
5
7
|
/// first as FILLS, with their `-a11y` foreground on top. Drawn straight onto a
|
|
6
|
-
/// surface they are a different pair, and
|
|
7
|
-
///
|
|
8
|
-
///
|
|
9
|
-
/// the
|
|
8
|
+
/// surface they are a different pair, and several of them do not survive it.
|
|
9
|
+
/// In dark mode the secondary is a mid grey chosen to carry white text, and as
|
|
10
|
+
/// the label of an outlined button it measured 1.21:1 to 2.15:1 on the dark
|
|
11
|
+
/// layers. In light mode the warning amber measured 1.75:1 to 2.06:1, and the
|
|
12
|
+
/// success green 2.69:1 to 3.16:1.
|
|
10
13
|
///
|
|
11
|
-
/// So ink
|
|
12
|
-
///
|
|
13
|
-
///
|
|
14
|
-
///
|
|
15
|
-
///
|
|
16
|
-
///
|
|
14
|
+
/// So ink moves the colour away from the surface: toward
|
|
15
|
+
/// `--nb-c-ink-toward` (black in light mode, white in dark) by
|
|
16
|
+
/// `--nb-c-<variant>-ink-lift`. Each lift is the smallest whole value that
|
|
17
|
+
/// clears WCAG AA (4.5:1) on all four layers of its theme, and on the 8% hover
|
|
18
|
+
/// and 14% pressed washes an outlined button paints under its own label, plus
|
|
19
|
+
/// two points of margin. A variant that already clears it has no lift.
|
|
20
|
+
/// `tests/inkContrast.test.ts` measures every one.
|
|
17
21
|
///
|
|
18
22
|
/// The mix is resolved on the element that paints, not at `:root`, so a product
|
|
19
23
|
/// that re-points `--nb-c-primary` (on `:root` or on a themed subtree) gets ITS
|
|
20
|
-
/// primary
|
|
21
|
-
///
|
|
22
|
-
/// colour for contrast already (see `theme()` in `_theme-api.scss`).
|
|
24
|
+
/// primary moved, never the library's. A named theme that sets its own colour
|
|
25
|
+
/// for a variant resets that variant's lift to 0% in that mode, because it chose
|
|
26
|
+
/// that colour for contrast already (see `theme()` in `_theme-api.scss`).
|
|
23
27
|
///
|
|
28
|
+
/// @group @nubisco/colors
|
|
29
|
+
|
|
30
|
+
/// Light-theme lifts, toward black.
|
|
31
|
+
/// @type Map
|
|
32
|
+
$light-lifts: (
|
|
33
|
+
success: 34%,
|
|
34
|
+
info: 14%,
|
|
35
|
+
warning: 46%,
|
|
36
|
+
danger: 22%,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
/// Dark-theme lifts, toward white.
|
|
40
|
+
/// @type Map
|
|
41
|
+
$dark-lifts: (
|
|
42
|
+
primary: 48%,
|
|
43
|
+
secondary: 56%,
|
|
44
|
+
success: 21%,
|
|
45
|
+
info: 43%,
|
|
46
|
+
warning: 6%,
|
|
47
|
+
danger: 46%,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
/// The variants ink applies to.
|
|
51
|
+
$variants: primary, secondary, success, info, warning, danger;
|
|
52
|
+
|
|
53
|
+
/// Declares one theme's lifts. Variants absent from the map get 0%, written
|
|
54
|
+
/// out, so a theme scope never inherits the other mode's value.
|
|
55
|
+
///
|
|
56
|
+
/// @param {Map} $lifts - `$light-lifts` or `$dark-lifts`
|
|
57
|
+
@mixin lifts($lifts) {
|
|
58
|
+
@each $variant in $variants {
|
|
59
|
+
--nb-c-#{$variant}-ink-lift: #{map.get($lifts, $variant) or 0%};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
24
63
|
/// @param {String} $variant - primary, secondary, success, info, warning or danger
|
|
25
64
|
/// @return {String} a `color-mix()` expression
|
|
26
65
|
/// @access public
|
|
27
|
-
/// @group @nubisco/colors
|
|
28
66
|
@function ink($variant) {
|
|
29
67
|
@return color-mix(
|
|
30
68
|
in srgb,
|
|
31
69
|
var(--nb-c-#{$variant}),
|
|
32
|
-
var(--nb-c-
|
|
70
|
+
var(--nb-c-ink-toward, var(--nb-c-white))
|
|
71
|
+
var(--nb-c-#{$variant}-ink-lift, 0%)
|
|
33
72
|
);
|
|
34
73
|
}
|