@salemcobalt/ui 0.2.0-rc.34 → 0.2.0-rc.36
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/dist/index.d.ts +9 -2
- package/dist/index.js +116 -43
- package/dist/index.js.map +1 -1
- package/dist/styles.css +35 -10
- 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.36 — requires @salemcobalt/tokens/css. */
|
|
2
2
|
@layer sc {
|
|
3
3
|
/* ---- base.css ---- */
|
|
4
4
|
/* Shared: focus ring, reduced motion. Component files follow. */
|
|
@@ -884,10 +884,14 @@
|
|
|
884
884
|
transition-timing-function: var(--sc-ease-exit);
|
|
885
885
|
}
|
|
886
886
|
/* The popup never exceeds the viewport minus a gutter each side, whatever `size` says. 100dvw rather than
|
|
887
|
-
100% so the clamp holds inside a transformed or narrow portal container too.
|
|
887
|
+
100% so the clamp holds inside a transformed or narrow portal container too. Under `viewport-fit=cover` each
|
|
888
|
+
gutter is at least the safe-area inset on that axis (the larger of the pair, as the popup is centred), so a
|
|
889
|
+
centred dialog on a landscape phone stays clear of the notch, the rounded corners and the home indicator. */
|
|
888
890
|
.sc-dialog__popup {
|
|
889
891
|
--_gutter: var(--sc-spacing-md);
|
|
890
|
-
--
|
|
892
|
+
--_side: max(var(--_gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
|
|
893
|
+
--_ends: max(var(--_gutter), env(safe-area-inset-top, 0px), env(safe-area-inset-bottom, 0px));
|
|
894
|
+
--_max: calc(100dvw - 2 * var(--_side));
|
|
891
895
|
position: fixed;
|
|
892
896
|
inset: 0;
|
|
893
897
|
margin: auto;
|
|
@@ -895,7 +899,7 @@
|
|
|
895
899
|
box-sizing: border-box;
|
|
896
900
|
inline-size: min(var(--_max), var(--sc-size-dialog-md));
|
|
897
901
|
max-inline-size: var(--_max);
|
|
898
|
-
max-block-size: min(100dvh - 2 * var(--
|
|
902
|
+
max-block-size: min(100dvh - 2 * var(--_ends), 85dvh);
|
|
899
903
|
block-size: fit-content;
|
|
900
904
|
overflow: hidden auto; /* vertical only: a 44px touch target on an edge button must not scroll it sideways */
|
|
901
905
|
padding: var(--sc-spacing-lg);
|
|
@@ -1153,6 +1157,14 @@
|
|
|
1153
1157
|
overflow: hidden auto; /* vertical only: a 44px touch target on an edge button must not scroll it sideways */
|
|
1154
1158
|
overscroll-behavior: contain;
|
|
1155
1159
|
}
|
|
1160
|
+
/* A `Dialog.Close` on the full-screen surface sits at the top inline-end corner of the screen, so it clears the
|
|
1161
|
+
status bar and a landscape notch the way the padding does. */
|
|
1162
|
+
.sc-dialog__popup[data-variant='fullscreen'] .sc-dialog__close {
|
|
1163
|
+
inset-block-start: calc(var(--sc-spacing-sm) + env(safe-area-inset-top, 0px));
|
|
1164
|
+
inset-inline-end: calc(
|
|
1165
|
+
var(--sc-spacing-sm) + max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))
|
|
1166
|
+
);
|
|
1167
|
+
}
|
|
1156
1168
|
/* Below 900px the full-screen surface runs past the bottom edge like the sheet (the overhang, a bottom border in
|
|
1157
1169
|
its own colour), so a collapsing browser toolbar uncovers more of it, not the page. */
|
|
1158
1170
|
@media (width < 900px) {
|
|
@@ -2676,6 +2688,14 @@
|
|
|
2676
2688
|
font-size: var(--sc-font-size-sm);
|
|
2677
2689
|
line-height: var(--sc-font-line-height-ui);
|
|
2678
2690
|
}
|
|
2691
|
+
/* A full-bleed notice across the top of the page (the Bolt docs' top bar, shorter): square, compact, a hairline under it. */
|
|
2692
|
+
.sc-banner[data-placement='page'] {
|
|
2693
|
+
min-block-size: var(--sc-size-control-sm);
|
|
2694
|
+
padding-block: var(--sc-spacing-3xs);
|
|
2695
|
+
padding-inline: var(--sc-spacing-sm) var(--sc-spacing-2xs);
|
|
2696
|
+
border-radius: 0;
|
|
2697
|
+
border-block-end: 1px solid rgb(from var(--_fg) r g b / 0.2);
|
|
2698
|
+
}
|
|
2679
2699
|
.sc-banner[data-tone='success'] {
|
|
2680
2700
|
--_bg: var(--sc-color-success-subtle);
|
|
2681
2701
|
--_fg: var(--sc-color-success-text);
|
|
@@ -3068,18 +3088,20 @@
|
|
|
3068
3088
|
/* ---- selection-bar.css ---- */
|
|
3069
3089
|
/* ---- SelectionBar ---------------------------------------------------------- */
|
|
3070
3090
|
/* Floats centred at the bottom of the viewport, sized to its content. A raised surface like Menu and Popover, so
|
|
3071
|
-
washes inside use the raised tokens (docs/adr/0003).
|
|
3091
|
+
washes inside use the raised tokens (docs/adr/0003). Its sides keep the gutter or the larger side safe-area inset,
|
|
3092
|
+
whichever is wider (a landscape phone's notch and rounded corners under `viewport-fit=cover`). */
|
|
3072
3093
|
.sc-selection-bar {
|
|
3073
3094
|
--_gutter: var(--sc-spacing-md);
|
|
3095
|
+
--_side: max(var(--_gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
|
|
3074
3096
|
--sc-color-surface-hover: var(--sc-color-surface-raised-hover);
|
|
3075
3097
|
--sc-color-surface-active: var(--sc-color-surface-raised-active);
|
|
3076
3098
|
position: fixed;
|
|
3077
|
-
inset-inline: var(--
|
|
3099
|
+
inset-inline: var(--_side);
|
|
3078
3100
|
inset-block-end: calc(var(--_gutter) + env(safe-area-inset-bottom, 0px));
|
|
3079
3101
|
z-index: var(--sc-z-sticky);
|
|
3080
3102
|
box-sizing: border-box;
|
|
3081
3103
|
inline-size: fit-content;
|
|
3082
|
-
max-inline-size: min(100vw - 2 * var(--
|
|
3104
|
+
max-inline-size: min(100vw - 2 * var(--_side), 48rem);
|
|
3083
3105
|
margin-inline: auto;
|
|
3084
3106
|
padding: var(--sc-spacing-2xs) var(--sc-spacing-xs) var(--sc-spacing-2xs) var(--sc-spacing-sm);
|
|
3085
3107
|
border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
|
|
@@ -3142,19 +3164,22 @@
|
|
|
3142
3164
|
/* Bottom-end, clear of a bar fixed along the bottom: an open SelectionBar, or any `position: fixed` bar of the app's
|
|
3143
3165
|
that sets `anchor-name: --sc-bottom-bar`. Without one, the gutter. Phones use the md gutter on both sides.
|
|
3144
3166
|
A sticky bar can't be an anchor (anchor() reads where it would be unstuck); while one shows, the app raises the
|
|
3145
|
-
toasts by setting `--sc-toast-offset-block-end` (on :root, for example) to the room it needs.
|
|
3167
|
+
toasts by setting `--sc-toast-offset-block-end` (on :root, for example) to the room it needs.
|
|
3168
|
+
Under `viewport-fit=cover` the side keeps clear of a landscape phone's notch or Dynamic Island and rounded corners:
|
|
3169
|
+
the gutter or the larger side inset, whichever is wider (the larger of the two, so inline-end is right either way). */
|
|
3146
3170
|
.sc-toast-viewport {
|
|
3147
3171
|
--_gutter: var(--sc-spacing-lg);
|
|
3172
|
+
--_side: max(var(--_gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
|
|
3148
3173
|
--_bottom: calc(var(--_gutter) + var(--sc-toast-offset-block-end, 0px) + env(safe-area-inset-bottom, 0px));
|
|
3149
3174
|
position: fixed;
|
|
3150
3175
|
inset-block-end: var(--_bottom);
|
|
3151
|
-
inset-inline-end: var(--
|
|
3176
|
+
inset-inline-end: var(--_side);
|
|
3152
3177
|
z-index: var(--sc-z-toast);
|
|
3153
3178
|
display: flex;
|
|
3154
3179
|
flex-direction: column;
|
|
3155
3180
|
align-items: flex-end;
|
|
3156
3181
|
gap: var(--sc-spacing-xs);
|
|
3157
|
-
inline-size: min(360px, 100vw - 2 * var(--
|
|
3182
|
+
inline-size: min(360px, 100vw - 2 * var(--_side));
|
|
3158
3183
|
outline: none;
|
|
3159
3184
|
}
|
|
3160
3185
|
@supports (anchor-name: --a) {
|
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.36",
|
|
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.36"
|
|
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.36"
|
|
113
113
|
},
|
|
114
114
|
"publishConfig": {
|
|
115
115
|
"access": "public"
|