@salemcobalt/ui 0.2.0-rc.22 → 0.2.0-rc.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +180 -22
- package/dist/index.js.map +1 -1
- package/dist/styles.css +63 -21
- package/package.json +3 -3
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @salemcobalt/ui 0.2.0-rc.
|
|
1
|
+
/* @salemcobalt/ui 0.2.0-rc.24 — requires @salemcobalt/tokens/css. */
|
|
2
2
|
@layer sc {
|
|
3
3
|
/* ---- base.css ---- */
|
|
4
4
|
/* Shared: focus ring, reduced motion. Component files follow. */
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
.sc-avatar-button:focus-visible,
|
|
8
8
|
.sc-card[data-interactive]:focus-visible,
|
|
9
9
|
.sc-dialog__close:focus-visible,
|
|
10
|
+
.sc-dialog__handle:focus-visible,
|
|
10
11
|
.sc-menu__item:focus-visible,
|
|
11
12
|
.sc-input:focus-visible,
|
|
12
13
|
.sc-select:focus-visible,
|
|
@@ -267,10 +268,10 @@
|
|
|
267
268
|
background: var(--sc-color-accent-default);
|
|
268
269
|
color: var(--sc-color-text-on-accent);
|
|
269
270
|
}
|
|
270
|
-
.sc-button[data-variant='primary']:hover {
|
|
271
|
+
.sc-button[data-variant='primary']:hover:where(:not(:disabled)) {
|
|
271
272
|
background: var(--sc-color-accent-hover);
|
|
272
273
|
}
|
|
273
|
-
.sc-button[data-variant='primary']:active {
|
|
274
|
+
.sc-button[data-variant='primary']:active:where(:not(:disabled)) {
|
|
274
275
|
background: var(--sc-color-accent-active);
|
|
275
276
|
}
|
|
276
277
|
.sc-button[data-variant='secondary'] {
|
|
@@ -278,30 +279,30 @@
|
|
|
278
279
|
color: var(--sc-color-text-default);
|
|
279
280
|
border-color: var(--sc-color-border-strong);
|
|
280
281
|
}
|
|
281
|
-
.sc-button[data-variant='secondary']:hover {
|
|
282
|
+
.sc-button[data-variant='secondary']:hover:where(:not(:disabled)) {
|
|
282
283
|
background: var(--sc-color-surface-hover);
|
|
283
284
|
}
|
|
284
|
-
.sc-button[data-variant='secondary']:active {
|
|
285
|
+
.sc-button[data-variant='secondary']:active:where(:not(:disabled)) {
|
|
285
286
|
background: var(--sc-color-surface-active);
|
|
286
287
|
}
|
|
287
288
|
.sc-button[data-variant='ghost'] {
|
|
288
289
|
background: transparent;
|
|
289
290
|
color: var(--sc-color-text-default);
|
|
290
291
|
}
|
|
291
|
-
.sc-button[data-variant='ghost']:hover {
|
|
292
|
+
.sc-button[data-variant='ghost']:hover:where(:not(:disabled)) {
|
|
292
293
|
background: var(--sc-color-surface-hover);
|
|
293
294
|
}
|
|
294
|
-
.sc-button[data-variant='ghost']:active {
|
|
295
|
+
.sc-button[data-variant='ghost']:active:where(:not(:disabled)) {
|
|
295
296
|
background: var(--sc-color-surface-active);
|
|
296
297
|
}
|
|
297
298
|
.sc-button[data-variant='danger'] {
|
|
298
299
|
background: var(--sc-color-danger-solid);
|
|
299
300
|
color: var(--sc-color-text-on-status);
|
|
300
301
|
}
|
|
301
|
-
.sc-button[data-variant='danger']:hover {
|
|
302
|
+
.sc-button[data-variant='danger']:hover:where(:not(:disabled)) {
|
|
302
303
|
background: var(--sc-color-danger-hover);
|
|
303
304
|
}
|
|
304
|
-
.sc-button[data-variant='danger']:active {
|
|
305
|
+
.sc-button[data-variant='danger']:active:where(:not(:disabled)) {
|
|
305
306
|
background: var(--sc-color-danger-hover);
|
|
306
307
|
filter: brightness(0.95);
|
|
307
308
|
}
|
|
@@ -309,11 +310,6 @@
|
|
|
309
310
|
opacity: 0.5;
|
|
310
311
|
cursor: not-allowed;
|
|
311
312
|
}
|
|
312
|
-
.sc-button:disabled:hover,
|
|
313
|
-
.sc-button:disabled:active {
|
|
314
|
-
background: revert-layer;
|
|
315
|
-
filter: none;
|
|
316
|
-
}
|
|
317
313
|
.sc-button[data-loading] {
|
|
318
314
|
cursor: progress;
|
|
319
315
|
}
|
|
@@ -970,6 +966,10 @@
|
|
|
970
966
|
overflow: auto;
|
|
971
967
|
overscroll-behavior: contain;
|
|
972
968
|
}
|
|
969
|
+
/* The sheet's grab handle shows only where the sheet docks. */
|
|
970
|
+
.sc-dialog__handle {
|
|
971
|
+
display: none;
|
|
972
|
+
}
|
|
973
973
|
/* Below 640px the sheet docks to the bottom edge, full width, and slides up. The breakpoint is fixed
|
|
974
974
|
here because custom properties cannot drive a media query. */
|
|
975
975
|
@media (width < 640px) {
|
|
@@ -986,17 +986,48 @@
|
|
|
986
986
|
border-radius: var(--sc-radius-xl) var(--sc-radius-xl) 0 0;
|
|
987
987
|
transition:
|
|
988
988
|
opacity var(--sc-duration-base) var(--sc-ease-enter),
|
|
989
|
-
translate var(--sc-duration-base) var(--sc-ease-enter)
|
|
989
|
+
translate var(--sc-duration-base) var(--sc-ease-enter),
|
|
990
|
+
transform var(--sc-duration-slow) var(--sc-ease-standard);
|
|
990
991
|
}
|
|
991
|
-
.
|
|
992
|
-
|
|
992
|
+
/* The handle: a 36 × 4 bar centred in a 64 × 24 target, where the bar alone used to sit. */
|
|
993
|
+
.sc-dialog__popup[data-variant='sheet'] > .sc-dialog__handle {
|
|
994
|
+
display: grid;
|
|
995
|
+
place-items: center;
|
|
993
996
|
flex: none;
|
|
994
997
|
align-self: center;
|
|
998
|
+
inline-size: 64px;
|
|
999
|
+
block-size: 24px;
|
|
1000
|
+
margin-block: calc(-1 * var(--sc-spacing-sm) - 10px) calc(var(--sc-spacing-md) - 10px);
|
|
1001
|
+
padding: 0;
|
|
1002
|
+
border: 0;
|
|
1003
|
+
border-radius: var(--sc-radius-md);
|
|
1004
|
+
background: transparent;
|
|
1005
|
+
color: var(--sc-color-border-strong);
|
|
1006
|
+
}
|
|
1007
|
+
/* Inset, so the popup's clipped top edge does not cut the ring. */
|
|
1008
|
+
.sc-dialog__popup[data-variant='sheet'] > .sc-dialog__handle:focus-visible {
|
|
1009
|
+
outline-offset: calc(-1 * var(--sc-border-width-focus));
|
|
1010
|
+
}
|
|
1011
|
+
.sc-dialog__popup[data-variant='sheet'] > .sc-dialog__handle::before {
|
|
1012
|
+
content: '';
|
|
995
1013
|
inline-size: 36px;
|
|
996
1014
|
block-size: 4px;
|
|
997
|
-
margin-block: calc(-1 * var(--sc-spacing-sm)) var(--sc-spacing-md);
|
|
998
1015
|
border-radius: var(--sc-radius-full);
|
|
999
|
-
background:
|
|
1016
|
+
background: currentColor;
|
|
1017
|
+
}
|
|
1018
|
+
/* Swipe to dismiss (sheetSwipe.ts): the page never pans under the sheet, while `Dialog.Body` and any other
|
|
1019
|
+
scroll container inside keep scrolling, because touch-action resets at a scroll container. The drag
|
|
1020
|
+
moves the sheet with `transform`, which adds to the `translate` the exit transition animates. */
|
|
1021
|
+
.sc-dialog__popup[data-variant='sheet'][data-swipe-dismiss] {
|
|
1022
|
+
touch-action: none;
|
|
1023
|
+
}
|
|
1024
|
+
.sc-dialog__popup[data-variant='sheet'][data-swipe-dismiss] > .sc-dialog__handle {
|
|
1025
|
+
cursor: grab;
|
|
1026
|
+
}
|
|
1027
|
+
.sc-dialog__popup[data-variant='sheet'][data-swiping] {
|
|
1028
|
+
cursor: grabbing;
|
|
1029
|
+
user-select: none;
|
|
1030
|
+
transition: none;
|
|
1000
1031
|
}
|
|
1001
1032
|
.sc-dialog__popup[data-variant='sheet'][data-starting-style],
|
|
1002
1033
|
.sc-dialog__popup[data-variant='sheet'][data-ending-style] {
|
|
@@ -1099,6 +1130,17 @@
|
|
|
1099
1130
|
transition-duration: var(--sc-duration-fast);
|
|
1100
1131
|
}
|
|
1101
1132
|
}
|
|
1133
|
+
/* Reduced motion: a docked sheet appears and goes without sliding, and a released swipe closes or snaps
|
|
1134
|
+
back in place without the spring. */
|
|
1135
|
+
@media (width < 640px) and (prefers-reduced-motion: reduce) {
|
|
1136
|
+
.sc-dialog__popup[data-variant='sheet'] {
|
|
1137
|
+
transition-duration: 0ms;
|
|
1138
|
+
}
|
|
1139
|
+
.sc-dialog__popup[data-variant='sheet'][data-starting-style],
|
|
1140
|
+
.sc-dialog__popup[data-variant='sheet'][data-ending-style] {
|
|
1141
|
+
translate: none;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1102
1144
|
|
|
1103
1145
|
/* ---- tooltip.css ---- */
|
|
1104
1146
|
/* ---- Tooltip --------------------------------------------------------------- */
|
|
@@ -2582,8 +2624,8 @@
|
|
|
2582
2624
|
.sc-banner > .sc-button[data-variant='ghost'] {
|
|
2583
2625
|
color: inherit;
|
|
2584
2626
|
}
|
|
2585
|
-
.sc-banner > .sc-button[data-variant='ghost']:hover,
|
|
2586
|
-
.sc-banner > .sc-button[data-variant='ghost']:active {
|
|
2627
|
+
.sc-banner > .sc-button[data-variant='ghost']:hover:where(:not(:disabled)),
|
|
2628
|
+
.sc-banner > .sc-button[data-variant='ghost']:active:where(:not(:disabled)) {
|
|
2587
2629
|
background: rgb(from var(--_fg) r g b / 0.1);
|
|
2588
2630
|
}
|
|
2589
2631
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salemcobalt/ui",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.24",
|
|
4
4
|
"description": "React components for the Salem Cobalt design system: Button, IconButton, Icon set, BroomIcon, Badge, Card, Stack, Inline, Kbd, Dialog, FullScreenFlow, Tooltip, Menu, Popover, PriorityNav, Toolbar, Banner, Spinner, Progress, Tabs, Input, Textarea, Select, FileInput, Checkbox, Switch, Heading, Text, Table, Stat, Chip, Disclosure, EmptyState, Skeleton, Score, ReasonList, WordDiff, Quote; TextEditor (CodeMirror 6, inline word diffs) at @salemcobalt/ui/editor.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"diff": "^8.0.4",
|
|
47
47
|
"react": "^19.0.0",
|
|
48
48
|
"react-dom": "^19.0.0",
|
|
49
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
49
|
+
"@salemcobalt/tokens": "^0.2.0-rc.24"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@codemirror/commands": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"tsup": "^9.0.0",
|
|
110
110
|
"typescript": "^5.9.3",
|
|
111
111
|
"vitest": "^5.0.5",
|
|
112
|
-
"@salemcobalt/tokens": "^0.2.0-rc.
|
|
112
|
+
"@salemcobalt/tokens": "^0.2.0-rc.24"
|
|
113
113
|
},
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|