@greese/ui 1.1.0 → 1.2.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.
- package/README.md +19 -14
- package/dist/_maps.scss +1 -1
- package/dist/_tokens-base.scss +30 -6
- package/dist/_tokens.scss +31 -2
- package/dist/_utilities-table.scss +1615 -0
- package/dist/clipboard.d.ts +18 -0
- package/dist/clipboard.js +62 -0
- package/dist/css/Button.css +2 -2
- package/dist/css/Carousel.css +145 -47
- package/dist/css/Checkbox.css +2 -2
- package/dist/css/Chip.css +38 -8
- package/dist/css/ChoiceGroup.css +42 -1
- package/dist/css/Collapsible.css +1 -0
- package/dist/css/ColorPicker.css +84 -0
- package/dist/css/Combobox.css +2 -2
- package/dist/css/Dialog.css +24 -22
- package/dist/css/EditableField.css +219 -0
- package/dist/css/Input.css +11 -2
- package/dist/css/Menu.css +9 -0
- package/dist/css/NumberField.css +53 -8
- package/dist/css/NumberStepper.css +9 -0
- package/dist/css/OtpField.css +1 -1
- package/dist/css/Radio.css +2 -2
- package/dist/css/ScrollCarousel.css +225 -0
- package/dist/css/SegmentedControl.css +2 -2
- package/dist/css/Select.css +3 -2
- package/dist/css/Slider.css +45 -5
- package/dist/css/Switch.css +6 -6
- package/dist/css/Text.css +14 -14
- package/dist/css/Textarea.css +1 -1
- package/dist/css/core.css +36 -6
- package/dist/css/resets.css +162 -0
- package/dist/css.d.ts +2 -0
- package/dist/css.js +2 -0
- package/dist/greese.css +978 -138
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/scss/components/_Accordion.scss +2 -0
- package/dist/scss/components/_ActionSelect.scss +2 -0
- package/dist/scss/components/_Alert.scss +2 -0
- package/dist/scss/components/_AppBar.scss +2 -0
- package/dist/scss/components/_AspectRatio.scss +2 -0
- package/dist/scss/components/_AutoLayout.scss +2 -0
- package/dist/scss/components/_Avatar.scss +2 -0
- package/dist/scss/components/_Badge.scss +2 -0
- package/dist/scss/components/_Box.scss +2 -0
- package/dist/scss/components/_Breadcrumbs.scss +2 -0
- package/dist/scss/components/_Button.scss +2 -0
- package/dist/scss/components/_ButtonGroup.scss +2 -0
- package/dist/scss/components/_Card.scss +2 -0
- package/dist/scss/components/_Carousel.scss +2 -0
- package/dist/scss/components/_Center.scss +2 -0
- package/dist/scss/components/_ChatBubble.scss +2 -0
- package/dist/scss/components/_Checkbox.scss +2 -0
- package/dist/scss/components/_Chip.scss +2 -0
- package/dist/scss/components/_ChoiceGroup.scss +2 -0
- package/dist/scss/components/_Code.scss +2 -0
- package/dist/scss/components/_Collapsible.scss +2 -0
- package/dist/scss/components/_ColorPicker.scss +2 -0
- package/dist/scss/components/_Combobox.scss +2 -0
- package/dist/scss/components/_Container.scss +2 -0
- package/dist/scss/components/_Countdown.scss +2 -0
- package/dist/scss/components/_DateField.scss +2 -0
- package/dist/scss/components/_Dialog.scss +2 -0
- package/dist/scss/components/_Diff.scss +2 -0
- package/dist/scss/components/_Divider.scss +2 -0
- package/dist/scss/components/_Dock.scss +2 -0
- package/dist/scss/components/_EditableField.scss +2 -0
- package/dist/scss/components/_Field.scss +2 -0
- package/dist/scss/components/_Fieldset.scss +2 -0
- package/dist/scss/components/_FileInput.scss +2 -0
- package/dist/scss/components/_Footer.scss +2 -0
- package/dist/scss/components/_Grid.scss +2 -0
- package/dist/scss/components/_Header.scss +2 -0
- package/dist/scss/components/_Heading.scss +2 -0
- package/dist/scss/components/_Icon.scss +2 -0
- package/dist/scss/components/_IconButton.scss +2 -0
- package/dist/scss/components/_Image.scss +2 -0
- package/dist/scss/components/_Indicator.scss +2 -0
- package/dist/scss/components/_Input.scss +2 -0
- package/dist/scss/components/_Key.scss +2 -0
- package/dist/scss/components/_Link.scss +2 -0
- package/dist/scss/components/_List.scss +2 -0
- package/dist/scss/components/_Media.scss +2 -0
- package/dist/scss/components/_Menu.scss +2 -0
- package/dist/scss/components/_Motion.scss +2 -0
- package/dist/scss/components/_NumberField.scss +2 -0
- package/dist/scss/components/_NumberStepper.scss +2 -0
- package/dist/scss/components/_OtpField.scss +2 -0
- package/dist/scss/components/_PageTransition.scss +2 -0
- package/dist/scss/components/_Pagination.scss +2 -0
- package/dist/scss/components/_Popover.scss +2 -0
- package/dist/scss/components/_Progress.scss +2 -0
- package/dist/scss/components/_RadialProgress.scss +2 -0
- package/dist/scss/components/_Radio.scss +2 -0
- package/dist/scss/components/_Rating.scss +2 -0
- package/dist/scss/components/_ScrollCarousel.scss +2 -0
- package/dist/scss/components/_ScrollSpy.scss +2 -0
- package/dist/scss/components/_SegmentedControl.scss +2 -0
- package/dist/scss/components/_Select.scss +2 -0
- package/dist/scss/components/_Sidebar.scss +2 -0
- package/dist/scss/components/_Skeleton.scss +2 -0
- package/dist/scss/components/_Slider.scss +2 -0
- package/dist/scss/components/_Spacer.scss +2 -0
- package/dist/scss/components/_SpeedDial.scss +2 -0
- package/dist/scss/components/_Spinner.scss +2 -0
- package/dist/scss/components/_Stack.scss +2 -0
- package/dist/scss/components/_Stat.scss +2 -0
- package/dist/scss/components/_Status.scss +2 -0
- package/dist/scss/components/_Steps.scss +2 -0
- package/dist/scss/components/_Swap.scss +2 -0
- package/dist/scss/components/_Switch.scss +2 -0
- package/dist/scss/components/_Table.scss +2 -0
- package/dist/scss/components/_Tabs.scss +2 -0
- package/dist/scss/components/_Text.scss +2 -0
- package/dist/scss/components/_TextRotate.scss +2 -0
- package/dist/scss/components/_Textarea.scss +2 -0
- package/dist/scss/components/_ThemeProvider.scss +2 -0
- package/dist/scss/components/_Tile.scss +2 -0
- package/dist/scss/components/_Toast.scss +2 -0
- package/dist/scss/components/_ToggleButton.scss +2 -0
- package/dist/scss/components/_Tooltip.scss +2 -0
- package/dist/scss/components/_Type.scss +2 -0
- package/dist/scss/components/_Visibility.scss +2 -0
- package/dist/scss/components/_VisuallyHidden.scss +2 -0
- package/dist/shapes.d.ts +12 -1
- package/dist/shapes.js +11 -10
- package/dist/style-manifest.json +18830 -132
- package/dist/theme.js +6 -1
- package/dist/themeFiles/index.d.ts +9 -0
- package/dist/themeFiles/index.js +9 -0
- package/dist/themeFiles/scssModule.d.ts +100 -0
- package/dist/themeFiles/scssModule.js +384 -0
- package/dist/themeFiles/spec.d.ts +198 -0
- package/dist/themeFiles/spec.js +877 -0
- package/dist/tokens.css +30 -1
- package/dist/typography.js +1 -1
- package/dist/utilities.css +435 -0
- package/dist/utilities.d.ts +8 -0
- package/dist/utilities.js +75 -0
- package/package.json +20 -1
- package/src/components/AutoLayout/AutoLayout.scss +2 -26
- package/src/components/Carousel/Carousel.scss +122 -126
- package/src/components/Checkbox/Checkbox.scss +2 -2
- package/src/components/Chip/Chip.scss +63 -8
- package/src/components/ChoiceGroup/ChoiceGroup.scss +19 -1
- package/src/components/Collapsible/Collapsible.scss +3 -0
- package/src/components/ColorPicker/ColorPicker.scss +95 -0
- package/src/components/Combobox/Combobox.scss +4 -2
- package/src/components/Dialog/Dialog.scss +24 -7
- package/src/components/EditableField/EditableField.scss +275 -0
- package/src/components/Grid/Grid.scss +2 -70
- package/src/components/Input/Input.scss +29 -0
- package/src/components/Menu/Menu.scss +18 -0
- package/src/components/NumberField/NumberField.scss +56 -9
- package/src/components/NumberStepper/NumberStepper.scss +13 -0
- package/src/components/Radio/Radio.scss +2 -2
- package/src/components/ScrollCarousel/ScrollCarousel.scss +142 -0
- package/src/components/Select/Select.scss +4 -0
- package/src/components/Slider/Slider.scss +51 -6
- package/src/components/Stack/Stack.scss +2 -48
- package/src/components/Switch/Switch.scss +9 -6
- package/src/components/Text/Text.scss +5 -2
- package/src/styles/_breakpoint-vars.scss +17 -11
- package/src/styles/_controls.scss +2 -2
- package/src/styles/_core.scss +1 -0
- package/src/styles/_kit.scss +483 -56
- package/src/styles/_layout-props.scss +197 -0
- package/src/styles/_manifest.scss +53 -23
- package/src/styles/_mixins.scss +53 -15
- package/src/styles/_slides.scss +112 -0
- package/src/styles/_utilities.scss +104 -0
- package/src/styles/breakpoints.test.ts +21 -1
- package/src/styles/entryPoints.test.ts +25 -2
- package/src/styles/index.scss +3 -1
- package/src/styles/kit.test.ts +171 -1
- package/src/styles/public/_breakpoints.scss +43 -0
- package/src/styles/public/_slides.scss +3 -0
- package/src/styles/public/_utilities.scss +3 -0
- package/src/styles/resets.scss +7 -0
- package/src/styles/utilities.test.ts +39 -0
- package/themes/bevel.css +187 -187
- package/themes/bevel.scss +960 -958
- package/themes/extrude.css +42 -42
- package/themes/folio.css +200 -200
- package/themes/folio.scss +880 -878
- package/themes/outline.css +18 -18
- package/themes/pebble.css +8 -8
- package/themes/ridge.css +188 -188
- package/themes/ridge.scss +820 -818
- package/themes/soft.css +11 -11
- package/themes/ticket.css +180 -180
- package/themes/ticket.scss +881 -879
- package/themes/tilt.css +25 -25
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../styles/controls';
|
|
1
3
|
@use '../../styles/mixins';
|
|
2
4
|
|
|
3
5
|
// Vendor pseudo-elements are the only way to style range parts.
|
|
@@ -13,6 +15,18 @@
|
|
|
13
15
|
border-radius: var(--greese-corner-pill);
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
// The thumb's size, on the wrapper as well as the slider: a custom property
|
|
19
|
+
// inherits down, and the bubble's anchor is the slider's sibling, so reading
|
|
20
|
+
// it from the slider alone would leave the anchor's `calc()` invalid.
|
|
21
|
+
@mixin thumb-size {
|
|
22
|
+
--greese-slider-thumb: 1.25rem;
|
|
23
|
+
|
|
24
|
+
// A thumb big enough for fingers.
|
|
25
|
+
@media (pointer: coarse) {
|
|
26
|
+
--greese-slider-thumb: 1.75rem;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
16
30
|
@mixin thumb {
|
|
17
31
|
box-sizing: border-box;
|
|
18
32
|
inline-size: var(--greese-slider-thumb);
|
|
@@ -24,8 +38,44 @@
|
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
@layer greese.components {
|
|
41
|
+
// The thumb follows the control scale, so a slider in a row of inputs is
|
|
42
|
+
// the same height as they are.
|
|
43
|
+
@each $size, $spec in controls.$sizes {
|
|
44
|
+
.greese-Slider--size-#{$size} {
|
|
45
|
+
--greese-slider-thumb: calc(#{map.get($spec, height)} * 0.5);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Only present when the slider shows a value bubble, so a plain slider's
|
|
50
|
+
// markup is unchanged.
|
|
51
|
+
.greese-Slider-wrap {
|
|
52
|
+
@include thumb-size;
|
|
53
|
+
|
|
54
|
+
position: relative;
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// A zero-size anchor sitting at the centre of the thumb, so the bubble
|
|
59
|
+
// follows the value. The thumb's travel is inset by half its width at each
|
|
60
|
+
// end, which is why this is not simply the fill percentage.
|
|
61
|
+
.greese-Slider-thumbAnchor {
|
|
62
|
+
--greese-slider-travel: calc(100% - var(--greese-slider-thumb));
|
|
63
|
+
--greese-slider-offset: calc(
|
|
64
|
+
var(--greese-slider-travel) * var(--greese-slider-ratio, 0)
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset-block-start: 0;
|
|
69
|
+
inset-inline-start: calc(
|
|
70
|
+
var(--greese-slider-thumb) / 2 + var(--greese-slider-offset)
|
|
71
|
+
);
|
|
72
|
+
inline-size: 0;
|
|
73
|
+
block-size: var(--greese-slider-thumb);
|
|
74
|
+
}
|
|
75
|
+
|
|
27
76
|
.greese-Slider {
|
|
28
|
-
|
|
77
|
+
@include thumb-size;
|
|
78
|
+
|
|
29
79
|
--greese-slider-towards: right;
|
|
30
80
|
|
|
31
81
|
@include mixins.component-root;
|
|
@@ -42,11 +92,6 @@
|
|
|
42
92
|
--greese-slider-towards: left;
|
|
43
93
|
}
|
|
44
94
|
|
|
45
|
-
// A thumb big enough for fingers.
|
|
46
|
-
@media (pointer: coarse) {
|
|
47
|
-
--greese-slider-thumb: 1.75rem;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
95
|
&:focus-visible {
|
|
51
96
|
outline: none;
|
|
52
97
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '../../styles/
|
|
1
|
+
@use '../../styles/layout-props';
|
|
2
2
|
|
|
3
3
|
@layer greese.components {
|
|
4
4
|
.greese-Stack {
|
|
@@ -7,51 +7,5 @@
|
|
|
7
7
|
min-inline-size: 0;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
@include
|
|
11
|
-
'greese-Stack',
|
|
12
|
-
'direction',
|
|
13
|
-
flex-direction,
|
|
14
|
-
(
|
|
15
|
-
row: row,
|
|
16
|
-
column: column,
|
|
17
|
-
row-reverse: row-reverse,
|
|
18
|
-
column-reverse: column-reverse,
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
@include mixins.responsive-prop('greese-Stack', 'gap', gap, mixins.space-tokens());
|
|
22
|
-
@include mixins.responsive-prop(
|
|
23
|
-
'greese-Stack',
|
|
24
|
-
'align',
|
|
25
|
-
align-items,
|
|
26
|
-
(
|
|
27
|
-
start: flex-start,
|
|
28
|
-
center: center,
|
|
29
|
-
end: flex-end,
|
|
30
|
-
stretch: stretch,
|
|
31
|
-
baseline: baseline,
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
@include mixins.responsive-prop(
|
|
35
|
-
'greese-Stack',
|
|
36
|
-
'justify',
|
|
37
|
-
justify-content,
|
|
38
|
-
(
|
|
39
|
-
start: flex-start,
|
|
40
|
-
center: center,
|
|
41
|
-
end: flex-end,
|
|
42
|
-
between: space-between,
|
|
43
|
-
around: space-around,
|
|
44
|
-
evenly: space-evenly,
|
|
45
|
-
)
|
|
46
|
-
);
|
|
47
|
-
@include mixins.responsive-prop(
|
|
48
|
-
'greese-Stack',
|
|
49
|
-
'wrap',
|
|
50
|
-
flex-wrap,
|
|
51
|
-
(
|
|
52
|
-
wrap: wrap,
|
|
53
|
-
nowrap: nowrap,
|
|
54
|
-
wrap-reverse: wrap-reverse,
|
|
55
|
-
)
|
|
56
|
-
);
|
|
10
|
+
@include layout-props.stack;
|
|
57
11
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
flex-shrink: 0;
|
|
8
8
|
align-items: center;
|
|
9
|
-
inline-size: 2
|
|
10
|
-
block-size: 1.
|
|
9
|
+
inline-size: calc(var(--greese-choice-box, 1.125rem) * 2);
|
|
10
|
+
block-size: calc(var(--greese-choice-box, 1.125rem) * 1.111);
|
|
11
11
|
margin-block: calc((1lh - 1.25rem) / 2);
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
|
|
44
44
|
.greese-Switch-thumb {
|
|
45
45
|
position: relative;
|
|
46
|
-
inline-size:
|
|
47
|
-
block-size:
|
|
46
|
+
inline-size: calc(var(--greese-choice-box, 1.125rem) * 0.889);
|
|
47
|
+
block-size: calc(var(--greese-choice-box, 1.125rem) * 0.889);
|
|
48
48
|
margin-inline-start: 0.125rem;
|
|
49
49
|
pointer-events: none;
|
|
50
50
|
background-color: var(--greese-color-canvas);
|
|
@@ -53,11 +53,14 @@
|
|
|
53
53
|
transition: translate var(--greese-duration-fast) var(--greese-easing-standard);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// The track's width less the thumb and a margin each side (the thumb is
|
|
57
|
+
// 0.889 of a box and the track 2), so it ends inside the track at every
|
|
58
|
+
// size: a fixed 1rem overshot the small one.
|
|
56
59
|
.greese-Switch-input:checked + .greese-Switch-thumb {
|
|
57
|
-
translate:
|
|
60
|
+
translate: calc(125% - 0.25rem) 0;
|
|
58
61
|
|
|
59
62
|
&:dir(rtl) {
|
|
60
|
-
translate: -
|
|
63
|
+
translate: calc(0.25rem - 125%) 0;
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
margin: 0;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
// Doubled with `.greese-Text` to beat the type variant every Text carries
|
|
10
|
+
// (`greese-Type--p1` when none is named), which comes later and sets weight
|
|
11
|
+
// and colour too. Text only renders a weight with no variant named.
|
|
9
12
|
@each $weight in (regular, medium, semibold, bold) {
|
|
10
|
-
.greese-Text--#{$weight} {
|
|
13
|
+
.greese-Text.greese-Text--#{$weight} {
|
|
11
14
|
font-weight: var(--greese-font-weight-#{$weight});
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
@each $tone, $pair in tones.$tones {
|
|
16
|
-
.greese-Text--#{$tone} {
|
|
19
|
+
.greese-Text.greese-Text--#{$tone} {
|
|
17
20
|
color: list.nth($pair, 1);
|
|
18
21
|
}
|
|
19
22
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// The breakpoints the stylesheet is built with, as custom properties for CSS
|
|
2
|
+
// and JavaScript to read: `--greese-breakpoint-md: 900px`, and the keys in
|
|
3
|
+
// order, `--greese-breakpoint-keys: xs sm md lg xl`, which
|
|
4
|
+
// `configureBreakpoints()` reads. Media queries can't use them, so they're
|
|
5
|
+
// written once, here, from the configured breakpoints.
|
|
6
|
+
@use 'sass:list';
|
|
7
|
+
@use 'sass:map';
|
|
5
8
|
@use 'config';
|
|
6
|
-
@use '../../dist/maps' as defaults;
|
|
7
9
|
|
|
8
|
-
@
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
--greese-breakpoint-#{$key}: #{$min};
|
|
13
|
-
}
|
|
10
|
+
@layer greese.tokens {
|
|
11
|
+
:root {
|
|
12
|
+
@each $key, $min in config.$breakpoints {
|
|
13
|
+
--greese-breakpoint-#{$key}: #{$min};
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
--greese-breakpoint-keys: #{list.join(
|
|
17
|
+
map.keys(config.$breakpoints),
|
|
18
|
+
(),
|
|
19
|
+
$separator: space
|
|
20
|
+
)};
|
|
15
21
|
}
|
|
16
22
|
}
|