@uni-design-system/uni-react 9.0.0 → 10.0.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 +32 -0
- package/dist/cjs/index.cjs +8 -3
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +9 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/icon-text-row/icon-text-row.component.d.ts.map +1 -1
- package/dist/types/components/switch/switch.component.d.ts.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @uni-design-system/uni-react
|
|
2
2
|
|
|
3
|
+
## 10.0.0
|
|
4
|
+
|
|
5
|
+
## 9.0.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- [`f926cd5`](https://github.com/uni-design-system/uni/commit/f926cd513a5cac593adef559e21bada4dada76ee) Thanks [@gaenglish](https://github.com/gaenglish)! - `uni-react`'s Switch reads the `success` color token instead of hand-rolling an
|
|
10
|
+
HSL string from a color-generation internal, and both packages now typecheck as
|
|
11
|
+
part of their build.
|
|
12
|
+
|
|
13
|
+
The Switch built its "on" color as `hsl(${RoleHues.success.default}, 32%, 50%)`
|
|
14
|
+
— a fixed green assembled from the HSL generation tables rather than the theme,
|
|
15
|
+
so it never recolored with the theme and broke when those tables were removed.
|
|
16
|
+
It now reads `useTheme().colors.success`.
|
|
17
|
+
|
|
18
|
+
The reason that reached a deploy is the build. `vite build` transpiles with
|
|
19
|
+
esbuild, which strips types without checking them, and it treats
|
|
20
|
+
`@uni-design-system/uni-core` as an external — so neither the type layer nor the
|
|
21
|
+
module graph ever verified that an imported core export exists. `pnpm turbo run
|
|
22
|
+
build` passed on a package whose source did not compile.
|
|
23
|
+
- `core` and `react` now run `tsc --noEmit` as the first half of `build`, so a
|
|
24
|
+
removed or renamed core export fails the consumer's build.
|
|
25
|
+
- A `type-check` turbo task exists for running that pass alone.
|
|
26
|
+
- CI builds **both** Storybooks, not just Angular's. These bundle uni-core
|
|
27
|
+
instead of externalizing it, so they are the step that resolves its exports
|
|
28
|
+
against real consumer source.
|
|
29
|
+
|
|
30
|
+
This also cleared four pre-existing type errors in `IconTextRow`, which did
|
|
31
|
+
arithmetic on `fontSize` / `lineHeight` — typed `CssLength` (`number | string`)
|
|
32
|
+
— and passed the result to props typed `number`. They are coerced through one
|
|
33
|
+
documented helper now.
|
|
34
|
+
|
|
3
35
|
## 9.0.0
|
|
4
36
|
|
|
5
37
|
### Major Changes
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -15068,6 +15068,11 @@ const Slide = require$$0.forwardRef(function Slide2(props, ref) {
|
|
|
15068
15068
|
) });
|
|
15069
15069
|
});
|
|
15070
15070
|
Slide.displayName = "Slide";
|
|
15071
|
+
const toPx = (value, fallback) => {
|
|
15072
|
+
if (typeof value === "number") return value;
|
|
15073
|
+
const parsed = typeof value === "string" ? parseFloat(value) : NaN;
|
|
15074
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
15075
|
+
};
|
|
15071
15076
|
const IconTextRow = ({
|
|
15072
15077
|
iconName,
|
|
15073
15078
|
color: color2,
|
|
@@ -15078,8 +15083,8 @@ const IconTextRow = ({
|
|
|
15078
15083
|
}) => {
|
|
15079
15084
|
const theme = useTheme();
|
|
15080
15085
|
const textProps = uniCore.getValue(theme, `typography.${textRole}`, theme.typography["title-medium"]);
|
|
15081
|
-
const textHeight = textProps.fontSize;
|
|
15082
|
-
const textLineHeight = textProps.lineHeight
|
|
15086
|
+
const textHeight = toPx(textProps.fontSize, 16);
|
|
15087
|
+
const textLineHeight = toPx(textProps.lineHeight, textHeight);
|
|
15083
15088
|
const textMargin = text || children ? textLineHeight - textHeight : 0;
|
|
15084
15089
|
function RowIcon() {
|
|
15085
15090
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...fix, maxHeight: textLineHeight }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: iconName, width: textLineHeight, height: textLineHeight, color: color2 }) });
|
|
@@ -19971,7 +19976,7 @@ const SwitchConfigs = {
|
|
|
19971
19976
|
};
|
|
19972
19977
|
const Switch = ({ size = "sm", on = false, onChange }) => {
|
|
19973
19978
|
const [isOn, setIsOn] = require$$0.useState(on);
|
|
19974
|
-
const successColor =
|
|
19979
|
+
const successColor = useTheme().colors.success;
|
|
19975
19980
|
const toggleSwitch = () => {
|
|
19976
19981
|
setIsOn(!isOn);
|
|
19977
19982
|
onChange && onChange(!isOn);
|