@uni-design-system/uni-react 3.0.2 → 5.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/LICENSE +21 -0
- package/dist/cjs/index.cjs +39 -15
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +39 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/button/button.component.d.ts.map +1 -1
- package/dist/types/components/card/card.component.d.ts.map +1 -1
- package/dist/types/components/draggable/SortableList/components/SortableItem/sortableItem.component.d.ts +1 -1
- package/dist/types/components/draggable/SortableList/components/SortableItem/sortableItem.component.d.ts.map +1 -1
- package/dist/types/components/draggable/SortableList/components/SortableOverlay/sortableOverlay.component.d.ts +1 -4
- package/dist/types/components/draggable/SortableList/components/SortableOverlay/sortableOverlay.component.d.ts.map +1 -1
- package/dist/types/components/draggable/SortableList/sortableList.component.d.ts +1 -1
- package/dist/types/components/draggable/SortableList/sortableList.component.d.ts.map +1 -1
- package/dist/types/components/draggable/SortableList/sortableList.stories.d.ts +1 -1
- package/dist/types/core/layout/layout.provider.d.ts +2 -1
- package/dist/types/core/layout/layout.provider.d.ts.map +1 -1
- package/dist/types/core/transition/fade/fade.component.d.ts +1 -2
- package/dist/types/core/transition/fade/fade.component.d.ts.map +1 -1
- package/dist/types/core/transition/transition.utils.d.ts +3 -3
- package/dist/types/core/transition/transition.utils.d.ts.map +1 -1
- package/dist/types/tools/color-swatch/color-swatch.component.d.ts.map +1 -1
- package/package.json +10 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 George English
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -942,7 +942,7 @@ const Background = ({
|
|
|
942
942
|
minHeight,
|
|
943
943
|
color: color2
|
|
944
944
|
}) => {
|
|
945
|
-
if (
|
|
945
|
+
if (imageUrl) {
|
|
946
946
|
image = `url(${imageUrl})`;
|
|
947
947
|
}
|
|
948
948
|
const style = {
|
|
@@ -15137,6 +15137,30 @@ function createRippleContainer(className2) {
|
|
|
15137
15137
|
function isTouchDevice() {
|
|
15138
15138
|
return "ontouchstart" in window || navigator.maxTouchPoints > 0 || (navigator?.msMaxTouchPoints ?? 0) > 0;
|
|
15139
15139
|
}
|
|
15140
|
+
const verticalPadding = { xxs: 2, xs: 5, sm: 8, md: 12, lg: 16, xl: 20, xxl: 24 };
|
|
15141
|
+
const horizontalPadding = { xxs: 4, xs: 8, sm: 12, md: 18, lg: 24, xl: 30, xxl: 36 };
|
|
15142
|
+
const baseButton = {
|
|
15143
|
+
borderRadius: 100,
|
|
15144
|
+
color: "primary-container",
|
|
15145
|
+
contentColor: "on-primary-container",
|
|
15146
|
+
verticalPadding,
|
|
15147
|
+
horizontalPadding
|
|
15148
|
+
};
|
|
15149
|
+
const DEFAULT_BUTTONS = {
|
|
15150
|
+
elevated: { ...baseButton, color: "surface", contentColor: "on-surface", shadowElevation: "raised" },
|
|
15151
|
+
filled: { ...baseButton, color: "primary" },
|
|
15152
|
+
"filled-secondary": { ...baseButton, color: "secondary", contentColor: "on-secondary" },
|
|
15153
|
+
outlined: {
|
|
15154
|
+
...baseButton,
|
|
15155
|
+
color: "transparent",
|
|
15156
|
+
borderColor: "primary",
|
|
15157
|
+
contentColor: "on-primary",
|
|
15158
|
+
borderWidth: 1
|
|
15159
|
+
},
|
|
15160
|
+
text: { ...baseButton, color: "transparent", contentColor: "on-surface" },
|
|
15161
|
+
icon: { ...baseButton, color: "transparent", contentColor: "on-surface", horizontalPadding: verticalPadding },
|
|
15162
|
+
"floating-action": { ...baseButton, color: "secondary", contentColor: "on-secondary" }
|
|
15163
|
+
};
|
|
15140
15164
|
const Button = ({
|
|
15141
15165
|
text,
|
|
15142
15166
|
children,
|
|
@@ -15152,7 +15176,7 @@ const Button = ({
|
|
|
15152
15176
|
const { deviceSize } = useLayout();
|
|
15153
15177
|
const theme = useTheme();
|
|
15154
15178
|
const [ref, createRipple2] = useRipple({ disabled: disableRipple || buttonType === "elevated" });
|
|
15155
|
-
const buttonProps =
|
|
15179
|
+
const buttonProps = DEFAULT_BUTTONS[buttonType];
|
|
15156
15180
|
const getOnColorToken = (color2) => `on-${color2}`;
|
|
15157
15181
|
const contentColor = overrideContentColor || getOnColorToken(buttonProps.color);
|
|
15158
15182
|
const [hover2, setHover] = require$$0.useState(false);
|
|
@@ -15185,21 +15209,21 @@ const Button = ({
|
|
|
15185
15209
|
function Style(theme, buttonType, size = "md", hover2, disabled, click) {
|
|
15186
15210
|
const {
|
|
15187
15211
|
color: color2,
|
|
15188
|
-
horizontalPadding,
|
|
15189
|
-
verticalPadding,
|
|
15212
|
+
horizontalPadding: horizontalPadding2,
|
|
15213
|
+
verticalPadding: verticalPadding2,
|
|
15190
15214
|
borderColor,
|
|
15191
15215
|
borderWidth,
|
|
15192
15216
|
borderRadius,
|
|
15193
15217
|
contentColor
|
|
15194
|
-
} =
|
|
15218
|
+
} = DEFAULT_BUTTONS[buttonType];
|
|
15195
15219
|
const styles = {
|
|
15196
15220
|
overflow: "hidden",
|
|
15197
15221
|
transition: "all 0.3s cubic-bezier(.25,.8,.25,1)",
|
|
15198
15222
|
cursor: "pointer",
|
|
15199
|
-
paddingTop:
|
|
15200
|
-
paddingBottom:
|
|
15201
|
-
paddingLeft:
|
|
15202
|
-
paddingRight:
|
|
15223
|
+
paddingTop: verticalPadding2[size] + "px",
|
|
15224
|
+
paddingBottom: verticalPadding2[size] + "px",
|
|
15225
|
+
paddingLeft: horizontalPadding2[size] + "px",
|
|
15226
|
+
paddingRight: horizontalPadding2[size] + "px",
|
|
15203
15227
|
borderRadius: borderRadius + "px",
|
|
15204
15228
|
backgroundColor: theme.colors[color2],
|
|
15205
15229
|
borderColor: theme.colors[borderColor],
|
|
@@ -15232,8 +15256,8 @@ function Card({
|
|
|
15232
15256
|
style,
|
|
15233
15257
|
...rest
|
|
15234
15258
|
}) {
|
|
15235
|
-
const { colors
|
|
15236
|
-
const {
|
|
15259
|
+
const { colors } = useTheme();
|
|
15260
|
+
const borderRadii = { xxs: 4, xs: 8, sm: 12, md: 16, lg: 20, xl: 24, xxl: 28 };
|
|
15237
15261
|
const styles = {
|
|
15238
15262
|
height,
|
|
15239
15263
|
width,
|
|
@@ -19501,7 +19525,7 @@ const SortableItem = ({
|
|
|
19501
19525
|
children,
|
|
19502
19526
|
id: id2,
|
|
19503
19527
|
style: userStyle,
|
|
19504
|
-
onRemove
|
|
19528
|
+
onRemove: _onRemove
|
|
19505
19529
|
}) => {
|
|
19506
19530
|
const {
|
|
19507
19531
|
attributes,
|
|
@@ -19545,7 +19569,7 @@ const SortableList = ({
|
|
|
19545
19569
|
items,
|
|
19546
19570
|
onChange,
|
|
19547
19571
|
renderItem,
|
|
19548
|
-
style:
|
|
19572
|
+
style: _userStyle
|
|
19549
19573
|
}) => {
|
|
19550
19574
|
const [active, setActive] = require$$0.useState(null);
|
|
19551
19575
|
const activeItem = require$$0.useMemo(() => items.find((item) => item.id === active?.id), [active, items]);
|
|
@@ -19679,14 +19703,14 @@ const createLocalStorageManager = (key2) => ({
|
|
|
19679
19703
|
let value;
|
|
19680
19704
|
try {
|
|
19681
19705
|
value = localStorage.getItem(key2) || init;
|
|
19682
|
-
} catch
|
|
19706
|
+
} catch {
|
|
19683
19707
|
}
|
|
19684
19708
|
return JSON.parse(value) || init;
|
|
19685
19709
|
},
|
|
19686
19710
|
set(value) {
|
|
19687
19711
|
try {
|
|
19688
19712
|
localStorage.setItem(key2, JSON.stringify(value));
|
|
19689
|
-
} catch
|
|
19713
|
+
} catch {
|
|
19690
19714
|
}
|
|
19691
19715
|
}
|
|
19692
19716
|
});
|