@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,59 @@
|
|
|
1
|
+
@use '../../styles/mixins';
|
|
2
|
+
|
|
3
|
+
@layer greese.components {
|
|
4
|
+
.greese-Breadcrumbs-list {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
gap: var(--greese-space-1) var(--greese-space-2);
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: 0;
|
|
10
|
+
margin: 0;
|
|
11
|
+
font-size: var(--greese-type-p3-font-size);
|
|
12
|
+
list-style: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.greese-BreadcrumbItem {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
gap: var(--greese-space-2);
|
|
18
|
+
align-items: center;
|
|
19
|
+
min-inline-size: 0;
|
|
20
|
+
color: var(--greese-color-fg-muted);
|
|
21
|
+
|
|
22
|
+
// Silent separator: the alt text after the slash is empty.
|
|
23
|
+
& + &::before {
|
|
24
|
+
color: var(--greese-color-border-strong);
|
|
25
|
+
content: '/' / '';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.greese-BreadcrumbItem-link,
|
|
30
|
+
.greese-Breadcrumbs-expand {
|
|
31
|
+
color: inherit;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
border-radius: var(--greese-corner-inset);
|
|
34
|
+
|
|
35
|
+
@include mixins.focus-ring(1px);
|
|
36
|
+
|
|
37
|
+
@include mixins.hover {
|
|
38
|
+
color: var(--greese-color-fg);
|
|
39
|
+
text-decoration: underline;
|
|
40
|
+
text-underline-offset: 0.2em;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.greese-Breadcrumbs-expand {
|
|
45
|
+
padding: 0 var(--greese-space-1);
|
|
46
|
+
font: inherit;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
background: none;
|
|
49
|
+
border: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.greese-BreadcrumbItem-current {
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
font-weight: var(--greese-font-weight-medium);
|
|
55
|
+
color: var(--greese-color-fg);
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../../styles/mixins';
|
|
3
|
+
@use '../../styles/controls';
|
|
4
|
+
@use '../../styles/tones';
|
|
5
|
+
|
|
6
|
+
@layer greese.components {
|
|
7
|
+
.greese-Button {
|
|
8
|
+
@include mixins.component-root;
|
|
9
|
+
|
|
10
|
+
// Per-instance theming hooks: override these on any button.
|
|
11
|
+
--greese-button-tone: var(--greese-color-primary);
|
|
12
|
+
--greese-button-on-tone: var(--greese-color-primary-content);
|
|
13
|
+
|
|
14
|
+
position: relative;
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
gap: var(--greese-space-2);
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
min-block-size: var(--greese-button-height);
|
|
21
|
+
padding-inline: var(--greese-button-padding);
|
|
22
|
+
|
|
23
|
+
// The `button` type variant, but for its size (the `size` prop sets that).
|
|
24
|
+
font-family: var(--greese-type-button-font-family, inherit);
|
|
25
|
+
font-style: var(--greese-type-button-font-style, normal);
|
|
26
|
+
font-weight: var(--greese-type-button-font-weight);
|
|
27
|
+
line-height: var(--greese-type-button-line-height);
|
|
28
|
+
text-transform: var(--greese-type-button-text-transform, none);
|
|
29
|
+
letter-spacing: var(--greese-type-button-letter-spacing);
|
|
30
|
+
color: var(--greese-button-fg);
|
|
31
|
+
text-align: center;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
user-select: none;
|
|
36
|
+
background-color: var(--greese-button-bg);
|
|
37
|
+
border: 1px solid var(--greese-button-border, transparent);
|
|
38
|
+
border-radius: var(--greese-corner-control);
|
|
39
|
+
transition:
|
|
40
|
+
background-color var(--greese-duration-fast) var(--greese-easing-standard),
|
|
41
|
+
border-color var(--greese-duration-fast) var(--greese-easing-standard),
|
|
42
|
+
color var(--greese-duration-fast) var(--greese-easing-standard);
|
|
43
|
+
|
|
44
|
+
@include mixins.focus-ring;
|
|
45
|
+
@include mixins.touch-target;
|
|
46
|
+
|
|
47
|
+
@include mixins.hover {
|
|
48
|
+
background-color: var(--greese-button-bg-hover);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:active:not([aria-disabled='true'], :disabled) {
|
|
52
|
+
background-color: var(--greese-button-bg-active);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:disabled,
|
|
56
|
+
&[aria-disabled='true']:not([data-loading]) {
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
opacity: 0.55;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// A disabled link (or other `asChild` element) has no native `disabled`:
|
|
62
|
+
// the pointer passes through it, so it can't be followed with no script.
|
|
63
|
+
&:not(button)[aria-disabled='true'] {
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Tones
|
|
69
|
+
.greese-Button--neutral {
|
|
70
|
+
--greese-button-tone: var(--greese-color-fg);
|
|
71
|
+
--greese-button-on-tone: var(--greese-color-canvas);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@each $tone in tones.$brand {
|
|
75
|
+
.greese-Button--#{$tone} {
|
|
76
|
+
--greese-button-tone: var(--greese-color-#{$tone});
|
|
77
|
+
--greese-button-on-tone: var(--greese-color-#{$tone}-content);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.greese-Button--negative {
|
|
82
|
+
--greese-button-tone: var(--greese-color-negative);
|
|
83
|
+
--greese-button-on-tone: var(--greese-color-negative-content);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Variants. color-mix() derives hover/soft states from the tone, toward the
|
|
87
|
+
// on-tone color, so they work in light and dark without extra tokens.
|
|
88
|
+
.greese-Button--solid {
|
|
89
|
+
--greese-button-fg: var(--greese-button-on-tone);
|
|
90
|
+
--greese-button-bg: var(--greese-button-tone);
|
|
91
|
+
--greese-button-bg-hover: color-mix(
|
|
92
|
+
in oklab,
|
|
93
|
+
var(--greese-button-tone),
|
|
94
|
+
var(--greese-button-on-tone) 14%
|
|
95
|
+
);
|
|
96
|
+
--greese-button-bg-active: color-mix(
|
|
97
|
+
in oklab,
|
|
98
|
+
var(--greese-button-tone),
|
|
99
|
+
var(--greese-button-on-tone) 24%
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.greese-Button--soft {
|
|
104
|
+
--greese-button-fg: var(--greese-button-tone);
|
|
105
|
+
--greese-button-bg: color-mix(in oklab, var(--greese-button-tone) 12%, transparent);
|
|
106
|
+
--greese-button-bg-hover: color-mix(
|
|
107
|
+
in oklab,
|
|
108
|
+
var(--greese-button-tone) 20%,
|
|
109
|
+
transparent
|
|
110
|
+
);
|
|
111
|
+
--greese-button-bg-active: color-mix(
|
|
112
|
+
in oklab,
|
|
113
|
+
var(--greese-button-tone) 28%,
|
|
114
|
+
transparent
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.greese-Button--outline {
|
|
119
|
+
--greese-button-fg: var(--greese-button-tone);
|
|
120
|
+
--greese-button-bg: transparent;
|
|
121
|
+
--greese-button-border: color-mix(
|
|
122
|
+
in oklab,
|
|
123
|
+
var(--greese-button-tone) 55%,
|
|
124
|
+
transparent
|
|
125
|
+
);
|
|
126
|
+
--greese-button-bg-hover: color-mix(
|
|
127
|
+
in oklab,
|
|
128
|
+
var(--greese-button-tone) 8%,
|
|
129
|
+
transparent
|
|
130
|
+
);
|
|
131
|
+
--greese-button-bg-active: color-mix(
|
|
132
|
+
in oklab,
|
|
133
|
+
var(--greese-button-tone) 16%,
|
|
134
|
+
transparent
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.greese-Button--ghost {
|
|
139
|
+
--greese-button-fg: var(--greese-button-tone);
|
|
140
|
+
--greese-button-bg: transparent;
|
|
141
|
+
--greese-button-bg-hover: color-mix(
|
|
142
|
+
in oklab,
|
|
143
|
+
var(--greese-button-tone) 10%,
|
|
144
|
+
transparent
|
|
145
|
+
);
|
|
146
|
+
--greese-button-bg-active: color-mix(
|
|
147
|
+
in oklab,
|
|
148
|
+
var(--greese-button-tone) 18%,
|
|
149
|
+
transparent
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Plain text: the surrounding text's color and no box, so it reads as
|
|
154
|
+
// text and only a faint tint on hover says it's a button.
|
|
155
|
+
.greese-Button--text {
|
|
156
|
+
--greese-button-fg: currentcolor;
|
|
157
|
+
--greese-button-bg: transparent;
|
|
158
|
+
--greese-button-bg-hover: color-mix(
|
|
159
|
+
in oklab,
|
|
160
|
+
var(--greese-button-tone) 8%,
|
|
161
|
+
transparent
|
|
162
|
+
);
|
|
163
|
+
--greese-button-bg-active: color-mix(
|
|
164
|
+
in oklab,
|
|
165
|
+
var(--greese-button-tone) 14%,
|
|
166
|
+
transparent
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Sizes
|
|
171
|
+
@each $size, $spec in controls.$sizes {
|
|
172
|
+
.greese-Button--size-#{$size} {
|
|
173
|
+
--greese-button-height: #{map.get($spec, height)};
|
|
174
|
+
--greese-button-padding: #{map.get($spec, padding)};
|
|
175
|
+
|
|
176
|
+
font-size: map.get($spec, font);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.greese-Button-icon {
|
|
181
|
+
display: inline-flex;
|
|
182
|
+
flex-shrink: 0;
|
|
183
|
+
|
|
184
|
+
> svg {
|
|
185
|
+
inline-size: 1.25em;
|
|
186
|
+
block-size: 1.25em;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Loading: hide the content (keeping its width) and spin a ring in its place.
|
|
191
|
+
.greese-Button[data-loading] {
|
|
192
|
+
color: transparent;
|
|
193
|
+
cursor: progress;
|
|
194
|
+
|
|
195
|
+
&::before {
|
|
196
|
+
position: absolute;
|
|
197
|
+
inset: 0;
|
|
198
|
+
inline-size: 1.1em;
|
|
199
|
+
block-size: 1.1em;
|
|
200
|
+
margin: auto;
|
|
201
|
+
content: '';
|
|
202
|
+
border: 2px solid var(--greese-button-fg);
|
|
203
|
+
border-inline-end-color: transparent;
|
|
204
|
+
border-radius: 50%;
|
|
205
|
+
|
|
206
|
+
@include mixins.motion-safe {
|
|
207
|
+
animation: greese-button-spin 0.7s linear infinite;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
> * {
|
|
212
|
+
visibility: hidden;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@include mixins.responsive-prop(
|
|
217
|
+
'greese-Button',
|
|
218
|
+
'width',
|
|
219
|
+
inline-size,
|
|
220
|
+
(
|
|
221
|
+
full: 100%,
|
|
222
|
+
auto: auto,
|
|
223
|
+
)
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
@keyframes greese-button-spin {
|
|
227
|
+
to {
|
|
228
|
+
rotate: 1turn;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@layer greese.components {
|
|
2
|
+
.greese-ButtonGroup {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
gap: var(--greese-space-2);
|
|
6
|
+
|
|
7
|
+
&[data-orientation='vertical'] {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Attached groups join buttons and field frames (Select, Input) alike, so a
|
|
13
|
+
// button can sit flush against a select or an input.
|
|
14
|
+
.greese-ButtonGroup--attached {
|
|
15
|
+
flex-wrap: nowrap;
|
|
16
|
+
gap: 0;
|
|
17
|
+
|
|
18
|
+
> :is(.greese-Button, .greese-Select, .greese-Input) {
|
|
19
|
+
&:is(:focus-visible, :focus-within) {
|
|
20
|
+
z-index: 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> :is(.greese-Select, .greese-Input) {
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
inline-size: auto;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&[data-orientation='horizontal']
|
|
30
|
+
> :is(.greese-Button, .greese-Select, .greese-Input) {
|
|
31
|
+
&:not(:first-child) {
|
|
32
|
+
margin-inline-start: -1px;
|
|
33
|
+
border-start-start-radius: 0;
|
|
34
|
+
border-end-start-radius: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(:last-child) {
|
|
38
|
+
border-start-end-radius: 0;
|
|
39
|
+
border-end-end-radius: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[data-orientation='vertical'] > :is(.greese-Button, .greese-Select, .greese-Input) {
|
|
44
|
+
&:not(:first-child) {
|
|
45
|
+
margin-block-start: -1px;
|
|
46
|
+
border-start-start-radius: 0;
|
|
47
|
+
border-start-end-radius: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:not(:last-child) {
|
|
51
|
+
border-end-start-radius: 0;
|
|
52
|
+
border-end-end-radius: 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
@use '../../styles/mixins';
|
|
2
|
+
|
|
3
|
+
@layer greese.components {
|
|
4
|
+
.greese-Card {
|
|
5
|
+
// Resolved padding, readable by CardMedia to bleed through it.
|
|
6
|
+
--greese-card-padding: var(--greese-space-4);
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--greese-space-4);
|
|
11
|
+
min-inline-size: 0;
|
|
12
|
+
padding: var(--greese-card-padding);
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
color: var(--greese-color-fg);
|
|
15
|
+
border-radius: var(--greese-corner-surface);
|
|
16
|
+
|
|
17
|
+
@include mixins.up(md) {
|
|
18
|
+
--greese-card-padding: var(--greese-space-5);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.greese-Card--outline {
|
|
23
|
+
background-color: var(--greese-color-surface-overlay);
|
|
24
|
+
border: 1px solid var(--greese-color-border);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.greese-Card--elevated {
|
|
28
|
+
background-color: var(--greese-color-surface-overlay);
|
|
29
|
+
box-shadow: var(--greese-shadow-md);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.greese-Card--filled {
|
|
33
|
+
background-color: var(--greese-color-surface);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.greese-Card--interactive {
|
|
37
|
+
position: relative;
|
|
38
|
+
text-decoration: none;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
transition:
|
|
41
|
+
box-shadow var(--greese-duration-normal) var(--greese-easing-standard),
|
|
42
|
+
border-color var(--greese-duration-normal) var(--greese-easing-standard),
|
|
43
|
+
translate var(--greese-duration-normal) var(--greese-easing-standard);
|
|
44
|
+
|
|
45
|
+
@include mixins.focus-ring;
|
|
46
|
+
|
|
47
|
+
@include mixins.hover {
|
|
48
|
+
border-color: var(--greese-color-border-strong);
|
|
49
|
+
box-shadow: var(--greese-shadow-lg);
|
|
50
|
+
|
|
51
|
+
@include mixins.motion-safe {
|
|
52
|
+
translate: 0 -2px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Hovered, the card rises 2px: its hit area reaches the 2px below it, so
|
|
57
|
+
// a pointer resting on its lower edge stays over it, instead of the card
|
|
58
|
+
// rising away, settling back under the pointer and rising again. That
|
|
59
|
+
// strip is outside the box, so this card doesn't clip its overflow (which
|
|
60
|
+
// would clip the strip too); CardMedia rounds its own corners instead.
|
|
61
|
+
overflow: visible;
|
|
62
|
+
|
|
63
|
+
// It's measured from the padding box, inside any border, so it reaches
|
|
64
|
+
// 4px: the 2px rise, with room for an outline's border.
|
|
65
|
+
&::before {
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset-block: 100% -4px;
|
|
68
|
+
inset-inline: 0;
|
|
69
|
+
content: '';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Media clips itself to the card's corners where it bleeds to an edge, so
|
|
74
|
+
// it fits a card that doesn't clip (an interactive one) as well.
|
|
75
|
+
.greese-CardMedia {
|
|
76
|
+
margin-inline: calc(-1 * var(--greese-card-padding));
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
|
|
79
|
+
&:first-child {
|
|
80
|
+
margin-block-start: calc(-1 * var(--greese-card-padding));
|
|
81
|
+
border-start-start-radius: inherit;
|
|
82
|
+
border-start-end-radius: inherit;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:last-child {
|
|
86
|
+
margin-block-end: calc(-1 * var(--greese-card-padding));
|
|
87
|
+
border-end-start-radius: inherit;
|
|
88
|
+
border-end-end-radius: inherit;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
> :is(img, video, picture) {
|
|
92
|
+
display: block;
|
|
93
|
+
inline-size: 100%;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// After the default, so a padding prop wins at every breakpoint.
|
|
98
|
+
@include mixins.responsive-prop('greese-Card', 'padding', --greese-card-padding);
|
|
99
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
@use '../../styles/mixins';
|
|
2
|
+
|
|
3
|
+
@layer greese.components {
|
|
4
|
+
.greese-Carousel {
|
|
5
|
+
@include mixins.component-root;
|
|
6
|
+
|
|
7
|
+
position: relative;
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: var(--greese-space-3);
|
|
10
|
+
min-inline-size: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Native scrolling and snapping: swipe, trackpad and keys all work.
|
|
14
|
+
.greese-Carousel-viewport {
|
|
15
|
+
--greese-carousel-per-view: 1;
|
|
16
|
+
--greese-carousel-gap: var(--greese-space-3);
|
|
17
|
+
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: var(--greese-carousel-gap);
|
|
20
|
+
overflow-x: auto;
|
|
21
|
+
overscroll-behavior-x: contain;
|
|
22
|
+
scroll-snap-type: x mandatory;
|
|
23
|
+
scrollbar-width: none;
|
|
24
|
+
border-radius: var(--greese-corner-panel);
|
|
25
|
+
|
|
26
|
+
&::-webkit-scrollbar {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include mixins.focus-ring;
|
|
31
|
+
|
|
32
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
33
|
+
scroll-behavior: smooth;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Each slide's width: the viewport shared by `per-view` slides and the gaps.
|
|
38
|
+
.greese-CarouselSlide {
|
|
39
|
+
--greese-carousel-gaps: calc(
|
|
40
|
+
(var(--greese-carousel-per-view) - 1) * var(--greese-carousel-gap)
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
flex: 0 0 calc((100% - var(--greese-carousel-gaps)) / var(--greese-carousel-per-view));
|
|
44
|
+
min-inline-size: 0;
|
|
45
|
+
scroll-snap-align: start;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Previous and next sit over the viewport's edges, centred on it.
|
|
49
|
+
.greese-Carousel-control {
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset-block-start: calc(50% - 1.25rem - var(--greese-carousel-dots, 0px) / 2);
|
|
52
|
+
display: inline-grid;
|
|
53
|
+
place-items: center;
|
|
54
|
+
inline-size: 2.5rem;
|
|
55
|
+
block-size: 2.5rem;
|
|
56
|
+
padding: 0;
|
|
57
|
+
color: var(--greese-color-fg);
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
background-color: color-mix(
|
|
60
|
+
in oklab,
|
|
61
|
+
var(--greese-color-surface-overlay) 88%,
|
|
62
|
+
transparent
|
|
63
|
+
);
|
|
64
|
+
border: 1px solid var(--greese-color-border);
|
|
65
|
+
border-radius: var(--greese-corner-round);
|
|
66
|
+
box-shadow: var(--greese-shadow-md);
|
|
67
|
+
translate: 0 -50%;
|
|
68
|
+
transition: opacity var(--greese-duration-fast) var(--greese-easing-standard);
|
|
69
|
+
|
|
70
|
+
@include mixins.focus-ring;
|
|
71
|
+
@include mixins.touch-target;
|
|
72
|
+
|
|
73
|
+
&:disabled {
|
|
74
|
+
cursor: default;
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
> svg {
|
|
79
|
+
inline-size: 1.125rem;
|
|
80
|
+
block-size: 1.125rem;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.greese-Carousel:has(.greese-Carousel-indicators) {
|
|
85
|
+
--greese-carousel-dots: calc(0.5rem + var(--greese-space-3));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.greese-Carousel-control--previous {
|
|
89
|
+
inset-inline-start: var(--greese-space-2);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.greese-Carousel-control--next {
|
|
93
|
+
inset-inline-end: var(--greese-space-2);
|
|
94
|
+
|
|
95
|
+
> svg {
|
|
96
|
+
scale: -1 1;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The chevron points to the inline start; mirror both in RTL.
|
|
101
|
+
.greese-Carousel-control:dir(rtl) > svg {
|
|
102
|
+
scale: -1 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.greese-Carousel-control--next:dir(rtl) > svg {
|
|
106
|
+
scale: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Phones swipe; the buttons come back where a pointer can hover.
|
|
110
|
+
@media (hover: none) {
|
|
111
|
+
.greese-Carousel-control {
|
|
112
|
+
display: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.greese-Carousel-indicators {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
gap: var(--greese-space-1);
|
|
120
|
+
justify-content: center;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Each dot keeps one size; the active pill is drawn by clip-path, which
|
|
124
|
+
// never changes layout. A width change would: mid-scroll, every frame of
|
|
125
|
+
// it made WebKit re-snap the viewport and pull it back a slide.
|
|
126
|
+
.greese-Carousel-indicator {
|
|
127
|
+
position: relative;
|
|
128
|
+
inline-size: 1.5rem;
|
|
129
|
+
block-size: 0.5rem;
|
|
130
|
+
padding: 0;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
background: none;
|
|
133
|
+
border: 0;
|
|
134
|
+
|
|
135
|
+
@include mixins.focus-ring;
|
|
136
|
+
@include mixins.touch-target(24px);
|
|
137
|
+
|
|
138
|
+
&::before {
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset: 0;
|
|
141
|
+
content: '';
|
|
142
|
+
background-color: var(--greese-color-border-strong);
|
|
143
|
+
border-radius: var(--greese-corner-pill);
|
|
144
|
+
clip-path: inset(0 calc(50% - 0.25rem) round var(--greese-corner-pill));
|
|
145
|
+
transition:
|
|
146
|
+
clip-path var(--greese-duration-normal) var(--greese-easing-standard),
|
|
147
|
+
background-color var(--greese-duration-normal) var(--greese-easing-standard);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&[aria-current='true']::before {
|
|
151
|
+
background-color: var(--greese-color-primary);
|
|
152
|
+
clip-path: inset(0 round var(--greese-corner-pill));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@include mixins.responsive-prop(
|
|
157
|
+
'greese-Carousel',
|
|
158
|
+
'per-view',
|
|
159
|
+
--greese-carousel-per-view
|
|
160
|
+
);
|
|
161
|
+
}
|