@charmland/gem 0.0.0-stage → 0.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 (121) hide show
  1. package/LICENSE +177 -0
  2. package/NOTICE +13 -0
  3. package/README.md +24 -2
  4. package/assets/fonts/Hypography-Italic.woff2 +0 -0
  5. package/assets/fonts/Hypography-Regular.woff2 +0 -0
  6. package/assets/fonts/PPFraktionMono-Variable.ttf +0 -0
  7. package/assets/fonts/PPFraktionMonoItalic-Variable.ttf +0 -0
  8. package/assets/fonts/PPFraktionSans-Variable.ttf +0 -0
  9. package/assets/fonts/PPFraktionSansItalic-Variable.ttf +0 -0
  10. package/bin/gem-elm.js +3 -0
  11. package/dist/browser/boot.d.ts +10 -0
  12. package/dist/browser/boot.js +14 -0
  13. package/dist/browser/color-scheme.d.ts +9 -0
  14. package/dist/browser/color-scheme.js +76 -0
  15. package/dist/browser/ports.d.ts +37 -0
  16. package/dist/browser/ports.js +90 -0
  17. package/dist/browser/router.d.ts +5 -0
  18. package/dist/browser/router.js +35 -0
  19. package/dist/browser/runtime.d.ts +12 -0
  20. package/dist/browser/runtime.js +22 -0
  21. package/dist/browser/tabs.d.ts +9 -0
  22. package/dist/browser/tabs.js +69 -0
  23. package/dist/default/theme.css +4664 -0
  24. package/dist/default/theme.js +13652 -0
  25. package/dist/node/build.d.ts +16 -0
  26. package/dist/node/build.js +48 -0
  27. package/dist/node/cli.d.ts +2 -0
  28. package/dist/node/cli.js +21 -0
  29. package/elm.json +28 -0
  30. package/package.json +86 -4
  31. package/src/app/Gem/App.elm +1275 -0
  32. package/src/app/Gem/CharmSticker.elm +35 -0
  33. package/src/app/Gem/Components.elm +292 -0
  34. package/src/app/Gem/Main.elm +17 -0
  35. package/src/app/Gem/Ports.elm +32 -0
  36. package/src/app/Gem/Shell.elm +964 -0
  37. package/src/browser/theme.d.ts +1 -0
  38. package/src/core/Gem/Node.elm +219 -0
  39. package/src/core/Gem/Page.elm +409 -0
  40. package/src/core/Gem/Render.elm +472 -0
  41. package/src/core/Gem/Slots.elm +11 -0
  42. package/src/styles/docs.scss +1083 -0
  43. package/src/styles/fonts.scss +51 -0
  44. package/src/styles/gem.scss +362 -0
  45. package/src/styles/theme.scss +8 -0
  46. package/src/styles/ui/burger.scss +272 -0
  47. package/src/styles/ui/button.scss +350 -0
  48. package/src/styles/ui/charmtone.scss +70 -0
  49. package/src/styles/ui/controls-extra.scss +316 -0
  50. package/src/styles/ui/controls.scss +110 -0
  51. package/src/styles/ui/display.scss +359 -0
  52. package/src/styles/ui/dropdown.scss +341 -0
  53. package/src/styles/ui/form.scss +314 -0
  54. package/src/styles/ui/menu.scss +200 -0
  55. package/src/styles/ui/meter.scss +124 -0
  56. package/src/styles/ui/modal.scss +545 -0
  57. package/src/styles/ui/oauth.scss +50 -0
  58. package/src/styles/ui/page-nav.scss +63 -0
  59. package/src/styles/ui/reset.scss +111 -0
  60. package/src/styles/ui/scrollbar.scss +39 -0
  61. package/src/styles/ui/search.scss +164 -0
  62. package/src/styles/ui/sidebar.scss +229 -0
  63. package/src/styles/ui/squircle.scss +60 -0
  64. package/src/styles/ui/table.scss +97 -0
  65. package/src/styles/ui/theme.scss +132 -0
  66. package/src/styles/ui/toast.scss +587 -0
  67. package/src/styles/ui/toc.scss +128 -0
  68. package/src/styles/ui/typography.scss +21 -0
  69. package/src/styles/ui/ui.scss +33 -0
  70. package/src/ui/Ui/Badge.elm +51 -0
  71. package/src/ui/Ui/Banner.elm +97 -0
  72. package/src/ui/Ui/Burger.elm +259 -0
  73. package/src/ui/Ui/Button.elm +261 -0
  74. package/src/ui/Ui/Card.elm +32 -0
  75. package/src/ui/Ui/Cards.elm +15 -0
  76. package/src/ui/Ui/ChoiceGroup.elm +62 -0
  77. package/src/ui/Ui/CopyButton.elm +139 -0
  78. package/src/ui/Ui/Divider.elm +16 -0
  79. package/src/ui/Ui/Dropdown.elm +600 -0
  80. package/src/ui/Ui/Empty.elm +41 -0
  81. package/src/ui/Ui/ErrorBubble.elm +34 -0
  82. package/src/ui/Ui/Field.elm +45 -0
  83. package/src/ui/Ui/FormStatus.elm +32 -0
  84. package/src/ui/Ui/Icon.elm +381 -0
  85. package/src/ui/Ui/InlineForm.elm +51 -0
  86. package/src/ui/Ui/Input.elm +113 -0
  87. package/src/ui/Ui/KeyValue.elm +25 -0
  88. package/src/ui/Ui/ListRow.elm +67 -0
  89. package/src/ui/Ui/Loader.elm +32 -0
  90. package/src/ui/Ui/Logo/Charm.elm +21 -0
  91. package/src/ui/Ui/Logo/CharmMark.elm +32 -0
  92. package/src/ui/Ui/Logo/CharmSticker.elm +35 -0
  93. package/src/ui/Ui/Logo/Discord.elm +26 -0
  94. package/src/ui/Ui/Logo/GitHub.elm +21 -0
  95. package/src/ui/Ui/Logo/Google.elm +21 -0
  96. package/src/ui/Ui/Logo/Hexy.elm +29 -0
  97. package/src/ui/Ui/Logo/Hyper.elm +42 -0
  98. package/src/ui/Ui/Logo/Integration.elm +117 -0
  99. package/src/ui/Ui/Logo/Prism.elm +35 -0
  100. package/src/ui/Ui/Logos.elm +115 -0
  101. package/src/ui/Ui/Menu.elm +348 -0
  102. package/src/ui/Ui/Meter.elm +132 -0
  103. package/src/ui/Ui/Modal.elm +247 -0
  104. package/src/ui/Ui/Motion.elm +32 -0
  105. package/src/ui/Ui/NumberBox.elm +86 -0
  106. package/src/ui/Ui/OAuthButton.elm +39 -0
  107. package/src/ui/Ui/PageNav.elm +65 -0
  108. package/src/ui/Ui/Pager.elm +49 -0
  109. package/src/ui/Ui/Search.elm +396 -0
  110. package/src/ui/Ui/SearchBox.elm +78 -0
  111. package/src/ui/Ui/Section.elm +21 -0
  112. package/src/ui/Ui/Sidebar.elm +239 -0
  113. package/src/ui/Ui/Stat.elm +29 -0
  114. package/src/ui/Ui/Switch.elm +34 -0
  115. package/src/ui/Ui/Table.elm +89 -0
  116. package/src/ui/Ui/Tabs.elm +280 -0
  117. package/src/ui/Ui/ToC.elm +120 -0
  118. package/src/ui/Ui/Toast.elm +1145 -0
  119. package/src/ui/Ui/Toolbar.elm +31 -0
  120. package/src/ui/Ui/TwoStepConfirm.elm +159 -0
  121. package/src/ui/Ui/Typography.elm +33 -0
