@greese/ui 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +55 -2
- package/bin/greese-utilities.mjs +56 -0
- package/dist/_layers.scss +2 -0
- package/dist/_maps.scss +1884 -0
- package/dist/_tokens-base.scss +174 -0
- package/dist/_tokens.scss +2140 -0
- package/dist/base.css +67 -0
- package/dist/colorScheme.d.ts +16 -0
- package/dist/colorScheme.js +13 -0
- package/dist/contrast.d.ts +15 -0
- package/dist/contrast.js +43 -0
- package/dist/css/Accordion.css +9 -0
- package/dist/css/ActionSelect.css +6 -0
- package/dist/css/Alert.css +84 -0
- package/dist/css/AppBar.css +35 -0
- package/dist/css/AspectRatio.css +40 -0
- package/dist/css/AutoLayout.css +508 -0
- package/dist/css/Avatar.css +88 -0
- package/dist/css/Badge.css +66 -0
- package/dist/css/Box.css +640 -0
- package/dist/css/Breadcrumbs.css +57 -0
- package/dist/css/Button.css +275 -0
- package/dist/css/ButtonGroup.css +40 -0
- package/dist/css/Card.css +101 -0
- package/dist/css/Carousel.css +170 -0
- package/dist/css/Center.css +11 -0
- package/dist/css/ChatBubble.css +128 -0
- package/dist/css/Checkbox.css +65 -0
- package/dist/css/Chip.css +124 -0
- package/dist/css/ChoiceGroup.css +57 -0
- package/dist/css/Code.css +29 -0
- package/dist/css/Collapsible.css +126 -0
- package/dist/css/ColorPicker.css +191 -0
- package/dist/css/Combobox.css +90 -0
- package/dist/css/Container.css +30 -0
- package/dist/css/Countdown.css +25 -0
- package/dist/css/DateField.css +15 -0
- package/dist/css/Dialog.css +640 -0
- package/dist/css/Diff.css +103 -0
- package/dist/css/Divider.css +19 -0
- package/dist/css/Dock.css +91 -0
- package/dist/css/Field.css +33 -0
- package/dist/css/Fieldset.css +54 -0
- package/dist/css/FileInput.css +65 -0
- package/dist/css/Footer.css +72 -0
- package/dist/css/Grid.css +998 -0
- package/dist/css/Header.css +89 -0
- package/dist/css/Heading.css +6 -0
- package/dist/css/Icon.css +12 -0
- package/dist/css/IconButton.css +7 -0
- package/dist/css/Image.css +69 -0
- package/dist/css/Indicator.css +41 -0
- package/dist/css/Input.css +115 -0
- package/dist/css/Key.css +42 -0
- package/dist/css/Link.css +72 -0
- package/dist/css/List.css +52 -0
- package/dist/css/Media.css +8 -0
- package/dist/css/Menu.css +161 -0
- package/dist/css/Motion.css +1356 -0
- package/dist/css/NumberField.css +49 -0
- package/dist/css/OtpField.css +90 -0
- package/dist/css/PageTransition.css +979 -0
- package/dist/css/Pagination.css +43 -0
- package/dist/css/Popover.css +93 -0
- package/dist/css/Progress.css +101 -0
- package/dist/css/RadialProgress.css +44 -0
- package/dist/css/Radio.css +41 -0
- package/dist/css/Rating.css +100 -0
- package/dist/css/ScrollSpy.css +6 -0
- package/dist/css/SegmentedControl.css +101 -0
- package/dist/css/Select.css +115 -0
- package/dist/css/Sidebar.css +207 -0
- package/dist/css/Skeleton.css +48 -0
- package/dist/css/Slider.css +75 -0
- package/dist/css/Spacer.css +34 -0
- package/dist/css/SpeedDial.css +165 -0
- package/dist/css/Spinner.css +44 -0
- package/dist/css/Stack.css +528 -0
- package/dist/css/Stat.css +107 -0
- package/dist/css/Status.css +86 -0
- package/dist/css/Steps.css +201 -0
- package/dist/css/Swap.css +49 -0
- package/dist/css/Switch.css +66 -0
- package/dist/css/Table.css +269 -0
- package/dist/css/Tabs.css +119 -0
- package/dist/css/Text.css +60 -0
- package/dist/css/TextRotate.css +147 -0
- package/dist/css/Textarea.css +107 -0
- package/dist/css/ThemeProvider.css +6 -0
- package/dist/css/Tile.css +18 -0
- package/dist/css/Toast.css +110 -0
- package/dist/css/ToggleButton.css +20 -0
- package/dist/css/Tooltip.css +94 -0
- package/dist/css/Type.css +211 -0
- package/dist/css/Visibility.css +78 -0
- package/dist/css/VisuallyHidden.css +15 -0
- package/dist/css/core.css +251 -0
- package/dist/css.d.ts +29 -0
- package/dist/css.js +28 -0
- package/dist/effect-classes.d.ts +8 -0
- package/dist/effect-classes.js +5 -0
- package/dist/effects/css.d.ts +71 -0
- package/dist/effects/css.js +184 -0
- package/dist/effects/definitions.d.ts +555 -0
- package/dist/effects/definitions.js +379 -0
- package/dist/effects/frames.d.ts +18 -0
- package/dist/effects/frames.js +68 -0
- package/dist/effects/sequence.d.ts +33 -0
- package/dist/effects/sequence.js +106 -0
- package/dist/effects.d.ts +30 -0
- package/dist/effects.js +30 -0
- package/dist/greese.css +11907 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/kebab.d.ts +2 -0
- package/dist/kebab.js +2 -0
- package/dist/palette.css +249 -0
- package/dist/palette.d.ts +599 -0
- package/dist/palette.js +334 -0
- package/dist/shapes.d.ts +193 -0
- package/dist/shapes.js +852 -0
- package/dist/storage.d.ts +47 -0
- package/dist/storage.js +118 -0
- package/dist/style-manifest.json +3010 -0
- package/dist/theme.d.ts +71 -0
- package/dist/theme.js +180 -0
- package/dist/tokens.css +253 -0
- package/dist/tokens.d.ts +343 -0
- package/dist/tokens.js +179 -0
- package/dist/typography.d.ts +55 -0
- package/dist/typography.js +144 -0
- package/dist/utilities.css +6975 -0
- package/dist/utilities.d.ts +82 -0
- package/dist/utilities.js +636 -0
- package/dist/utilitiesFiles.d.ts +18 -0
- package/dist/utilitiesFiles.js +26 -0
- package/dist/vite.d.ts +40 -0
- package/dist/vite.js +43 -0
- package/package.json +131 -4
- package/src/components/Accordion/Accordion.scss +9 -0
- package/src/components/ActionSelect/ActionSelect.scss +6 -0
- package/src/components/Alert/Alert.scss +71 -0
- package/src/components/AppBar/AppBar.scss +43 -0
- package/src/components/AspectRatio/AspectRatio.scss +22 -0
- package/src/components/AutoLayout/AutoLayout.scss +90 -0
- package/src/components/Avatar/Avatar.scss +91 -0
- package/src/components/Badge/Badge.scss +52 -0
- package/src/components/Box/Box.scss +63 -0
- package/src/components/Breadcrumbs/Breadcrumbs.scss +59 -0
- package/src/components/Button/Button.scss +231 -0
- package/src/components/ButtonGroup/ButtonGroup.scss +56 -0
- package/src/components/Card/Card.scss +99 -0
- package/src/components/Carousel/Carousel.scss +161 -0
- package/src/components/Center/Center.scss +11 -0
- package/src/components/ChatBubble/ChatBubble.scss +119 -0
- package/src/components/Checkbox/Checkbox.scss +66 -0
- package/src/components/Chip/Chip.scss +119 -0
- package/src/components/ChoiceGroup/ChoiceGroup.scss +69 -0
- package/src/components/Code/Code.scss +28 -0
- package/src/components/Collapsible/Collapsible.scss +136 -0
- package/src/components/ColorPicker/ColorPicker.scss +235 -0
- package/src/components/Combobox/Combobox.scss +83 -0
- package/src/components/Container/Container.scss +28 -0
- package/src/components/Countdown/Countdown.scss +28 -0
- package/src/components/DateField/DateField.scss +19 -0
- package/src/components/Dialog/Dialog.scss +268 -0
- package/src/components/Diff/Diff.scss +125 -0
- package/src/components/Divider/Divider.scss +22 -0
- package/src/components/Dock/Dock.scss +86 -0
- package/src/components/Field/Field.scss +38 -0
- package/src/components/Fieldset/Fieldset.scss +63 -0
- package/src/components/FileInput/FileInput.scss +66 -0
- package/src/components/Footer/Footer.scss +79 -0
- package/src/components/Grid/Grid.scss +86 -0
- package/src/components/Header/Header.scss +111 -0
- package/src/components/Heading/Heading.scss +7 -0
- package/src/components/Icon/Icon.scss +12 -0
- package/src/components/IconButton/IconButton.scss +6 -0
- package/src/components/Image/Image.scss +46 -0
- package/src/components/Indicator/Indicator.scss +48 -0
- package/src/components/Input/Input.scss +58 -0
- package/src/components/Key/Key.scss +48 -0
- package/src/components/Link/Link.scss +50 -0
- package/src/components/List/List.scss +62 -0
- package/src/components/Media/Media.scss +7 -0
- package/src/components/Menu/Menu.scss +91 -0
- package/src/components/Motion/Motion.scss +106 -0
- package/src/components/NumberField/NumberField.scss +44 -0
- package/src/components/OtpField/OtpField.scss +91 -0
- package/src/components/PageTransition/PageTransition.scss +168 -0
- package/src/components/Pagination/Pagination.scss +55 -0
- package/src/components/Popover/Popover.scss +13 -0
- package/src/components/Progress/Progress.scss +126 -0
- package/src/components/RadialProgress/RadialProgress.scss +65 -0
- package/src/components/Radio/Radio.scss +36 -0
- package/src/components/Rating/Rating.scss +121 -0
- package/src/components/ScrollSpy/ScrollSpy.scss +6 -0
- package/src/components/SegmentedControl/SegmentedControl.scss +107 -0
- package/src/components/Select/Select.scss +59 -0
- package/src/components/Sidebar/Sidebar.scss +88 -0
- package/src/components/Skeleton/Skeleton.scss +60 -0
- package/src/components/Slider/Slider.scss +96 -0
- package/src/components/Spacer/Spacer.scss +15 -0
- package/src/components/SpeedDial/SpeedDial.scss +109 -0
- package/src/components/Spinner/Spinner.scss +43 -0
- package/src/components/Stack/Stack.scss +57 -0
- package/src/components/Stat/Stat.scss +96 -0
- package/src/components/Status/Status.scss +60 -0
- package/src/components/Steps/Steps.scss +216 -0
- package/src/components/Swap/Swap.scss +62 -0
- package/src/components/Switch/Switch.scss +63 -0
- package/src/components/Table/Table.scss +183 -0
- package/src/components/Tabs/Tabs.scss +108 -0
- package/src/components/Text/Text.scss +34 -0
- package/src/components/TextRotate/TextRotate.scss +51 -0
- package/src/components/Textarea/Textarea.scss +56 -0
- package/src/components/ThemeProvider/ThemeProvider.scss +7 -0
- package/src/components/Tile/Tile.scss +23 -0
- package/src/components/Toast/Toast.scss +93 -0
- package/src/components/ToggleButton/ToggleButton.scss +23 -0
- package/src/components/Tooltip/Tooltip.scss +21 -0
- package/src/components/Type/Type.scss +35 -0
- package/src/components/Visibility/Visibility.scss +39 -0
- package/src/components/VisuallyHidden/VisuallyHidden.scss +17 -0
- package/src/styles/_breakpoint-vars.scss +16 -0
- package/src/styles/_config.scss +48 -0
- package/src/styles/_controls.scss +88 -0
- package/src/styles/_core.scss +4 -0
- package/src/styles/_effect.scss +51 -0
- package/src/styles/_floating.scss +141 -0
- package/src/styles/_kit.scss +1548 -0
- package/src/styles/_manifest.scss +670 -0
- package/src/styles/_mixins.scss +261 -0
- package/src/styles/_tones.scss +63 -0
- package/src/styles/_type-emit.scss +76 -0
- package/src/styles/_typography-vars.scss +8 -0
- package/src/styles/base.scss +80 -0
- package/src/styles/breakpoints.test.ts +73 -0
- package/src/styles/entryPoints.test.ts +68 -0
- package/src/styles/index.scss +93 -0
- package/src/styles/kit.test.ts +754 -0
- package/src/styles/public/_controls.scss +3 -0
- package/src/styles/public/_floating.scss +3 -0
- package/src/styles/public/_mixins.scss +5 -0
- package/src/styles/public/_tones.scss +4 -0
- package/themes/bevel.css +1077 -0
- package/themes/bevel.scss +1166 -0
- package/themes/depth.css +123 -0
- package/themes/depth.scss +46 -0
- package/themes/extrude.css +219 -0
- package/themes/extrude.scss +255 -0
- package/themes/folio.css +986 -0
- package/themes/folio.scss +1047 -0
- package/themes/gentle.css +66 -0
- package/themes/gentle.scss +39 -0
- package/themes/outline.css +127 -0
- package/themes/outline.scss +126 -0
- package/themes/pebble.css +65 -0
- package/themes/pebble.scss +69 -0
- package/themes/pocket.css +137 -0
- package/themes/pocket.scss +45 -0
- package/themes/ridge.css +927 -0
- package/themes/ridge.scss +998 -0
- package/themes/snappy.css +82 -0
- package/themes/snappy.scss +40 -0
- package/themes/soft.css +79 -0
- package/themes/soft.scss +84 -0
- package/themes/ticket.css +960 -0
- package/themes/ticket.scss +1031 -0
- package/themes/tilt.css +148 -0
- package/themes/tilt.scss +169 -0
- package/themes/wipe.css +186 -0
- package/themes/wipe.scss +46 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
@use '../../styles/mixins';
|
|
2
|
+
|
|
3
|
+
/* stylelint-disable selector-no-vendor-prefix */
|
|
4
|
+
|
|
5
|
+
// A color picker paints literal colors, whatever the theme: the hue
|
|
6
|
+
// spectrum, the white and black ramps over it, and a transparency checkerboard.
|
|
7
|
+
/* stylelint-disable color-no-hex, function-disallowed-list */
|
|
8
|
+
|
|
9
|
+
// A checkerboard, so transparency is visible.
|
|
10
|
+
$checker: repeating-conic-gradient(#c8ccd2 0% 25%, #fff 0% 50%) 0 0 / 0.75rem 0.75rem;
|
|
11
|
+
|
|
12
|
+
@mixin channel-thumb {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
inline-size: var(--greese-colorpicker-thumb);
|
|
15
|
+
block-size: var(--greese-colorpicker-thumb);
|
|
16
|
+
background: transparent;
|
|
17
|
+
border: 3px solid #fff;
|
|
18
|
+
border-radius: var(--greese-corner-round);
|
|
19
|
+
box-shadow:
|
|
20
|
+
0 0 0 1px color-mix(in srgb, var(--greese-color-black) 35%, transparent),
|
|
21
|
+
var(--greese-shadow-sm);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@layer greese.components {
|
|
25
|
+
.greese-ColorPicker {
|
|
26
|
+
--greese-colorpicker-thumb: 1.125rem;
|
|
27
|
+
|
|
28
|
+
@include mixins.component-root;
|
|
29
|
+
|
|
30
|
+
display: grid;
|
|
31
|
+
gap: var(--greese-space-3);
|
|
32
|
+
inline-size: min(100%, 18rem);
|
|
33
|
+
color: var(--greese-color-fg);
|
|
34
|
+
|
|
35
|
+
@media (pointer: coarse) {
|
|
36
|
+
--greese-colorpicker-thumb: 1.5rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-disabled] {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
opacity: 0.55;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.greese-ColorPicker-area {
|
|
46
|
+
position: relative;
|
|
47
|
+
aspect-ratio: 4 / 3;
|
|
48
|
+
cursor: crosshair;
|
|
49
|
+
background:
|
|
50
|
+
linear-gradient(to top, #000, transparent),
|
|
51
|
+
linear-gradient(to right, #fff, transparent),
|
|
52
|
+
hsl(var(--greese-colorpicker-hue) 100% 50%);
|
|
53
|
+
border-radius: var(--greese-corner-panel);
|
|
54
|
+
box-shadow: inset 0 0 0 1px
|
|
55
|
+
color-mix(in srgb, var(--greese-color-black) 10%, transparent);
|
|
56
|
+
|
|
57
|
+
// The page must not scroll while a finger drags the thumb.
|
|
58
|
+
touch-action: none;
|
|
59
|
+
|
|
60
|
+
&:focus-visible {
|
|
61
|
+
outline: 2px solid var(--greese-color-focus-ring);
|
|
62
|
+
outline-offset: 2px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[data-disabled] > & {
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.greese-ColorPicker-thumb {
|
|
71
|
+
@include channel-thumb;
|
|
72
|
+
|
|
73
|
+
position: absolute;
|
|
74
|
+
inset-block-start: var(--greese-colorpicker-y);
|
|
75
|
+
inset-inline-start: var(--greese-colorpicker-x);
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
background: var(--greese-colorpicker-color);
|
|
78
|
+
translate: -50% -50%;
|
|
79
|
+
|
|
80
|
+
&:dir(rtl) {
|
|
81
|
+
translate: 50% -50%;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.greese-ColorPicker-controls {
|
|
86
|
+
display: flex;
|
|
87
|
+
gap: var(--greese-space-3);
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.greese-ColorPicker-preview {
|
|
92
|
+
flex: none;
|
|
93
|
+
inline-size: 2.25rem;
|
|
94
|
+
block-size: 2.25rem;
|
|
95
|
+
background:
|
|
96
|
+
linear-gradient(
|
|
97
|
+
var(--greese-colorpicker-current),
|
|
98
|
+
var(--greese-colorpicker-current)
|
|
99
|
+
),
|
|
100
|
+
$checker;
|
|
101
|
+
border-radius: var(--greese-corner-round);
|
|
102
|
+
|
|
103
|
+
// The theme's border, so dark swatches stay visible on dark surfaces.
|
|
104
|
+
box-shadow: inset 0 0 0 1px var(--greese-color-border-strong);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.greese-ColorPicker-sliders {
|
|
108
|
+
display: grid;
|
|
109
|
+
flex: 1;
|
|
110
|
+
gap: var(--greese-space-3);
|
|
111
|
+
min-inline-size: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.greese-ColorPicker-hue,
|
|
115
|
+
.greese-ColorPicker-alpha {
|
|
116
|
+
--greese-colorpicker-track: linear-gradient(
|
|
117
|
+
to right,
|
|
118
|
+
#f00,
|
|
119
|
+
#ff0 17%,
|
|
120
|
+
#0f0 33%,
|
|
121
|
+
#0ff 50%,
|
|
122
|
+
#00f 67%,
|
|
123
|
+
#f0f 83%,
|
|
124
|
+
#f00
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
display: block;
|
|
128
|
+
inline-size: 100%;
|
|
129
|
+
block-size: var(--greese-colorpicker-thumb);
|
|
130
|
+
margin: 0;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
background: none;
|
|
133
|
+
appearance: none;
|
|
134
|
+
|
|
135
|
+
&::-webkit-slider-runnable-track {
|
|
136
|
+
block-size: 0.75rem;
|
|
137
|
+
background: var(--greese-colorpicker-track);
|
|
138
|
+
border-radius: var(--greese-corner-pill);
|
|
139
|
+
box-shadow: inset 0 0 0 1px
|
|
140
|
+
color-mix(in srgb, var(--greese-color-black) 10%, transparent);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&::-moz-range-track {
|
|
144
|
+
block-size: 0.75rem;
|
|
145
|
+
background: var(--greese-colorpicker-track);
|
|
146
|
+
border-radius: var(--greese-corner-pill);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&::-webkit-slider-thumb {
|
|
150
|
+
@include channel-thumb;
|
|
151
|
+
|
|
152
|
+
margin-block-start: calc((0.75rem - var(--greese-colorpicker-thumb)) / 2);
|
|
153
|
+
appearance: none;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&::-moz-range-thumb {
|
|
157
|
+
@include channel-thumb;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:focus-visible {
|
|
161
|
+
outline: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:focus-visible::-webkit-slider-thumb {
|
|
165
|
+
outline: 2px solid var(--greese-color-focus-ring);
|
|
166
|
+
outline-offset: 2px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:focus-visible::-moz-range-thumb {
|
|
170
|
+
outline: 2px solid var(--greese-color-focus-ring);
|
|
171
|
+
outline-offset: 2px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:disabled {
|
|
175
|
+
cursor: not-allowed;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.greese-ColorPicker-alpha {
|
|
180
|
+
--greese-colorpicker-track:
|
|
181
|
+
linear-gradient(to right, transparent, var(--greese-colorpicker-color)), #{$checker};
|
|
182
|
+
|
|
183
|
+
// Hue and opacity run left to right in every direction: they're scales,
|
|
184
|
+
// not reading order.
|
|
185
|
+
direction: ltr;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.greese-ColorPicker-hue {
|
|
189
|
+
direction: ltr;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.greese-ColorPicker-hex {
|
|
193
|
+
font-family: var(--greese-font-mono);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.greese-ColorPicker-swatches {
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-wrap: wrap;
|
|
199
|
+
gap: var(--greese-space-2);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.greese-ColorPicker-swatch {
|
|
203
|
+
inline-size: 1.75rem;
|
|
204
|
+
block-size: 1.75rem;
|
|
205
|
+
padding: 0;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
background:
|
|
208
|
+
linear-gradient(var(--greese-colorpicker-swatch), var(--greese-colorpicker-swatch)),
|
|
209
|
+
$checker;
|
|
210
|
+
border: 0;
|
|
211
|
+
border-radius: var(--greese-corner-inset);
|
|
212
|
+
|
|
213
|
+
// The theme's border, so dark swatches stay visible on dark surfaces.
|
|
214
|
+
box-shadow: inset 0 0 0 1px var(--greese-color-border-strong);
|
|
215
|
+
|
|
216
|
+
@media (pointer: coarse) {
|
|
217
|
+
inline-size: 2.25rem;
|
|
218
|
+
block-size: 2.25rem;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&[aria-pressed='true'] {
|
|
222
|
+
outline: 2px solid var(--greese-color-fg);
|
|
223
|
+
outline-offset: 2px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&:focus-visible {
|
|
227
|
+
outline: 2px solid var(--greese-color-focus-ring);
|
|
228
|
+
outline-offset: 2px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:disabled {
|
|
232
|
+
cursor: not-allowed;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
@use '../../styles/floating';
|
|
2
|
+
@use '../../styles/mixins';
|
|
3
|
+
|
|
4
|
+
@layer greese.components {
|
|
5
|
+
.greese-Combobox-toggle {
|
|
6
|
+
@include mixins.touch-target;
|
|
7
|
+
|
|
8
|
+
position: relative;
|
|
9
|
+
display: inline-grid;
|
|
10
|
+
place-items: center;
|
|
11
|
+
inline-size: 1.75rem;
|
|
12
|
+
block-size: 1.75rem;
|
|
13
|
+
padding: 0;
|
|
14
|
+
margin-inline-end: calc(-1 * var(--greese-space-2));
|
|
15
|
+
color: var(--greese-color-fg-muted);
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
background: none;
|
|
18
|
+
border: 0;
|
|
19
|
+
border-radius: var(--greese-corner-inset);
|
|
20
|
+
|
|
21
|
+
> svg {
|
|
22
|
+
inline-size: 1rem;
|
|
23
|
+
block-size: 1rem;
|
|
24
|
+
rotate: -90deg;
|
|
25
|
+
transition: rotate var(--greese-duration-fast) var(--greese-easing-standard);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&[data-open] > svg {
|
|
29
|
+
rotate: 90deg;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.greese-Combobox-popup {
|
|
34
|
+
@include floating.anchored;
|
|
35
|
+
@include floating.surface;
|
|
36
|
+
|
|
37
|
+
max-inline-size: min(28rem, 100vw - 2 * var(--greese-space-3));
|
|
38
|
+
max-block-size: min(18rem, 50dvh);
|
|
39
|
+
padding: var(--greese-space-1);
|
|
40
|
+
overscroll-behavior: contain;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.greese-Combobox-list {
|
|
44
|
+
padding: 0;
|
|
45
|
+
margin: 0;
|
|
46
|
+
list-style: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.greese-Combobox-option {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
min-block-size: 2.25rem;
|
|
53
|
+
padding-inline: var(--greese-space-3);
|
|
54
|
+
font-size: var(--greese-type-p3-font-size);
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
border-radius: var(--greese-corner-inset);
|
|
57
|
+
|
|
58
|
+
&[data-active] {
|
|
59
|
+
background-color: color-mix(in oklab, var(--greese-color-fg) 8%, transparent);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&[aria-selected='true'] {
|
|
63
|
+
font-weight: var(--greese-font-weight-semibold);
|
|
64
|
+
color: var(--greese-color-primary);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&[aria-disabled='true'] {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (pointer: coarse) {
|
|
73
|
+
min-block-size: 2.75rem;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.greese-Combobox-empty {
|
|
78
|
+
padding: var(--greese-space-2) var(--greese-space-3);
|
|
79
|
+
margin: 0;
|
|
80
|
+
font-size: var(--greese-type-p3-font-size);
|
|
81
|
+
color: var(--greese-color-fg-muted);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../styles/mixins';
|
|
3
|
+
|
|
4
|
+
@layer greese.components {
|
|
5
|
+
.greese-Container {
|
|
6
|
+
inline-size: 100%;
|
|
7
|
+
margin-inline: auto;
|
|
8
|
+
|
|
9
|
+
// Safe areas are physical (notch on the left or right in landscape).
|
|
10
|
+
padding-right: max(var(--greese-space-4), env(safe-area-inset-right));
|
|
11
|
+
padding-left: max(var(--greese-space-4), env(safe-area-inset-left));
|
|
12
|
+
|
|
13
|
+
@include mixins.up(md) {
|
|
14
|
+
padding-right: max(var(--greese-space-6), env(safe-area-inset-right));
|
|
15
|
+
padding-left: max(var(--greese-space-6), env(safe-area-inset-left));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@each $size in (sm, md, lg, xl) {
|
|
20
|
+
.greese-Container--size-#{$size} {
|
|
21
|
+
max-inline-size: map.get(mixins.$breakpoints, $size);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.greese-Container--size-full {
|
|
26
|
+
max-inline-size: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@layer greese.components {
|
|
2
|
+
.greese-Countdown {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
gap: 0.35em;
|
|
5
|
+
align-items: baseline;
|
|
6
|
+
font-variant-numeric: tabular-nums;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.greese-Countdown--clock {
|
|
10
|
+
gap: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.greese-Countdown-unit {
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: baseline;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.greese-Countdown-separator {
|
|
19
|
+
padding-inline: 0.1em;
|
|
20
|
+
opacity: 0.6;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.greese-Countdown-label {
|
|
24
|
+
margin-inline-start: 0.1em;
|
|
25
|
+
font-size: 0.7em;
|
|
26
|
+
color: var(--greese-color-fg-muted);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Vendor pseudo-elements are the only way to reach native date input parts.
|
|
2
|
+
/* stylelint-disable selector-no-vendor-prefix */
|
|
3
|
+
|
|
4
|
+
@layer greese.components {
|
|
5
|
+
.greese-DateField .greese-Input-control {
|
|
6
|
+
// iOS collapses an empty date input and centres its text.
|
|
7
|
+
min-block-size: 1.5em;
|
|
8
|
+
text-align: start;
|
|
9
|
+
|
|
10
|
+
&::-webkit-date-and-time-value {
|
|
11
|
+
text-align: start;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&::-webkit-calendar-picker-indicator {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
opacity: 0.7;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use '../../styles/floating';
|
|
4
|
+
@use '../../styles/mixins';
|
|
5
|
+
|
|
6
|
+
$widths: (
|
|
7
|
+
sm: 24rem,
|
|
8
|
+
md: 32rem,
|
|
9
|
+
lg: 48rem,
|
|
10
|
+
xl: 74rem,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
@layer greese.components {
|
|
14
|
+
// Scroll lock: the page stops scrolling while a modal is open. The
|
|
15
|
+
// scrollbar goes, rather than leaving a reserved gutter: browsers clip the
|
|
16
|
+
// top layer at a gutter, which left an undimmed strip and a gap beside end
|
|
17
|
+
// drawers wherever scrollbars always show. Padding by the scrollbar's width
|
|
18
|
+
// (measured on open) keeps the page from shifting.
|
|
19
|
+
:root:has(.greese-Dialog:modal) {
|
|
20
|
+
padding-inline-end: var(--greese-scrollbar-gap, 0);
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.greese-Dialog {
|
|
25
|
+
@include mixins.component-root;
|
|
26
|
+
@include floating.surface;
|
|
27
|
+
@include floating.enter-exit('[open]', 0 0.5rem);
|
|
28
|
+
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--greese-space-3);
|
|
31
|
+
inline-size: min(
|
|
32
|
+
var(--greese-dialog-width, 32rem),
|
|
33
|
+
100vw - 2 * var(--greese-space-4)
|
|
34
|
+
);
|
|
35
|
+
max-inline-size: none;
|
|
36
|
+
max-block-size: calc(100dvh - 2 * var(--greese-space-4));
|
|
37
|
+
padding: var(--greese-space-5);
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
border-radius: var(--greese-corner-surface);
|
|
40
|
+
|
|
41
|
+
&[open] {
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// The scrim moves as the theme says too: it arrives with
|
|
46
|
+
// the theme's `backdrop` role (the base theme fades it in) and stays
|
|
47
|
+
// rendered for the theme's exit while it fades out.
|
|
48
|
+
&::backdrop {
|
|
49
|
+
background-color: var(--greese-color-scrim);
|
|
50
|
+
opacity: 0;
|
|
51
|
+
transition-property: opacity, display, overlay;
|
|
52
|
+
transition-duration: var(
|
|
53
|
+
--greese-motion-exit-duration,
|
|
54
|
+
var(--greese-duration-normal)
|
|
55
|
+
);
|
|
56
|
+
transition-timing-function: var(
|
|
57
|
+
--greese-motion-exit-ease,
|
|
58
|
+
var(--greese-easing-exit)
|
|
59
|
+
);
|
|
60
|
+
transition-behavior: allow-discrete;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&[open]::backdrop {
|
|
64
|
+
opacity: 1;
|
|
65
|
+
|
|
66
|
+
@include mixins.motion-safe {
|
|
67
|
+
@include mixins.role-entrance(
|
|
68
|
+
backdrop,
|
|
69
|
+
greese-backdrop-in,
|
|
70
|
+
normal,
|
|
71
|
+
var(--greese-easing-standard)
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@each $size, $width in $widths {
|
|
78
|
+
.greese-Dialog--size-#{$size} {
|
|
79
|
+
--greese-dialog-width: #{$width};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.greese-Dialog--size-full {
|
|
84
|
+
inline-size: 100vw;
|
|
85
|
+
max-block-size: 100dvh;
|
|
86
|
+
block-size: 100dvh;
|
|
87
|
+
padding-block: max(var(--greese-space-5), env(safe-area-inset-top))
|
|
88
|
+
max(var(--greese-space-5), env(safe-area-inset-bottom));
|
|
89
|
+
border: 0;
|
|
90
|
+
border-radius: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.greese-Dialog-header {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-shrink: 0;
|
|
96
|
+
gap: var(--greese-space-3);
|
|
97
|
+
align-items: flex-start;
|
|
98
|
+
justify-content: space-between;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.greese-Dialog-title {
|
|
102
|
+
margin: 0;
|
|
103
|
+
font-size: var(--greese-type-s2-font-size);
|
|
104
|
+
font-weight: var(--greese-font-weight-semibold);
|
|
105
|
+
line-height: var(--greese-line-height-snug);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.greese-Dialog-close {
|
|
109
|
+
margin-block-start: calc(-1 * var(--greese-space-1));
|
|
110
|
+
margin-inline-end: calc(-1 * var(--greese-space-2));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.greese-Dialog-description {
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
margin: 0;
|
|
116
|
+
font-size: var(--greese-type-p3-font-size);
|
|
117
|
+
color: var(--greese-color-fg-muted);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.greese-Dialog-body {
|
|
121
|
+
flex: 1 1 auto;
|
|
122
|
+
min-block-size: 0;
|
|
123
|
+
overflow: auto;
|
|
124
|
+
overscroll-behavior: contain;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Phones: actions stack full-width, primary (last) on top, for thumbs.
|
|
128
|
+
.greese-Dialog-footer {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column-reverse;
|
|
131
|
+
flex-shrink: 0;
|
|
132
|
+
gap: var(--greese-space-2);
|
|
133
|
+
|
|
134
|
+
@include mixins.up(sm) {
|
|
135
|
+
flex-flow: row wrap;
|
|
136
|
+
justify-content: flex-end;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Drawer: edge-anchored, in logical terms so start/end follow the writing
|
|
141
|
+
// direction. Each placement sets every geometry property, so a larger
|
|
142
|
+
// breakpoint's placement fully replaces a smaller one's.
|
|
143
|
+
.greese-Drawer {
|
|
144
|
+
// A drawer is a dialog that comes from its edge: it takes the theme's
|
|
145
|
+
// `drawer` role, not the dialog's.
|
|
146
|
+
@include floating.motion-role(drawer, $shared: false);
|
|
147
|
+
|
|
148
|
+
--greese-drawer-dir: 1;
|
|
149
|
+
|
|
150
|
+
max-block-size: none;
|
|
151
|
+
margin: 0;
|
|
152
|
+
border-radius: 0;
|
|
153
|
+
|
|
154
|
+
&:dir(rtl) {
|
|
155
|
+
--greese-drawer-dir: -1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
$edge: var(--greese-corner-surface);
|
|
160
|
+
$safe-top: max(var(--greese-space-5), env(safe-area-inset-top));
|
|
161
|
+
$safe-bottom: max(var(--greese-space-5), env(safe-area-inset-bottom));
|
|
162
|
+
$side-size: min(24rem, 100vw - 3rem);
|
|
163
|
+
$placements: (
|
|
164
|
+
end: (
|
|
165
|
+
inset-block: 0,
|
|
166
|
+
inset-inline: auto 0,
|
|
167
|
+
inline-size: $side-size,
|
|
168
|
+
block-size: 100dvh,
|
|
169
|
+
max-block-size: none,
|
|
170
|
+
padding-block: $safe-top $safe-bottom,
|
|
171
|
+
radius: $edge 0 0 $edge,
|
|
172
|
+
from: calc(100% * var(--greese-drawer-dir)) 0,
|
|
173
|
+
),
|
|
174
|
+
start: (
|
|
175
|
+
inset-block: 0,
|
|
176
|
+
inset-inline: 0 auto,
|
|
177
|
+
inline-size: $side-size,
|
|
178
|
+
block-size: 100dvh,
|
|
179
|
+
max-block-size: none,
|
|
180
|
+
padding-block: $safe-top $safe-bottom,
|
|
181
|
+
radius: 0 $edge $edge 0,
|
|
182
|
+
from: calc(-100% * var(--greese-drawer-dir)) 0,
|
|
183
|
+
),
|
|
184
|
+
bottom: (
|
|
185
|
+
inset-block: auto 0,
|
|
186
|
+
inset-inline: 0,
|
|
187
|
+
inline-size: 100vw,
|
|
188
|
+
block-size: auto,
|
|
189
|
+
max-block-size: 85dvh,
|
|
190
|
+
padding-block: var(--greese-space-5) $safe-bottom,
|
|
191
|
+
radius: $edge $edge 0 0,
|
|
192
|
+
from: 0 100%,
|
|
193
|
+
),
|
|
194
|
+
top: (
|
|
195
|
+
inset-block: 0 auto,
|
|
196
|
+
inset-inline: 0,
|
|
197
|
+
inline-size: 100vw,
|
|
198
|
+
block-size: auto,
|
|
199
|
+
max-block-size: 85dvh,
|
|
200
|
+
padding-block: $safe-top var(--greese-space-5),
|
|
201
|
+
radius: 0 0 $edge $edge,
|
|
202
|
+
from: 0 -100%,
|
|
203
|
+
),
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
@each $bp, $_ in mixins.$breakpoints {
|
|
207
|
+
@include mixins.up($bp) {
|
|
208
|
+
@each $placement, $g in $placements {
|
|
209
|
+
$radius: map.get($g, radius);
|
|
210
|
+
|
|
211
|
+
.greese-Drawer--#{$bp}-placement-#{$placement} {
|
|
212
|
+
// Read by the swipe-to-close handler: which way a drag dismisses.
|
|
213
|
+
--greese-drawer-edge: #{$placement};
|
|
214
|
+
|
|
215
|
+
inset-block: map.get($g, inset-block);
|
|
216
|
+
inset-inline: map.get($g, inset-inline);
|
|
217
|
+
inline-size: map.get($g, inline-size);
|
|
218
|
+
block-size: map.get($g, block-size);
|
|
219
|
+
max-block-size: map.get($g, max-block-size);
|
|
220
|
+
padding-block: map.get($g, padding-block);
|
|
221
|
+
border-start-start-radius: list.nth($radius, 1);
|
|
222
|
+
border-start-end-radius: list.nth($radius, 2);
|
|
223
|
+
border-end-end-radius: list.nth($radius, 3);
|
|
224
|
+
border-end-start-radius: list.nth($radius, 4);
|
|
225
|
+
|
|
226
|
+
// Where it opens from: the edge. The theme decides how it moves.
|
|
227
|
+
--greese-overlay-origin: #{map.get($g, from)};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Swipe-to-close starts on the header; it must not pan the page.
|
|
234
|
+
.greese-Drawer .greese-Dialog-header {
|
|
235
|
+
position: relative;
|
|
236
|
+
touch-action: none;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// A grab handle on bottom sheets, at every breakpoint where they are bottom.
|
|
240
|
+
@each $bp, $_ in mixins.$breakpoints {
|
|
241
|
+
@include mixins.up($bp) {
|
|
242
|
+
.greese-Drawer--#{$bp}-placement-bottom .greese-Dialog-header::before {
|
|
243
|
+
position: absolute;
|
|
244
|
+
inset-block-start: calc(-1 * var(--greese-space-3));
|
|
245
|
+
inset-inline: 0;
|
|
246
|
+
display: block;
|
|
247
|
+
inline-size: 2.5rem;
|
|
248
|
+
block-size: 4px;
|
|
249
|
+
margin-inline: auto;
|
|
250
|
+
content: '';
|
|
251
|
+
background-color: var(--greese-color-border-strong);
|
|
252
|
+
border-radius: var(--greese-corner-pill);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
@each $placement in (start, end, top) {
|
|
256
|
+
.greese-Drawer--#{$bp}-placement-#{$placement} .greese-Dialog-header::before {
|
|
257
|
+
display: none;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@keyframes greese-backdrop-in {
|
|
264
|
+
from {
|
|
265
|
+
opacity: 0;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|