@greese/ui 0.0.0-stage → 1.1.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.
Files changed (288) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -2
  3. package/bin/greese-utilities.mjs +56 -0
  4. package/dist/_layers.scss +2 -0
  5. package/dist/_maps.scss +1884 -0
  6. package/dist/_tokens-base.scss +174 -0
  7. package/dist/_tokens.scss +2140 -0
  8. package/dist/base.css +67 -0
  9. package/dist/colorScheme.d.ts +16 -0
  10. package/dist/colorScheme.js +13 -0
  11. package/dist/contrast.d.ts +15 -0
  12. package/dist/contrast.js +43 -0
  13. package/dist/css/Accordion.css +9 -0
  14. package/dist/css/ActionSelect.css +6 -0
  15. package/dist/css/Alert.css +84 -0
  16. package/dist/css/AppBar.css +35 -0
  17. package/dist/css/AspectRatio.css +40 -0
  18. package/dist/css/AutoLayout.css +508 -0
  19. package/dist/css/Avatar.css +88 -0
  20. package/dist/css/Badge.css +66 -0
  21. package/dist/css/Box.css +640 -0
  22. package/dist/css/Breadcrumbs.css +57 -0
  23. package/dist/css/Button.css +275 -0
  24. package/dist/css/ButtonGroup.css +40 -0
  25. package/dist/css/Card.css +101 -0
  26. package/dist/css/Carousel.css +170 -0
  27. package/dist/css/Center.css +11 -0
  28. package/dist/css/ChatBubble.css +128 -0
  29. package/dist/css/Checkbox.css +65 -0
  30. package/dist/css/Chip.css +124 -0
  31. package/dist/css/ChoiceGroup.css +57 -0
  32. package/dist/css/Code.css +29 -0
  33. package/dist/css/Collapsible.css +126 -0
  34. package/dist/css/ColorPicker.css +191 -0
  35. package/dist/css/Combobox.css +90 -0
  36. package/dist/css/Container.css +30 -0
  37. package/dist/css/Countdown.css +25 -0
  38. package/dist/css/DateField.css +15 -0
  39. package/dist/css/Dialog.css +640 -0
  40. package/dist/css/Diff.css +103 -0
  41. package/dist/css/Divider.css +19 -0
  42. package/dist/css/Dock.css +91 -0
  43. package/dist/css/Field.css +33 -0
  44. package/dist/css/Fieldset.css +54 -0
  45. package/dist/css/FileInput.css +65 -0
  46. package/dist/css/Footer.css +72 -0
  47. package/dist/css/Grid.css +998 -0
  48. package/dist/css/Header.css +89 -0
  49. package/dist/css/Heading.css +6 -0
  50. package/dist/css/Icon.css +12 -0
  51. package/dist/css/IconButton.css +7 -0
  52. package/dist/css/Image.css +69 -0
  53. package/dist/css/Indicator.css +41 -0
  54. package/dist/css/Input.css +115 -0
  55. package/dist/css/Key.css +42 -0
  56. package/dist/css/Link.css +72 -0
  57. package/dist/css/List.css +52 -0
  58. package/dist/css/Media.css +8 -0
  59. package/dist/css/Menu.css +161 -0
  60. package/dist/css/Motion.css +1356 -0
  61. package/dist/css/NumberField.css +49 -0
  62. package/dist/css/OtpField.css +90 -0
  63. package/dist/css/PageTransition.css +991 -0
  64. package/dist/css/Pagination.css +43 -0
  65. package/dist/css/Popover.css +93 -0
  66. package/dist/css/Progress.css +101 -0
  67. package/dist/css/RadialProgress.css +44 -0
  68. package/dist/css/Radio.css +41 -0
  69. package/dist/css/Rating.css +100 -0
  70. package/dist/css/ScrollSpy.css +6 -0
  71. package/dist/css/SegmentedControl.css +101 -0
  72. package/dist/css/Select.css +115 -0
  73. package/dist/css/Sidebar.css +207 -0
  74. package/dist/css/Skeleton.css +48 -0
  75. package/dist/css/Slider.css +75 -0
  76. package/dist/css/Spacer.css +34 -0
  77. package/dist/css/SpeedDial.css +165 -0
  78. package/dist/css/Spinner.css +44 -0
  79. package/dist/css/Stack.css +528 -0
  80. package/dist/css/Stat.css +107 -0
  81. package/dist/css/Status.css +86 -0
  82. package/dist/css/Steps.css +201 -0
  83. package/dist/css/Swap.css +49 -0
  84. package/dist/css/Switch.css +66 -0
  85. package/dist/css/Table.css +269 -0
  86. package/dist/css/Tabs.css +119 -0
  87. package/dist/css/Text.css +60 -0
  88. package/dist/css/TextRotate.css +147 -0
  89. package/dist/css/Textarea.css +107 -0
  90. package/dist/css/ThemeProvider.css +6 -0
  91. package/dist/css/Tile.css +18 -0
  92. package/dist/css/Toast.css +110 -0
  93. package/dist/css/ToggleButton.css +20 -0
  94. package/dist/css/Tooltip.css +94 -0
  95. package/dist/css/Type.css +211 -0
  96. package/dist/css/Visibility.css +78 -0
  97. package/dist/css/VisuallyHidden.css +15 -0
  98. package/dist/css/core.css +251 -0
  99. package/dist/css.d.ts +29 -0
  100. package/dist/css.js +28 -0
  101. package/dist/effect-classes.d.ts +8 -0
  102. package/dist/effect-classes.js +5 -0
  103. package/dist/effects/css.d.ts +71 -0
  104. package/dist/effects/css.js +184 -0
  105. package/dist/effects/definitions.d.ts +555 -0
  106. package/dist/effects/definitions.js +379 -0
  107. package/dist/effects/frames.d.ts +18 -0
  108. package/dist/effects/frames.js +68 -0
  109. package/dist/effects/sequence.d.ts +33 -0
  110. package/dist/effects/sequence.js +106 -0
  111. package/dist/effects.d.ts +30 -0
  112. package/dist/effects.js +30 -0
  113. package/dist/greese.css +11919 -0
  114. package/dist/index.d.ts +10 -0
  115. package/dist/index.js +10 -0
  116. package/dist/kebab.d.ts +2 -0
  117. package/dist/kebab.js +2 -0
  118. package/dist/palette.css +249 -0
  119. package/dist/palette.d.ts +599 -0
  120. package/dist/palette.js +334 -0
  121. package/dist/shapes.d.ts +193 -0
  122. package/dist/shapes.js +852 -0
  123. package/dist/storage.d.ts +47 -0
  124. package/dist/storage.js +118 -0
  125. package/dist/style-manifest.json +3017 -0
  126. package/dist/theme.d.ts +71 -0
  127. package/dist/theme.js +180 -0
  128. package/dist/tokens.css +253 -0
  129. package/dist/tokens.d.ts +343 -0
  130. package/dist/tokens.js +179 -0
  131. package/dist/typography.d.ts +55 -0
  132. package/dist/typography.js +144 -0
  133. package/dist/utilities.css +6975 -0
  134. package/dist/utilities.d.ts +82 -0
  135. package/dist/utilities.js +636 -0
  136. package/dist/utilitiesFiles.d.ts +18 -0
  137. package/dist/utilitiesFiles.js +26 -0
  138. package/dist/vite.d.ts +40 -0
  139. package/dist/vite.js +43 -0
  140. package/package.json +131 -4
  141. package/src/components/Accordion/Accordion.scss +9 -0
  142. package/src/components/ActionSelect/ActionSelect.scss +6 -0
  143. package/src/components/Alert/Alert.scss +71 -0
  144. package/src/components/AppBar/AppBar.scss +43 -0
  145. package/src/components/AspectRatio/AspectRatio.scss +22 -0
  146. package/src/components/AutoLayout/AutoLayout.scss +90 -0
  147. package/src/components/Avatar/Avatar.scss +91 -0
  148. package/src/components/Badge/Badge.scss +52 -0
  149. package/src/components/Box/Box.scss +63 -0
  150. package/src/components/Breadcrumbs/Breadcrumbs.scss +59 -0
  151. package/src/components/Button/Button.scss +231 -0
  152. package/src/components/ButtonGroup/ButtonGroup.scss +56 -0
  153. package/src/components/Card/Card.scss +99 -0
  154. package/src/components/Carousel/Carousel.scss +161 -0
  155. package/src/components/Center/Center.scss +11 -0
  156. package/src/components/ChatBubble/ChatBubble.scss +119 -0
  157. package/src/components/Checkbox/Checkbox.scss +66 -0
  158. package/src/components/Chip/Chip.scss +119 -0
  159. package/src/components/ChoiceGroup/ChoiceGroup.scss +69 -0
  160. package/src/components/Code/Code.scss +28 -0
  161. package/src/components/Collapsible/Collapsible.scss +136 -0
  162. package/src/components/ColorPicker/ColorPicker.scss +235 -0
  163. package/src/components/Combobox/Combobox.scss +83 -0
  164. package/src/components/Container/Container.scss +28 -0
  165. package/src/components/Countdown/Countdown.scss +28 -0
  166. package/src/components/DateField/DateField.scss +19 -0
  167. package/src/components/Dialog/Dialog.scss +268 -0
  168. package/src/components/Diff/Diff.scss +125 -0
  169. package/src/components/Divider/Divider.scss +22 -0
  170. package/src/components/Dock/Dock.scss +86 -0
  171. package/src/components/Field/Field.scss +38 -0
  172. package/src/components/Fieldset/Fieldset.scss +63 -0
  173. package/src/components/FileInput/FileInput.scss +66 -0
  174. package/src/components/Footer/Footer.scss +79 -0
  175. package/src/components/Grid/Grid.scss +86 -0
  176. package/src/components/Header/Header.scss +111 -0
  177. package/src/components/Heading/Heading.scss +7 -0
  178. package/src/components/Icon/Icon.scss +12 -0
  179. package/src/components/IconButton/IconButton.scss +6 -0
  180. package/src/components/Image/Image.scss +46 -0
  181. package/src/components/Indicator/Indicator.scss +48 -0
  182. package/src/components/Input/Input.scss +58 -0
  183. package/src/components/Key/Key.scss +48 -0
  184. package/src/components/Link/Link.scss +50 -0
  185. package/src/components/List/List.scss +62 -0
  186. package/src/components/Media/Media.scss +7 -0
  187. package/src/components/Menu/Menu.scss +91 -0
  188. package/src/components/Motion/Motion.scss +106 -0
  189. package/src/components/NumberField/NumberField.scss +44 -0
  190. package/src/components/OtpField/OtpField.scss +91 -0
  191. package/src/components/PageTransition/PageTransition.scss +197 -0
  192. package/src/components/Pagination/Pagination.scss +55 -0
  193. package/src/components/Popover/Popover.scss +13 -0
  194. package/src/components/Progress/Progress.scss +126 -0
  195. package/src/components/RadialProgress/RadialProgress.scss +65 -0
  196. package/src/components/Radio/Radio.scss +36 -0
  197. package/src/components/Rating/Rating.scss +121 -0
  198. package/src/components/ScrollSpy/ScrollSpy.scss +6 -0
  199. package/src/components/SegmentedControl/SegmentedControl.scss +107 -0
  200. package/src/components/Select/Select.scss +59 -0
  201. package/src/components/Sidebar/Sidebar.scss +88 -0
  202. package/src/components/Skeleton/Skeleton.scss +60 -0
  203. package/src/components/Slider/Slider.scss +96 -0
  204. package/src/components/Spacer/Spacer.scss +15 -0
  205. package/src/components/SpeedDial/SpeedDial.scss +109 -0
  206. package/src/components/Spinner/Spinner.scss +43 -0
  207. package/src/components/Stack/Stack.scss +57 -0
  208. package/src/components/Stat/Stat.scss +96 -0
  209. package/src/components/Status/Status.scss +60 -0
  210. package/src/components/Steps/Steps.scss +216 -0
  211. package/src/components/Swap/Swap.scss +62 -0
  212. package/src/components/Switch/Switch.scss +63 -0
  213. package/src/components/Table/Table.scss +183 -0
  214. package/src/components/Tabs/Tabs.scss +108 -0
  215. package/src/components/Text/Text.scss +34 -0
  216. package/src/components/TextRotate/TextRotate.scss +51 -0
  217. package/src/components/Textarea/Textarea.scss +56 -0
  218. package/src/components/ThemeProvider/ThemeProvider.scss +7 -0
  219. package/src/components/Tile/Tile.scss +23 -0
  220. package/src/components/Toast/Toast.scss +93 -0
  221. package/src/components/ToggleButton/ToggleButton.scss +23 -0
  222. package/src/components/Tooltip/Tooltip.scss +21 -0
  223. package/src/components/Type/Type.scss +35 -0
  224. package/src/components/Visibility/Visibility.scss +39 -0
  225. package/src/components/VisuallyHidden/VisuallyHidden.scss +17 -0
  226. package/src/styles/_breakpoint-vars.scss +16 -0
  227. package/src/styles/_config.scss +48 -0
  228. package/src/styles/_controls.scss +88 -0
  229. package/src/styles/_core.scss +4 -0
  230. package/src/styles/_effect.scss +51 -0
  231. package/src/styles/_floating.scss +141 -0
  232. package/src/styles/_kit.scss +1548 -0
  233. package/src/styles/_manifest.scss +670 -0
  234. package/src/styles/_mixins.scss +261 -0
  235. package/src/styles/_tones.scss +63 -0
  236. package/src/styles/_type-emit.scss +76 -0
  237. package/src/styles/_typography-vars.scss +8 -0
  238. package/src/styles/base.scss +80 -0
  239. package/src/styles/breakpoints.test.ts +73 -0
  240. package/src/styles/entryPoints.test.ts +68 -0
  241. package/src/styles/index.scss +93 -0
  242. package/src/styles/kit.test.ts +754 -0
  243. package/src/styles/public/_controls.scss +3 -0
  244. package/src/styles/public/_floating.scss +3 -0
  245. package/src/styles/public/_mixins.scss +5 -0
  246. package/src/styles/public/_tones.scss +4 -0
  247. package/themes/bevel.css +1077 -0
  248. package/themes/bevel.scss +1166 -0
  249. package/themes/candy.css +87 -0
  250. package/themes/candy.scss +32 -0
  251. package/themes/depth.css +123 -0
  252. package/themes/depth.scss +46 -0
  253. package/themes/extrude.css +219 -0
  254. package/themes/extrude.scss +255 -0
  255. package/themes/folio.css +986 -0
  256. package/themes/folio.scss +1047 -0
  257. package/themes/forest.css +87 -0
  258. package/themes/forest.scss +32 -0
  259. package/themes/gentle.css +66 -0
  260. package/themes/gentle.scss +39 -0
  261. package/themes/grape.css +87 -0
  262. package/themes/grape.scss +32 -0
  263. package/themes/greese.css +36 -0
  264. package/themes/greese.scss +21 -0
  265. package/themes/mono.css +87 -0
  266. package/themes/mono.scss +32 -0
  267. package/themes/ocean.css +87 -0
  268. package/themes/ocean.scss +32 -0
  269. package/themes/outline.css +127 -0
  270. package/themes/outline.scss +126 -0
  271. package/themes/pebble.css +65 -0
  272. package/themes/pebble.scss +69 -0
  273. package/themes/pocket.css +137 -0
  274. package/themes/pocket.scss +45 -0
  275. package/themes/ridge.css +927 -0
  276. package/themes/ridge.scss +998 -0
  277. package/themes/snappy.css +82 -0
  278. package/themes/snappy.scss +40 -0
  279. package/themes/soft.css +79 -0
  280. package/themes/soft.scss +84 -0
  281. package/themes/sunset.css +87 -0
  282. package/themes/sunset.scss +32 -0
  283. package/themes/ticket.css +960 -0
  284. package/themes/ticket.scss +1031 -0
  285. package/themes/tilt.css +148 -0
  286. package/themes/tilt.scss +169 -0
  287. package/themes/wipe.css +186 -0
  288. package/themes/wipe.scss +46 -0
