@uni-design-system/uni-core 10.3.0 → 10.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @uni-design-system/uni-core
2
2
 
3
+ ## 10.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cb5f08f`](https://github.com/uni-design-system/uni/commit/cb5f08f7bc7f73492688d33388c905941762ea0b) Thanks [@gaenglish](https://github.com/gaenglish)! - Give `uni-dialog` the drawer's three-row layout: a pinned `[uni-dialog-header]`, a scrolling body, and pinned `[uni-dialog-buttons]`.
8
+
9
+ The surface is now a flex column that is `overflow: clip` on both axes, so it is never the scroll container — previously a long form scrolled the dialog's own title and action buttons off the screen. Unlike the drawer, the dialog declares no height and stays sized by its content, growing until it reaches `calc(100dvh - 2 × inset)` and only then scrolling its body.
10
+
11
+ New theme options: `dialog.inset` (gap from the viewport edge before the body scrolls, default `lg`), `dialog.bodyPadding` (pads the scrolling row alone; `dialog.padding` still insets all three rows), and `divider` on `dialogHeader` / `dialogButtons` for a border between a pinned row and the body — all off or unchanged by default, so existing dialogs keep their appearance.
12
+
13
+ `[uni-dialog-header]` gains the shorter `[dialog-header]` alias, matching `[dialog-buttons]`; the long form keeps working. The `defaultCloseButton` now actually floats in the corner — its `position: absolute` was being lost to the icon button's own class, which left it inline at the top of the surface.
14
+
15
+ The drawer's overlay scrim now fades in and out with the panel instead of snapping. Its `::backdrop` had a background and no animation at all, so the dimming appeared and vanished instantly around a panel that took 250ms to slide. A new `drawer.motion` option (default `panel`) times the slide, the scrim's fade and the side panel's width transition together, replacing the hardcoded 250ms literals. The global reduced-motion rule now also reaches `::backdrop`, so both the drawer's and the dialog's scrim honour the preference (WCAG 2.3.3).
16
+
17
+ Dialog and drawer scrims now come from one token. `UniTheme` gains a `backdrops` scale — open and named like `shadows` and `motion` — and both components' `backdrop` option points at a name (`'scrim'`) instead of carrying its own CSS. They had drifted: the dialog washed the page white and blurred it while the drawer dimmed it dark, and a theme that dressed the dialog left the drawer on the library default. A raw style object is still accepted on either option, so a theme that states one keeps working.
18
+
19
+ The dialog's fade now reads the theme's `motion` token too (new `dialog.motion` option, default `panel`), replacing a hardcoded `350ms ease-in`. It shared the drawer's scrim but not its timing, so the same surface arrived at two speeds; both are now 250ms and a theme retimes them together.
20
+
3
21
  ## 10.3.0
4
22
 
5
23
  ### Minor Changes
@@ -1031,6 +1031,16 @@ var BaseMotion = {
1031
1031
  easing: "ease"
1032
1032
  }
1033
1033
  };
1034
+ /**
1035
+ * The one wash every modal surface lays over the page it covers. Dialog and
1036
+ * drawer both point at `scrim` by name, so a theme redresses them together —
1037
+ * before this they owned a `backdrop` blob each and had drifted apart, the
1038
+ * dialog washing the page white and blurred while the drawer dimmed it dark.
1039
+ */
1040
+ var BaseBackdrops = { scrim: {
1041
+ background: "rgba(255, 255, 255, 0.6)",
1042
+ backdropFilter: "blur(2px)"
1043
+ } };
1034
1044
  var BaseRadii = {
1035
1045
  none: "none",
1036
1046
  xxs: "4px",
@@ -1123,9 +1133,10 @@ var buildComponents = (c) => ({
1123
1133
  divider: "light",
1124
1134
  elevation: "menu",
1125
1135
  padding: "md",
1126
- backdrop: { background: "rgba(0, 0, 0, 0.4)" },
1136
+ backdrop: "scrim",
1127
1137
  scrim: true,
1128
- background: "solid"
1138
+ background: "solid",
1139
+ motion: "panel"
1129
1140
  } },
1130
1141
  drawerHeader: { options: {
1131
1142
  color: void 0,
@@ -1240,17 +1251,18 @@ var buildComponents = (c) => ({
1240
1251
  color: "primary-surface",
1241
1252
  border: "quaternary",
1242
1253
  padding: "sm",
1254
+ bodyPadding: void 0,
1255
+ inset: "lg",
1243
1256
  elevation: "dialog",
1244
- backdrop: {
1245
- background: "rgba(255, 255, 255, 0.6)",
1246
- backdropFilter: "blur(2px)"
1247
- }
1257
+ backdrop: "scrim",
1258
+ motion: "panel"
1248
1259
  } },
1249
1260
  dialogButtons: { options: {
1250
1261
  gap: "md",
1251
1262
  padding: "md",
1252
1263
  paddingBottom: "lg",
1253
1264
  justifyContent: "center",
1265
+ divider: void 0,
1254
1266
  confirmButtonVariant: "primary",
1255
1267
  cancelButtonVariant: "warn",
1256
1268
  buttonSize: "lg",
@@ -1263,6 +1275,7 @@ var buildComponents = (c) => ({
1263
1275
  height: 48,
1264
1276
  textRole: "title-large",
1265
1277
  textAlign: "center",
1278
+ divider: void 0,
1266
1279
  closeButtonIcon: "close",
1267
1280
  closeButtonSize: "md"
1268
1281
  } },
@@ -1933,7 +1946,7 @@ var deepMerge = (base, override) => {
1933
1946
  for (const [key, value] of Object.entries(override)) out[key] = isRecord$1(value) && isRecord$1(out[key]) ? deepMerge(out[key], value) : value;
1934
1947
  return out;
1935
1948
  };
1936
- var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, motion, typography, borders, thicknesses, spacing, components }) => ({
1949
+ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows = BaseShadows, motion, backdrops, typography, borders, thicknesses, spacing, components }) => ({
1937
1950
  id,
1938
1951
  name,
1939
1952
  colors,
@@ -1949,6 +1962,10 @@ var createTheme = ({ id, name, colors, icons = {}, radii = BaseRadii, shadows =
1949
1962
  ...BaseMotion,
1950
1963
  ...motion
1951
1964
  },
1965
+ backdrops: {
1966
+ ...BaseBackdrops,
1967
+ ...backdrops
1968
+ },
1952
1969
  thicknesses: {
1953
1970
  ...BaseThicknesses,
1954
1971
  ...thicknesses