@@ -0,0 +1,350 @@
1
+ @use "charmtone";
2
+ @use "controls" as *;
3
+ @use "sass:color";
4
+
5
+ // The button: five variants, three sizes, the two-step purchase state.
6
+
7
+ button {
8
+ padding: 0.6rem 1.5rem;
9
+ gap: 0.4rem;
10
+ // Button labels are controls, not copy: dragging across one should
11
+ // never select its text.
12
+ user-select: none;
13
+ border: $control-border solid transparent;
14
+ // Every variant shares the control radius of fields and dropdown
15
+ // triggers, so a flat ghost next to a filled primary lines
16
+ // up instead of reading as a different shape.
17
+ border-radius: calc(#{$control-radius} * var(--squircle-scale, 1));
18
+ font-family: inherit;
19
+ font-size: 1rem;
20
+ font-weight: 620;
21
+ cursor: pointer;
22
+ transition:
23
+ background 125ms ease,
24
+ color 125ms ease,
25
+ border-color 125ms ease,
26
+ // The press feedback rides a spring curve: the pill dips under the
27
+ // pointer and overshoots back on release, so the click reads as
28
+ // physical rather than a state swap.
29
+ transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
30
+ }
31
+
32
+ button.primary,
33
+ button.secondary,
34
+ button.ghost,
35
+ button.danger {
36
+ @include control-size($control-height);
37
+ display: inline-flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ padding-inline: 1.5rem;
41
+ // Charmform's em box rides high in the line, so a centered pill's ink
42
+ // floats with more air under it than over it. The extra top padding
43
+ // drops the centered label by half of itself, giving the bottom gap
44
+ // back to the top.
45
+ padding-top: 0.2rem;
46
+ line-height: 1.2;
47
+ text-decoration: none;
48
+ }
49
+
50
+ // The dense button: table rows, pagers, and in-row editors.
51
+ button.compact {
52
+ @include control-size($control-height-sm);
53
+ padding-inline: 0.9rem;
54
+ font-size: 0.875rem;
55
+ }
56
+
57
+ // The extra-small button: a control beside content rather than a tool
58
+ // in a toolbar, so it shares the line height of the copy around it.
59
+ button.xs {
60
+ @include control-size($control-height-xs);
61
+ padding-inline: 0.5rem;
62
+ font-size: 0.75rem;
63
+ }
64
+
65
+ // The wide button: checkout and empty-card CTAs stretch to the row.
66
+ button.wide {
67
+ width: 100%;
68
+ }
69
+
70
+ button.primary {
71
+ background: charmtone.$charple;
72
+ color: charmtone.$salt;
73
+ border-color: transparent;
74
+
75
+ // The hover steps down a rung of the purple ladder rather than
76
+ // swapping in an accent, so the salt label keeps its contrast:
77
+ // salt on blush is 1.95:1, on jelly it is 7.2:1.
78
+ &:hover {
79
+ background: charmtone.$jelly;
80
+ }
81
+ }
82
+
83
+ button.secondary {
84
+ background: transparent;
85
+ // Text follows the theme's foreground and the border is the frame
86
+ // hairline, one step off the background in either direction. The old
87
+ // iron-on-char pairing read as disabled in dark mode.
88
+ color: var(--fg);
89
+ border-color: var(--frame);
90
+
91
+ &:hover {
92
+ // Dark pages hover in blush, the accent primary already wears; charple
93
+ // text on the dark page reads as noise. The light theme keeps charple,
94
+ // which carries the contrast salt needs there.
95
+ border-color: charmtone.$blush;
96
+ color: charmtone.$blush;
97
+ }
98
+ }
99
+
100
+ :root[data-theme="light"] button.secondary:hover {
101
+ border-color: charmtone.$charple;
102
+ color: charmtone.$charple;
103
+ }
104
+
105
+ button.ghost {
106
+ background: transparent;
107
+ // The quiet variant: the muted foreground, which dims with the light
108
+ // theme instead of washing out on the dark one.
109
+ color: var(--muted);
110
+ border-color: transparent;
111
+
112
+ &:hover {
113
+ background: charmtone.$julep;
114
+ color: charmtone.$pepper;
115
+ }
116
+ }
117
+
118
+ button.danger {
119
+ background: transparent;
120
+ // Danger keeps the salt label too, so its fill has to reach the deep
121
+ // end of the pink ladder: salt on tuna is 2.44:1, on pom it is 6.3:1.
122
+ color: charmtone.$pom;
123
+ border-color: transparent;
124
+
125
+ &:hover {
126
+ background: charmtone.$pom;
127
+ color: charmtone.$salt;
128
+ }
129
+ }
130
+
131
+ button.danger.solid {
132
+ background: charmtone.$pom;
133
+ color: charmtone.$salt;
134
+ border-color: transparent;
135
+
136
+ &:hover {
137
+ background: color.adjust(charmtone.$pom, $lightness: -8%);
138
+ color: charmtone.$salt;
139
+ }
140
+ }
141
+
142
+ // Raised buttons: the filled and outlined variants share the press
143
+ // treatment. Flat variants (ghost, plain danger), glyph and segmented
144
+ // controls, and the dropdown openers stay out of it.
145
+ button.primary,
146
+ button.secondary,
147
+ button.danger.solid {
148
+ transition:
149
+ background 125ms ease,
150
+ color 125ms ease,
151
+ border-color 125ms ease,
152
+ box-shadow 125ms ease;
153
+ }
154
+
155
+ // Keyboard focus: the same ring the fields wear, so tabbing through a
156
+ // toolbar reads as one system. Danger controls ring in coral.
157
+ button:focus-visible {
158
+ @include control-focus;
159
+ }
160
+
161
+ // Filled and flat variants hold no border of their own, so they ring
162
+ // without warming one: primary and ghost under the ring token, the
163
+ // danger pair under the danger token.
164
+ button.primary:focus-visible,
165
+ button.ghost:focus-visible {
166
+ @include control-focus-flat;
167
+ }
168
+
169
+ button.danger:focus-visible,
170
+ button.danger.solid:focus-visible {
171
+ @include control-focus-danger;
172
+ }
173
+
174
+ button:is(.primary, .secondary, .ghost, .danger):active:not(:disabled),
175
+ a:is(.primary, .secondary, .ghost, .danger):active:not([aria-disabled="true"]) {
176
+ transform: scale(0.96);
177
+ }
178
+
179
+ // Two-step purchase button: the first click arms it, the second
180
+ // confirms. Arming swaps the visible label and turns the fill julep.
181
+ // The labels grid-stack in one cell and switch with visibility rather
182
+ // than display, so the wider one sets the width and the button never
183
+ // resizes mid-interaction.
184
+ button.purchase {
185
+ // No hover fill: the only color change this button makes is the
186
+ // armed state, so a blush hover would read as a third state.
187
+ &:hover {
188
+ background: charmtone.$charple;
189
+ }
190
+
191
+ .labels {
192
+ display: inline-grid;
193
+ grid-template-areas: "label";
194
+
195
+ span {
196
+ grid-area: label;
197
+ transition: opacity 125ms ease;
198
+ }
199
+
200
+ span:last-child {
201
+ opacity: 0;
202
+ visibility: hidden;
203
+ }
204
+ }
205
+
206
+ &.armed {
207
+ background: charmtone.$julep;
208
+ color: charmtone.$pepper;
209
+
210
+ &:hover {
211
+ background: charmtone.$julep;
212
+ }
213
+
214
+ .labels {
215
+ span:first-child {
216
+ opacity: 0;
217
+ visibility: hidden;
218
+ }
219
+
220
+ span:last-child {
221
+ opacity: 1;
222
+ visibility: visible;
223
+ }
224
+ }
225
+ }
226
+ }
227
+
228
+ button:disabled,
229
+ a[aria-disabled="true"] {
230
+ opacity: 0.5;
231
+ cursor: not-allowed;
232
+ }
233
+
234
+ // Link buttons wear the same shapes as real buttons: the base
235
+ // `button` rule's radius, border, weight, and selectability don't
236
+ // reach anchors, so the variants repeat here.
237
+ a.primary,
238
+ a.secondary,
239
+ a.ghost,
240
+ a.danger,
241
+ a.danger.solid {
242
+ @include control-size($control-height);
243
+ display: inline-flex;
244
+ align-items: center;
245
+ justify-content: center;
246
+ gap: 0.4rem;
247
+ padding-inline: 1.5rem;
248
+ // Optical centering, same as the buttons: Charmform rides high.
249
+ padding-top: 0.2rem;
250
+ line-height: 1.2;
251
+ border: $control-border solid transparent;
252
+ border-radius: calc(#{$control-radius} * var(--squircle-scale, 1));
253
+ font-size: 1rem;
254
+ font-weight: 620;
255
+ text-decoration: none;
256
+ cursor: pointer;
257
+ user-select: none;
258
+ }
259
+
260
+ a.primary {
261
+ background: charmtone.$charple;
262
+ color: charmtone.$salt;
263
+
264
+ &:hover {
265
+ background: charmtone.$jelly;
266
+ }
267
+ }
268
+
269
+ a.secondary {
270
+ // Anchors need the base `button` rule's family, weight, and
271
+ // selectability carried over (see the shared shape rule above). The
272
+ // border is declared as width/style, not the shorthand, so it
273
+ // doesn't reset the frame border-color the variant rule above set.
274
+ font-family: inherit;
275
+ user-select: none;
276
+ border-width: $control-border;
277
+ border-style: solid;
278
+ background: transparent;
279
+ color: var(--fg);
280
+ border-color: var(--frame);
281
+
282
+ &:hover {
283
+ border-color: charmtone.$blush;
284
+ color: charmtone.$blush;
285
+ }
286
+ }
287
+
288
+ :root[data-theme="light"] a.secondary:hover {
289
+ border-color: charmtone.$charple;
290
+ color: charmtone.$charple;
291
+ }
292
+
293
+ a.ghost {
294
+ background: transparent;
295
+ color: var(--muted);
296
+
297
+ &:hover {
298
+ background: charmtone.$julep;
299
+ color: charmtone.$pepper;
300
+ }
301
+ }
302
+
303
+ a.danger {
304
+ background: transparent;
305
+ color: charmtone.$pom;
306
+
307
+ &:hover {
308
+ background: charmtone.$pom;
309
+ color: charmtone.$salt;
310
+ }
311
+ }
312
+
313
+ a.danger.solid {
314
+ background: charmtone.$pom;
315
+ color: charmtone.$salt;
316
+ border-color: transparent;
317
+
318
+ &:hover {
319
+ background: color.adjust(charmtone.$pom, $lightness: -8%);
320
+ color: charmtone.$salt;
321
+ }
322
+ }
323
+
324
+ // The dense anchor: table rows and pagers that lead to another page.
325
+ a.compact {
326
+ @include control-size($control-height-sm);
327
+ padding-inline: 0.9rem;
328
+ font-size: 0.875rem;
329
+ }
330
+
331
+ a.xs {
332
+ @include control-size($control-height-xs);
333
+ padding-inline: 0.5rem;
334
+ font-size: 0.75rem;
335
+ }
336
+
337
+ a.wide {
338
+ width: 100%;
339
+ }
340
+
341
+ a.primary:focus-visible,
342
+ a.secondary:focus-visible,
343
+ a.ghost:focus-visible {
344
+ @include control-focus-flat;
345
+ }
346
+
347
+ a.danger:focus-visible,
348
+ a.danger.solid:focus-visible {
349
+ @include control-focus-danger;
350
+ }
@@ -0,0 +1,70 @@
1
+ $cumin: #bf976f;
2
+ $tang: #ff985a;
3
+ $yam: #ffb587;
4
+ $paprika: #d36c64;
5
+ $bengal: #ff6e63;
6
+ $uni: #ff937d;
7
+ $sriracha: #eb4268;
8
+ $coral: #ff577d;
9
+ $salmon: #ff7f90;
10
+ $chili: #e23080;
11
+ $cherry: #ff388b;
12
+ $tuna: #ff6daa;
13
+ $macaron: #e940b0;
14
+ $pony: #ff4fbf;
15
+ $cheeky: #ff79d0;
16
+ $flamingo: #f947e3;
17
+ $dolly: #ff60ff;
18
+ $blush: #ff84ff;
19
+ $urchin: #c337e0;
20
+ $mochi: #eb5dff;
21
+ $lilac: #f379ff;
22
+ $prince: #9c35e1;
23
+ $violet: #c259ff;
24
+ $mauve: #d46eff;
25
+ $grape: #7134dd;
26
+ $plum: #9953ff;
27
+ $orchid: #ad6eff;
28
+ $jelly: #4a30d9;
29
+ $charple: #6b50ff;
30
+ $hazy: #8b75ff;
31
+ $ox: #3331b2;
32
+ $sapphire: #4949ff;
33
+ $guppy: #7272ff;
34
+ $oceania: #2b55b3;
35
+ $thunder: #4776ff;
36
+ $anchovy: #719afc;
37
+ $damson: #007ab8;
38
+ $malibu: #00a4ff;
39
+ $sardine: #4fbefe;
40
+ $zinc: #10b1ae;
41
+ $turtle: #0adcd9;
42
+ $lichen: #5cdfea;
43
+ $guac: #12c78f;
44
+ $julep: #00ffb2;
45
+ $bok: #68ffd6;
46
+ $mustard: #f5ef34;
47
+ $citron: #e8ff27;
48
+ $zest: #e8fe96;
49
+ $butter: #fffaf1;
50
+ $pepper: #201f26;
51
+ $bbq: #2d2c36;
52
+ $char: #3a3943;
53
+ $iron: #4d4c57;
54
+ $oyster: #605f6b;
55
+ $squid: #858392;
56
+ $steam: #a2a0ad;
57
+ $smoke: #bfbcc8;
58
+ $steep: #d6d3dc;
59
+ $sash: #ecebf0;
60
+ $salt: #f7f6fb;
61
+ $soda: #fbfbfb;
62
+ $darple: #5b40ec;
63
+ $larple: #7b62ff;
64
+ $pickle: #00a475;
65
+ $gator: #18463d;
66
+ $spinach: #1c3634;
67
+ $pom: #ab2454;
68
+ $steak: #582238;
69
+ $toast: #412130;
70
+ $ice: #00fffc;