@@ -0,0 +1,334 @@
1
+ /**
2
+ * The color palette: 22 hues, each in 11 shades from 50 (lightest) to 999
3
+ * (darkest). GENERATED by scripts/generate-palette.ts: the
4
+ * values are fixed, so a palette name means the same color in TypeScript, the
5
+ * SCSS kit and CSS.
6
+ *
7
+ * The semantic roles in tokens.ts are built from these, and you can use them
8
+ * wherever a color goes, without hex literals:
9
+ *
10
+ * - TypeScript: `palette.lavender[600]`, or import one hue: `lavender[600]`.
11
+ * - The SCSS kit: `lavender-600` as a token value, or `greese.palette(lavender, 600)`.
12
+ * - CSS: `var(--greese-lavender-600)`, with `@greese/ui/palette.css`.
13
+ *
14
+ * Each hue is its own export, so a bundle keeps only the hues it imports.
15
+ */
16
+ /** Shades, lightest first: `--greese-<hue>-<shade>`. */
17
+ export const paletteShades = [
18
+ 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 999,
19
+ ];
20
+ /** The two colors that aren't a hue: the ends of every ramp. */
21
+ export const white = '#ffffff';
22
+ export const black = '#000000';
23
+ // Greys first, then around the color wheel.
24
+ export const steel = {
25
+ 50: '#f5f7f9',
26
+ 100: '#e9edf2',
27
+ 200: '#d7dfe7',
28
+ 300: '#bfcbd8',
29
+ 400: '#a3b3c4',
30
+ 500: '#8597a9',
31
+ 600: '#687889',
32
+ 700: '#505e6d',
33
+ 800: '#3c4854',
34
+ 900: '#2a333c',
35
+ 999: '#11171c',
36
+ };
37
+ export const gray = {
38
+ 50: '#f7f7f7',
39
+ 100: '#ededed',
40
+ 200: '#dedede',
41
+ 300: '#cacaca',
42
+ 400: '#b1b1b1',
43
+ 500: '#949494',
44
+ 600: '#767676',
45
+ 700: '#5c5c5c',
46
+ 800: '#464646',
47
+ 900: '#323232',
48
+ 999: '#161616',
49
+ };
50
+ export const silver = {
51
+ 50: '#f6f7f7',
52
+ 100: '#ebedee',
53
+ 200: '#dadfe1',
54
+ 300: '#c5cbce',
55
+ 400: '#aab3b7',
56
+ 500: '#8d969b',
57
+ 600: '#6f777c',
58
+ 700: '#565e61',
59
+ 800: '#41474b',
60
+ 900: '#2e3335',
61
+ 999: '#141618',
62
+ };
63
+ export const ash = {
64
+ 50: '#f7f7f6',
65
+ 100: '#ededeb',
66
+ 200: '#dfdeda',
67
+ 300: '#cbcac4',
68
+ 400: '#b3b1aa',
69
+ 500: '#97958d',
70
+ 600: '#78766e',
71
+ 700: '#5e5c56',
72
+ 800: '#484641',
73
+ 900: '#33322e',
74
+ 999: '#171614',
75
+ };
76
+ export const taupe = {
77
+ 50: '#f8f6f5',
78
+ 100: '#f0ece9',
79
+ 200: '#e4dcd6',
80
+ 300: '#d3c7be',
81
+ 400: '#bdaea2',
82
+ 500: '#a29184',
83
+ 600: '#827366',
84
+ 700: '#67594f',
85
+ 800: '#4f443b',
86
+ 900: '#38302a',
87
+ 999: '#1a1511',
88
+ };
89
+ export const red = {
90
+ 50: '#fff4f2',
91
+ 100: '#ffe6e3',
92
+ 200: '#ffd2cc',
93
+ 300: '#ffb4ab',
94
+ 400: '#ff8b7f',
95
+ 500: '#fd4c45',
96
+ 600: '#d52727',
97
+ 700: '#ae0914',
98
+ 800: '#88030c',
99
+ 900: '#620407',
100
+ 999: '#330000',
101
+ };
102
+ export const orange = {
103
+ 50: '#fff4ee',
104
+ 100: '#ffe8da',
105
+ 200: '#ffd8c1',
106
+ 300: '#ffc19c',
107
+ 400: '#ff9d5e',
108
+ 500: '#ef7500',
109
+ 600: '#c05d00',
110
+ 700: '#964700',
111
+ 800: '#733400',
112
+ 900: '#522300',
113
+ 999: '#290d00',
114
+ };
115
+ export const gold = {
116
+ 50: '#fff5e7',
117
+ 100: '#ffeaca',
118
+ 200: '#ffe1b5',
119
+ 300: '#ffd593',
120
+ 400: '#feb93d',
121
+ 500: '#df9c00',
122
+ 600: '#b37d00',
123
+ 700: '#8a5f00',
124
+ 800: '#664500',
125
+ 900: '#472e00',
126
+ 999: '#211300',
127
+ };
128
+ export const yellow = {
129
+ 50: '#fcf8df',
130
+ 100: '#f8efb6',
131
+ 200: '#fce873',
132
+ 300: '#fbe136',
133
+ 400: '#f4d90b',
134
+ 500: '#d3bb00',
135
+ 600: '#ab9700',
136
+ 700: '#817100',
137
+ 800: '#5c5000',
138
+ 900: '#3d3500',
139
+ 999: '#1b1600',
140
+ };
141
+ export const lime = {
142
+ 50: '#f2fae9',
143
+ 100: '#e2f4ce',
144
+ 200: '#d2f4a9',
145
+ 300: '#c0ee82',
146
+ 400: '#a6dc51',
147
+ 500: '#87bf0e',
148
+ 600: '#6b9a00',
149
+ 700: '#517600',
150
+ 800: '#3a5600',
151
+ 900: '#263b00',
152
+ 999: '#0e1a00',
153
+ };
154
+ export const green = {
155
+ 50: '#effaf1',
156
+ 100: '#dcf5e0',
157
+ 200: '#bdeec6',
158
+ 300: '#95e2a5',
159
+ 400: '#61cf7e',
160
+ 500: '#25b459',
161
+ 600: '#009141',
162
+ 700: '#007231',
163
+ 800: '#005724',
164
+ 900: '#003e17',
165
+ 999: '#001d06',
166
+ };
167
+ export const jade = {
168
+ 50: '#eefaf4',
169
+ 100: '#daf4e8',
170
+ 200: '#baedd6',
171
+ 300: '#8ee1be',
172
+ 400: '#54cea1',
173
+ 500: '#00b283',
174
+ 600: '#008e68',
175
+ 700: '#006f51',
176
+ 800: '#00553d',
177
+ 900: '#003c2a',
178
+ 999: '#001c11',
179
+ };
180
+ export const turquoise = {
181
+ 50: '#eefaf8',
182
+ 100: '#daf3f0',
183
+ 200: '#bcece7',
184
+ 300: '#94e1da',
185
+ 400: '#5dcec5',
186
+ 500: '#13b3aa',
187
+ 600: '#009088',
188
+ 700: '#007069',
189
+ 800: '#00544f',
190
+ 900: '#003b38',
191
+ 999: '#001b19',
192
+ };
193
+ export const aqua = {
194
+ 50: '#eef9fb',
195
+ 100: '#daf2f5',
196
+ 200: '#beecf2',
197
+ 300: '#98e3ec',
198
+ 400: '#64d0de',
199
+ 500: '#23b5c4',
200
+ 600: '#00919f',
201
+ 700: '#00707b',
202
+ 800: '#00545c',
203
+ 900: '#003b41',
204
+ 999: '#001b1e',
205
+ };
206
+ export const azure = {
207
+ 50: '#eef9ff',
208
+ 100: '#daf1ff',
209
+ 200: '#bde6ff',
210
+ 300: '#91d6ff',
211
+ 400: '#5ac0f7',
212
+ 500: '#15a4e1',
213
+ 600: '#0082b6',
214
+ 700: '#00668f',
215
+ 800: '#004d6e',
216
+ 900: '#003750',
217
+ 999: '#001927',
218
+ };
219
+ export const blue = {
220
+ 50: '#f2f7ff',
221
+ 100: '#e2eeff',
222
+ 200: '#cbdfff',
223
+ 300: '#aaccff',
224
+ 400: '#81b2ff',
225
+ 500: '#4c92ff',
226
+ 600: '#2771e0',
227
+ 700: '#1356b8',
228
+ 800: '#0b4290',
229
+ 900: '#072e68',
230
+ 999: '#001337',
231
+ };
232
+ export const royal = {
233
+ 50: '#f4f6ff',
234
+ 100: '#e7ecff',
235
+ 200: '#d4dcff',
236
+ 300: '#bac6ff',
237
+ 400: '#9aaaff',
238
+ 500: '#7787ff',
239
+ 600: '#5963e5',
240
+ 700: '#444abc',
241
+ 800: '#333894',
242
+ 900: '#23276b',
243
+ 999: '#0d0f39',
244
+ };
245
+ export const lavender = {
246
+ 50: '#f7f5ff',
247
+ 100: '#edeaff',
248
+ 200: '#dfd8ff',
249
+ 300: '#cdbfff',
250
+ 400: '#b69fff',
251
+ 500: '#9d79f6',
252
+ 600: '#7e5bd0',
253
+ 700: '#6443ab',
254
+ 800: '#4c3285',
255
+ 900: '#362361',
256
+ 999: '#190c33',
257
+ };
258
+ export const purple = {
259
+ 50: '#fbf4ff',
260
+ 100: '#f6e6ff',
261
+ 200: '#eed1ff',
262
+ 300: '#e4b4ff',
263
+ 400: '#d78cff',
264
+ 500: '#be68ea',
265
+ 600: '#9d49c5',
266
+ 700: '#7e33a1',
267
+ 800: '#61257d',
268
+ 900: '#46195a',
269
+ 999: '#22062f',
270
+ };
271
+ export const magenta = {
272
+ 50: '#fff3fb',
273
+ 100: '#ffe3f7',
274
+ 200: '#ffccf1',
275
+ 300: '#ffa9ea',
276
+ 400: '#f97cde',
277
+ 500: '#e053c6',
278
+ 600: '#bb32a3',
279
+ 700: '#971c83',
280
+ 800: '#761266',
281
+ 900: '#550c49',
282
+ 999: '#2b0124',
283
+ };
284
+ export const pink = {
285
+ 50: '#fff3f7',
286
+ 100: '#ffe5ee',
287
+ 200: '#ffcfe0',
288
+ 300: '#ffaecd',
289
+ 400: '#ff81b6',
290
+ 500: '#e75a9a',
291
+ 600: '#c13b7b',
292
+ 700: '#9c2661',
293
+ 800: '#7a1a4a',
294
+ 900: '#581235',
295
+ 999: '#2d0318',
296
+ };
297
+ export const ruby = {
298
+ 50: '#fff4f4',
299
+ 100: '#ffe6e8',
300
+ 200: '#ffd0d5',
301
+ 300: '#ffb2ba',
302
+ 400: '#ff8798',
303
+ 500: '#f94b72',
304
+ 600: '#d12655',
305
+ 700: '#aa0b40',
306
+ 800: '#85042f',
307
+ 900: '#600421',
308
+ 999: '#32000b',
309
+ };
310
+ /** Every hue by name, for lookups by a name that's only known at run time. */
311
+ export const palette = {
312
+ steel,
313
+ gray,
314
+ silver,
315
+ ash,
316
+ taupe,
317
+ red,
318
+ orange,
319
+ gold,
320
+ yellow,
321
+ lime,
322
+ green,
323
+ jade,
324
+ turquoise,
325
+ aqua,
326
+ azure,
327
+ blue,
328
+ royal,
329
+ lavender,
330
+ purple,
331
+ magenta,
332
+ pink,
333
+ ruby,
334
+ };
@@ -0,0 +1,193 @@
1
+ /**
2
+ * Shapes (ADR 0024): custom outlines for any element, as plain CSS.
3
+ *
4
+ * A shape is a list of points in the element's box. Each coordinate is a
5
+ * percentage of the box plus pixels plus multiples of named parameters, so a
6
+ * 12px corner stays 12px whatever the element's size. It compiles to:
7
+ *
8
+ * - **one geometry**: a `polygon()` clip on the element, and a ring (its
9
+ * border) on the element's own pseudo-element, computed from the same points;
10
+ * - **animated parameters**: each parameter is a registered custom property
11
+ * (`--greese-shape-<param>`). Hover, press, focus and entrance change the
12
+ * parameters, never `clip-path`, so the clip and its border interpolate
13
+ * together by construction, and transforms (the `greese` prop) move both;
14
+ * - **no runtime**: nothing in the browser, and no extra markup.
15
+ *
16
+ * This module only builds CSS: the Studio and build scripts import it, apps
17
+ * don't (it isn't in the package's main entry).
18
+ */
19
+ /** One coordinate: `pct`% of the box, plus `px`, plus `k` times parameter `param`. */
20
+ export interface ShapeLength {
21
+ pct?: number;
22
+ px?: number;
23
+ param?: string;
24
+ /** How many of `param` (negative to subtract). @default 1 */
25
+ k?: number;
26
+ }
27
+ export interface ShapePoint {
28
+ x: ShapeLength;
29
+ y: ShapeLength;
30
+ /**
31
+ * Rounds this corner: a radius in px, or a parameter's name. The arc is
32
+ * flattened into points at build time, so it animates like any other.
33
+ */
34
+ round?: number | string;
35
+ }
36
+ /** Parameter values: name → px. */
37
+ export type ShapeParams = Record<string, number>;
38
+ export interface ShapeDef {
39
+ /** The outline, clockwise from the top start. */
40
+ points: ShapePoint[];
41
+ /** Parameters at rest, in px. */
42
+ params?: ShapeParams;
43
+ /** Parameters while hovered (fine pointers only). */
44
+ hover?: ShapeParams;
45
+ /** Parameters while pressed. */
46
+ active?: ShapeParams;
47
+ /** The border drawn along the shape. Width in px; color any CSS color, `auto` for the component's own. */
48
+ border?: {
49
+ width?: number;
50
+ color?: string;
51
+ };
52
+ /**
53
+ * How keyboard focus shows. `box`: the shape eases back to its box and the
54
+ * usual focus ring draws round it (needs every parameter at 0 to be the
55
+ * box). `ring`: a thicker border in the focus color, inside the shape.
56
+ * @default 'box' when possible, else 'ring'
57
+ */
58
+ focus?: 'box' | 'ring';
59
+ /** Mirror it for right-to-left text: for shapes with a direction, like a tag's point. */
60
+ mirror?: boolean;
61
+ }
62
+ /** How a shape fits a particular element: which pseudo-element draws its border, and so on. */
63
+ export interface ShapeTarget {
64
+ /** The element's selector. */
65
+ selector: string;
66
+ /** In SHAPE_TARGETS: the element a component's shape goes on, when not its root (`.greese-SpeedDial-trigger`). */
67
+ select?: string;
68
+ /**
69
+ * Where the element faces the other way, as in right-to-left text: a
70
+ * selector suffix (`.greese-ChatBubble--end &`) that takes the shape mirrored.
71
+ */
72
+ mirrorOn?: string;
73
+ /** The pseudo-element free for the border. @default '::after' */
74
+ pseudo?: '::before' | '::after';
75
+ /** Selector suffix for hover (`:hover`), or a selector of its own (`&--interactive:hover`). */
76
+ hover?: string | false;
77
+ /** Selector suffix for press. */
78
+ active?: string | false;
79
+ /** The element is already positioned (fixed, sticky, absolute): don't make it relative. */
80
+ positioned?: boolean;
81
+ /** The border color when the shape's is `auto`: the component's own border color. */
82
+ borderColor?: string;
83
+ /** Extra rules for variants, e.g. a different border color per modifier: selector → declarations. */
84
+ variants?: Record<string, Record<string, string>>;
85
+ /** The element's own transitions, restated (a `transition` replaces the whole list). */
86
+ transitions?: string[];
87
+ /**
88
+ * Transitions only some of its variants have (selector suffix → list), so
89
+ * the restated list doesn't give every element one: a moving property that
90
+ * transitions lags whatever animates it, a mask included.
91
+ */
92
+ variantTransitions?: Record<string, string[]>;
93
+ /** Don't animate parameters (the element's transitions are its own, e.g. a dialog's). */
94
+ still?: boolean;
95
+ /**
96
+ * At least 44px on touch screens, since the shape clips the hit area too.
97
+ * It changes the element's size, so the library's own targets don't use it.
98
+ */
99
+ touch?: boolean;
100
+ /**
101
+ * Draw a border along the shape (a pseudo-element). Off for elements with
102
+ * no border, no pseudo-element to spare, or that scroll their own content
103
+ * (the layer would scroll with it): the element is only clipped.
104
+ * @default true
105
+ */
106
+ ring?: boolean;
107
+ /**
108
+ * How focus shows, over the shape's own choice: `ring` (a focus-colored
109
+ * ring inside the shape, for elements that stay focused while used, like
110
+ * fields), or `keep` (the element's own focus style, drawn inside the box,
111
+ * already survives the clip).
112
+ */
113
+ focus?: 'ring' | 'keep';
114
+ /** Selector suffix for focus. @default ':focus-visible' */
115
+ focusOn?: string;
116
+ /**
117
+ * Smaller elements, smaller features: selector suffix → a factor for every
118
+ * parameter, so a cut that suits a button doesn't swallow an icon button.
119
+ */
120
+ scale?: Record<string, number>;
121
+ }
122
+ /** The custom property behind a parameter. */
123
+ export declare const shapeVar: (param: string) => string;
124
+ /** The parameters a shape uses, in a stable order. */
125
+ export declare const shapeParams: (def: ShapeDef) => string[];
126
+ /** True when the shape with every parameter at 0 is its whole box, so `box` focus works. */
127
+ export declare const opensToBox: (def: ShapeDef) => boolean;
128
+ /**
129
+ * The outline at one size, as numbers: for editors and previews. `inset`
130
+ * gives the border's inner edge instead.
131
+ */
132
+ export declare const shapePoints: (def: ShapeDef, w: number, h: number, params?: ShapeParams, inset?: number) => Array<[number, number]>;
133
+ /** `@property` rules for the parameters: registered, so they animate. Once per page is enough. */
134
+ export declare const shapeProperties: (params: Iterable<string>) => string;
135
+ /** The shape flipped start to end, still clockwise. */
136
+ export declare const mirrored: (def: ShapeDef) => ShapeDef;
137
+ /** Where a shape is used: an element's selector and how it takes the shape. */
138
+ export interface ShapeUse extends ShapeTarget {
139
+ /** The shape's name. */
140
+ shape: string;
141
+ }
142
+ /**
143
+ * The CSS for a set of shapes and the elements that take them. Each shape's
144
+ * geometry is written once, on every element that takes it, as two custom
145
+ * properties computed on the element itself (`--greese-shape-clip` and
146
+ * `--greese-shape-ring-clip`), so its border layer inherits the ring already
147
+ * resolved with the element's parameters, mid-transition included. The
148
+ * mechanics (the clip, the border layer, transitions) are written once per
149
+ * kind of element. Pair it with `shapeProperties()` once.
150
+ */
151
+ export declare const shapesCss: (shapes: Record<string, ShapeDef>, uses: ShapeUse[]) => string;
152
+ /** One shape on one element: `shapesCss` for a single use. */
153
+ export declare const shapeCss: (def: ShapeDef, target: ShapeTarget) => string;
154
+ /**
155
+ * How each component takes a shape: which element, whether a pseudo-element
156
+ * is free for the border, how it shows focus, its own transitions. A
157
+ * component not listed takes the defaults (its root, `::after`, the border
158
+ * token). Clipping removes shadows and anything drawn outside the box, so an
159
+ * entry also says what replaces them.
160
+ */
161
+ export declare const SHAPE_TARGETS: Record<string, Omit<ShapeTarget, 'selector'>>;
162
+ /** The element a component's shape goes on. */
163
+ export declare const shapeSelector: (component: string) => string;
164
+ /** The class that gives any element a shape: `greese-shape-<name>`. */
165
+ export declare const shapeClass: (name: string) => string;
166
+ /** A component's target for a shape, or the default for an element with the shape's class. */
167
+ export declare const shapeTarget: (component?: string) => Omit<ShapeTarget, "selector">;
168
+ /** The box itself. */
169
+ export declare const rectangle: () => ShapeDef;
170
+ /** Corners cut on the diagonal: `a` top-start and bottom-end, `b` the other two. */
171
+ export declare const bevel: (a?: number, b?: number) => ShapeDef;
172
+ /** Square notches out of every corner. */
173
+ export declare const notch: (n?: number) => ShapeDef;
174
+ /** A tag: square at the start, pointed at the end by `t`. */
175
+ export declare const tag: (t?: number) => ShapeDef;
176
+ /** Pointed at both ends: a hexagon, `h` deep. */
177
+ export declare const hexagon: (h?: number) => ShapeDef;
178
+ /** Leaning like italic type: top edge shifted by `s` toward the end. */
179
+ export declare const slant: (s?: number) => ShapeDef;
180
+ /** The top-end corner folded down by `f`. */
181
+ export declare const dogEar: (f?: number) => ShapeDef;
182
+ /** A ticket: a half-round notch `r` deep in each side, halfway down. */
183
+ export declare const ticket: (r?: number) => ShapeDef;
184
+ /** Top corners cut by `c`: a tab, or a folder's. */
185
+ export declare const tabTop: (c?: number) => ShapeDef;
186
+ /** A zigzag hem along the bottom edge: `teeth` teeth, `z` deep. */
187
+ export declare const zigzag: (z?: number, teeth?: number) => ShapeDef;
188
+ /** A diamond: the midpoints of the box's sides, for marks (avatars, status dots). */
189
+ export declare const diamond: () => ShapeDef;
190
+ /** A shield: free-form, in percentages, rounded at the top corners. */
191
+ export declare const shield: () => ShapeDef;
192
+ /** The presets by name, for pickers. */
193
+ export declare const SHAPE_PRESETS: Record<string, () => ShapeDef>;