@salemcobalt/ui 0.2.0-rc.23 → 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 +53 -6
- 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,
|
|
@@ -965,6 +966,10 @@
|
|
|
965
966
|
overflow: auto;
|
|
966
967
|
overscroll-behavior: contain;
|
|
967
968
|
}
|
|
969
|
+
/* The sheet's grab handle shows only where the sheet docks. */
|
|
970
|
+
.sc-dialog__handle {
|
|
971
|
+
display: none;
|
|
972
|
+
}
|
|
968
973
|
/* Below 640px the sheet docks to the bottom edge, full width, and slides up. The breakpoint is fixed
|
|
969
974
|
here because custom properties cannot drive a media query. */
|
|
970
975
|
@media (width < 640px) {
|
|
@@ -981,17 +986,48 @@
|
|
|
981
986
|
border-radius: var(--sc-radius-xl) var(--sc-radius-xl) 0 0;
|
|
982
987
|
transition:
|
|
983
988
|
opacity var(--sc-duration-base) var(--sc-ease-enter),
|
|
984
|
-
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);
|
|
985
991
|
}
|
|
986
|
-
.
|
|
987
|
-
|
|
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;
|
|
988
996
|
flex: none;
|
|
989
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: '';
|
|
990
1013
|
inline-size: 36px;
|
|
991
1014
|
block-size: 4px;
|
|
992
|
-
margin-block: calc(-1 * var(--sc-spacing-sm)) var(--sc-spacing-md);
|
|
993
1015
|
border-radius: var(--sc-radius-full);
|
|
994
|
-
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;
|
|
995
1031
|
}
|
|
996
1032
|
.sc-dialog__popup[data-variant='sheet'][data-starting-style],
|
|
997
1033
|
.sc-dialog__popup[data-variant='sheet'][data-ending-style] {
|
|
@@ -1094,6 +1130,17 @@
|
|
|
1094
1130
|
transition-duration: var(--sc-duration-fast);
|
|
1095
1131
|
}
|
|
1096
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
|
+
}
|
|
1097
1144
|
|
|
1098
1145
|
/* ---- tooltip.css ---- */
|
|
1099
1146
|
/* ---- Tooltip --------------------------------------------------------------- */
|
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"
|