@salemcobalt/ui 0.2.0-rc.34 → 0.2.0-rc.35

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/styles.css CHANGED
@@ -1,4 +1,4 @@
1
- /* @salemcobalt/ui 0.2.0-rc.34 — requires @salemcobalt/tokens/css. */
1
+ /* @salemcobalt/ui 0.2.0-rc.35 — 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
- --_max: calc(100dvw - 2 * var(--_gutter));
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(--_gutter), 85dvh);
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) {
@@ -3068,18 +3080,20 @@
3068
3080
  /* ---- selection-bar.css ---- */
3069
3081
  /* ---- SelectionBar ---------------------------------------------------------- */
3070
3082
  /* 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). */
3083
+ washes inside use the raised tokens (docs/adr/0003). Its sides keep the gutter or the larger side safe-area inset,
3084
+ whichever is wider (a landscape phone's notch and rounded corners under `viewport-fit=cover`). */
3072
3085
  .sc-selection-bar {
3073
3086
  --_gutter: var(--sc-spacing-md);
3087
+ --_side: max(var(--_gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
3074
3088
  --sc-color-surface-hover: var(--sc-color-surface-raised-hover);
3075
3089
  --sc-color-surface-active: var(--sc-color-surface-raised-active);
3076
3090
  position: fixed;
3077
- inset-inline: var(--_gutter);
3091
+ inset-inline: var(--_side);
3078
3092
  inset-block-end: calc(var(--_gutter) + env(safe-area-inset-bottom, 0px));
3079
3093
  z-index: var(--sc-z-sticky);
3080
3094
  box-sizing: border-box;
3081
3095
  inline-size: fit-content;
3082
- max-inline-size: min(100vw - 2 * var(--_gutter), 48rem);
3096
+ max-inline-size: min(100vw - 2 * var(--_side), 48rem);
3083
3097
  margin-inline: auto;
3084
3098
  padding: var(--sc-spacing-2xs) var(--sc-spacing-xs) var(--sc-spacing-2xs) var(--sc-spacing-sm);
3085
3099
  border: var(--sc-border-width-hairline) solid var(--sc-color-border-default);
@@ -3142,19 +3156,22 @@
3142
3156
  /* Bottom-end, clear of a bar fixed along the bottom: an open SelectionBar, or any `position: fixed` bar of the app's
3143
3157
  that sets `anchor-name: --sc-bottom-bar`. Without one, the gutter. Phones use the md gutter on both sides.
3144
3158
  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. */
3159
+ toasts by setting `--sc-toast-offset-block-end` (on :root, for example) to the room it needs.
3160
+ Under `viewport-fit=cover` the side keeps clear of a landscape phone's notch or Dynamic Island and rounded corners:
3161
+ the gutter or the larger side inset, whichever is wider (the larger of the two, so inline-end is right either way). */
3146
3162
  .sc-toast-viewport {
3147
3163
  --_gutter: var(--sc-spacing-lg);
3164
+ --_side: max(var(--_gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
3148
3165
  --_bottom: calc(var(--_gutter) + var(--sc-toast-offset-block-end, 0px) + env(safe-area-inset-bottom, 0px));
3149
3166
  position: fixed;
3150
3167
  inset-block-end: var(--_bottom);
3151
- inset-inline-end: var(--_gutter);
3168
+ inset-inline-end: var(--_side);
3152
3169
  z-index: var(--sc-z-toast);
3153
3170
  display: flex;
3154
3171
  flex-direction: column;
3155
3172
  align-items: flex-end;
3156
3173
  gap: var(--sc-spacing-xs);
3157
- inline-size: min(360px, 100vw - 2 * var(--_gutter));
3174
+ inline-size: min(360px, 100vw - 2 * var(--_side));
3158
3175
  outline: none;
3159
3176
  }
3160
3177
  @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.34",
3
+ "version": "0.2.0-rc.35",
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.34"
49
+ "@salemcobalt/tokens": "^0.2.0-rc.35"
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.34"
112
+ "@salemcobalt/tokens": "^0.2.0-rc.35"
113
113
  },
114
114
  "publishConfig": {
115
115
  "access": "public"