@vygruppen/spor-react 10.2.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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +18 -0
- package/dist/{CountryCodeSelect-UFSVRLDY.mjs → CountryCodeSelect-XMQTDWRD.mjs} +2 -1
- package/dist/{chunk-BPDFFQ3U.mjs → chunk-T4CLCBB5.mjs} +245 -111
- package/dist/index.d.mts +582 -107
- package/dist/index.d.ts +582 -107
- package/dist/index.js +260 -120
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/input/Combobox.tsx +4 -0
- package/src/input/CountryCodeSelect.tsx +2 -0
- package/src/input/InfoSelect.tsx +5 -3
- package/src/input/ListBox.tsx +4 -1
- package/src/input/NumericStepper.tsx +72 -19
- package/src/input/PhoneNumberInput.tsx +5 -0
- package/src/input/Switch.tsx +4 -2
- package/src/input/Textarea.tsx +1 -2
- package/src/theme/components/card-select.ts +1 -1
- package/src/theme/components/info-select.ts +1 -0
- package/src/theme/components/input.ts +4 -83
- package/src/theme/components/listbox.ts +16 -2
- package/src/theme/components/select.ts +18 -3
- package/src/theme/components/textarea.ts +13 -2
- package/src/theme/utils/focus-utils.ts +2 -2
- package/src/theme/utils/input-utils.ts +119 -0
- package/src/theme/utils/types.ts +2 -0
package/dist/index.js
CHANGED
@@ -1149,6 +1149,7 @@ function Combobox({
|
|
1149
1149
|
emptyContent,
|
1150
1150
|
inputRef: externalInputRef,
|
1151
1151
|
allowsEmptyCollection,
|
1152
|
+
variant,
|
1152
1153
|
...rest
|
1153
1154
|
}) {
|
1154
1155
|
const { contains: contains2 } = reactAria.useFilter({ sensitivity: "base" });
|
@@ -1202,6 +1203,7 @@ function Combobox({
|
|
1202
1203
|
ref: inputRef,
|
1203
1204
|
role: "combobox",
|
1204
1205
|
label,
|
1206
|
+
variant,
|
1205
1207
|
"aria-expanded": state2.isOpen,
|
1206
1208
|
"aria-autocomplete": "list",
|
1207
1209
|
"aria-controls": listboxId,
|
@@ -1243,7 +1245,8 @@ function Combobox({
|
|
1243
1245
|
id: listboxId,
|
1244
1246
|
listBoxRef,
|
1245
1247
|
emptyContent,
|
1246
|
-
maxWidth: inputWidth
|
1248
|
+
maxWidth: inputWidth,
|
1249
|
+
variant
|
1247
1250
|
},
|
1248
1251
|
rest.children
|
1249
1252
|
)
|
@@ -1368,10 +1371,11 @@ function ListBox({
|
|
1368
1371
|
listBoxRef,
|
1369
1372
|
state: state2,
|
1370
1373
|
maxWidth,
|
1374
|
+
variant,
|
1371
1375
|
...props
|
1372
1376
|
}) {
|
1373
1377
|
const { listBoxProps } = reactAria.useListBox(props, state2, listBoxRef);
|
1374
|
-
const styles3 = react.useMultiStyleConfig("ListBox", {});
|
1378
|
+
const styles3 = react.useMultiStyleConfig("ListBox", { variant });
|
1375
1379
|
return /* @__PURE__ */ React85__namespace.default.createElement(
|
1376
1380
|
react.List,
|
1377
1381
|
{
|
@@ -1379,7 +1383,8 @@ function ListBox({
|
|
1379
1383
|
ref: listBoxRef,
|
1380
1384
|
sx: styles3.container,
|
1381
1385
|
"aria-busy": isLoading,
|
1382
|
-
maxWidth
|
1386
|
+
maxWidth,
|
1387
|
+
variant
|
1383
1388
|
},
|
1384
1389
|
state2.collection.size === 0 && props.emptyContent,
|
1385
1390
|
Array.from(state2.collection).map(
|
@@ -1494,16 +1499,17 @@ function InfoSelect({
|
|
1494
1499
|
triggerRef
|
1495
1500
|
);
|
1496
1501
|
const stateStyle = "completed";
|
1502
|
+
const hasChosenValue = state2.selectedItem !== null;
|
1497
1503
|
const styles3 = react.useMultiStyleConfig("InfoSelect", {
|
1498
1504
|
isOpen: state2.isOpen,
|
1499
1505
|
isLabelSrOnly,
|
1500
1506
|
variant,
|
1501
|
-
stateStyle
|
1507
|
+
stateStyle,
|
1508
|
+
hasChosenValue
|
1502
1509
|
});
|
1503
1510
|
const { buttonProps } = reactAria.useButton(triggerProps, triggerRef);
|
1504
1511
|
const { t: t2 } = useTranslation();
|
1505
1512
|
const formControl = react.useFormControlProps(props);
|
1506
|
-
const hasChosenValue = state2.selectedItem !== null;
|
1507
1513
|
return /* @__PURE__ */ React85__namespace.default.createElement(react.Box, { sx: styles3.container }, /* @__PURE__ */ React85__namespace.default.createElement(
|
1508
1514
|
reactAria.HiddenSelect,
|
1509
1515
|
{
|
@@ -1543,7 +1549,7 @@ function InfoSelect({
|
|
1543
1549
|
...valueProps,
|
1544
1550
|
h: isLabelSrOnly ? "" : !hasChosenValue ? "0px" : "18px",
|
1545
1551
|
hidden: !hasChosenValue,
|
1546
|
-
transform: isLabelSrOnly ? "" : "scale(1) translateY(-
|
1552
|
+
transform: isLabelSrOnly ? "" : "scale(1) translateY(-12px)",
|
1547
1553
|
transitionProperty: "var(--spor-transition-property-common)",
|
1548
1554
|
transitionDuration: "var(--spor-transition-duration-normal)"
|
1549
1555
|
},
|
@@ -1563,7 +1569,8 @@ function InfoSelect({
|
|
1563
1569
|
...menuProps,
|
1564
1570
|
state: state2,
|
1565
1571
|
listBoxRef: listboxRef,
|
1566
|
-
borderBottomRadius: "sm"
|
1572
|
+
borderBottomRadius: "sm",
|
1573
|
+
variant
|
1567
1574
|
},
|
1568
1575
|
props.children
|
1569
1576
|
)
|
@@ -1654,8 +1661,10 @@ function NumericStepper({
|
|
1654
1661
|
withInput = true,
|
1655
1662
|
stepSize = 1,
|
1656
1663
|
showZero = false,
|
1664
|
+
ariaLabelContext = { singular: "", plural: "" },
|
1657
1665
|
...boxProps
|
1658
1666
|
}) {
|
1667
|
+
const addButtonRef = React85.useRef(null);
|
1659
1668
|
const { t: t2 } = useTranslation();
|
1660
1669
|
const styles3 = react.useMultiStyleConfig("NumericStepper", {});
|
1661
1670
|
const [value, onChange] = react.useControllableState({
|
@@ -1665,12 +1674,26 @@ function NumericStepper({
|
|
1665
1674
|
});
|
1666
1675
|
const formControlProps = react.useFormControl({ id: idProp, isDisabled });
|
1667
1676
|
const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
|
1677
|
+
const focusOnAddButton = () => {
|
1678
|
+
var _a6;
|
1679
|
+
(_a6 = addButtonRef.current) == null ? void 0 : _a6.focus();
|
1680
|
+
};
|
1668
1681
|
return /* @__PURE__ */ React85__namespace.default.createElement(react.Flex, { __css: styles3.container, ...boxProps }, /* @__PURE__ */ React85__namespace.default.createElement(
|
1669
1682
|
VerySmallButton,
|
1670
1683
|
{
|
1671
1684
|
icon: /* @__PURE__ */ React85__namespace.default.createElement(SubtractIcon, { stepLabel: clampedStepSize }),
|
1672
|
-
"aria-label": t2(
|
1673
|
-
|
1685
|
+
"aria-label": t2(
|
1686
|
+
texts2.decrementButtonAriaLabel(
|
1687
|
+
clampedStepSize,
|
1688
|
+
stepSize == 1 ? ariaLabelContext.singular : ariaLabelContext.plural
|
1689
|
+
)
|
1690
|
+
),
|
1691
|
+
onClick: () => {
|
1692
|
+
onChange(Math.max(value - clampedStepSize, minValue));
|
1693
|
+
if (Math.max(value - clampedStepSize, minValue) <= minValue) {
|
1694
|
+
focusOnAddButton();
|
1695
|
+
}
|
1696
|
+
},
|
1674
1697
|
visibility: value <= minValue ? "hidden" : "visible",
|
1675
1698
|
isDisabled: formControlProps.disabled,
|
1676
1699
|
id: value <= minValue ? void 0 : formControlProps.id
|
@@ -1689,13 +1712,16 @@ function NumericStepper({
|
|
1689
1712
|
width: `${Math.max(value.toString().length + 1, 3)}ch`,
|
1690
1713
|
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
1691
1714
|
"aria-live": "assertive",
|
1692
|
-
"aria-label":
|
1715
|
+
"aria-label": ariaLabelContext.plural !== "" ? t2(texts2.currentNumberAriaLabel(ariaLabelContext.plural)) : "",
|
1693
1716
|
onChange: (e) => {
|
1694
1717
|
const numericInput = Number(e.target.value);
|
1695
1718
|
if (Number.isNaN(numericInput)) {
|
1696
1719
|
return;
|
1697
1720
|
}
|
1698
1721
|
onChange(Math.max(Math.min(numericInput, maxValue), minValue));
|
1722
|
+
if (!showZero && Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
|
1723
|
+
focusOnAddButton();
|
1724
|
+
}
|
1699
1725
|
}
|
1700
1726
|
}
|
1701
1727
|
) : /* @__PURE__ */ React85__namespace.default.createElement(
|
@@ -1703,14 +1729,21 @@ function NumericStepper({
|
|
1703
1729
|
{
|
1704
1730
|
sx: styles3.text,
|
1705
1731
|
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
1706
|
-
"aria-
|
1732
|
+
"aria-live": "assertive",
|
1733
|
+
"aria-label": ariaLabelContext.plural !== "" ? t2(texts2.currentNumberAriaLabel(ariaLabelContext.plural)) : ""
|
1707
1734
|
},
|
1708
1735
|
value
|
1709
1736
|
), /* @__PURE__ */ React85__namespace.default.createElement(
|
1710
1737
|
VerySmallButton,
|
1711
1738
|
{
|
1739
|
+
ref: addButtonRef,
|
1712
1740
|
icon: /* @__PURE__ */ React85__namespace.default.createElement(AddIcon, { stepLabel: clampedStepSize }),
|
1713
|
-
"aria-label": t2(
|
1741
|
+
"aria-label": t2(
|
1742
|
+
texts2.incrementButtonAriaLabel(
|
1743
|
+
clampedStepSize,
|
1744
|
+
stepSize == 1 ? ariaLabelContext.singular : ariaLabelContext.plural
|
1745
|
+
)
|
1746
|
+
),
|
1714
1747
|
onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
|
1715
1748
|
visibility: value >= maxValue ? "hidden" : "visible",
|
1716
1749
|
isDisabled: formControlProps.disabled,
|
@@ -1722,10 +1755,19 @@ var VerySmallButton, SubtractIcon, AddIcon, texts2;
|
|
1722
1755
|
var init_NumericStepper = __esm({
|
1723
1756
|
"src/input/NumericStepper.tsx"() {
|
1724
1757
|
init_src();
|
1725
|
-
VerySmallButton = (props) => {
|
1758
|
+
VerySmallButton = React85__namespace.default.forwardRef((props, ref) => {
|
1726
1759
|
const styles3 = react.useMultiStyleConfig("NumericStepper", {});
|
1727
|
-
return /* @__PURE__ */ React85__namespace.default.createElement(
|
1728
|
-
|
1760
|
+
return /* @__PURE__ */ React85__namespace.default.createElement(
|
1761
|
+
exports.IconButton,
|
1762
|
+
{
|
1763
|
+
variant: "primary",
|
1764
|
+
size: "xs",
|
1765
|
+
sx: styles3.button,
|
1766
|
+
ref,
|
1767
|
+
...props
|
1768
|
+
}
|
1769
|
+
);
|
1770
|
+
});
|
1729
1771
|
SubtractIcon = ({ stepLabel, ...props }) => /* @__PURE__ */ React85__namespace.default.createElement(React85__namespace.default.Fragment, null, /* @__PURE__ */ React85__namespace.default.createElement(
|
1730
1772
|
react.Box,
|
1731
1773
|
{
|
@@ -1782,20 +1824,28 @@ var init_NumericStepper = __esm({
|
|
1782
1824
|
)
|
1783
1825
|
), stepLabel > 1 && /* @__PURE__ */ React85__namespace.default.createElement(react.chakra.span, { paddingRight: "1" }, stepLabel.toString()));
|
1784
1826
|
texts2 = createTexts({
|
1785
|
-
|
1827
|
+
currentNumberAriaLabel(ariaContext) {
|
1786
1828
|
return {
|
1787
|
-
nb: `
|
1788
|
-
en: `
|
1789
|
-
nn: `
|
1790
|
-
sv: `
|
1829
|
+
nb: `Valgt antall ${ariaContext}`,
|
1830
|
+
en: `Chosen number of ${ariaContext}`,
|
1831
|
+
nn: `Valgt antall ${ariaContext}`,
|
1832
|
+
sv: `Valgt antall ${ariaContext}`
|
1791
1833
|
};
|
1792
1834
|
},
|
1793
|
-
|
1835
|
+
decrementButtonAriaLabel(stepSize, ariaContext) {
|
1794
1836
|
return {
|
1795
|
-
nb: `
|
1796
|
-
en: `
|
1797
|
-
nn: `
|
1798
|
-
sv: `
|
1837
|
+
nb: `Trekk fra ${stepSize} ${ariaContext}`,
|
1838
|
+
en: `Subtract ${stepSize} ${ariaContext}`,
|
1839
|
+
nn: `Trekk fr\xE5 ${stepSize} ${ariaContext}`,
|
1840
|
+
sv: `Subtrahera ${stepSize} ${ariaContext}`
|
1841
|
+
};
|
1842
|
+
},
|
1843
|
+
incrementButtonAriaLabel(stepSize, ariaContext) {
|
1844
|
+
return {
|
1845
|
+
nb: `Legg til ${stepSize} ${ariaContext}`,
|
1846
|
+
en: `Add ${stepSize} ${ariaContext}`,
|
1847
|
+
nn: `Legg til ${stepSize} ${ariaContext}`,
|
1848
|
+
sv: `L\xE4gg till ${stepSize} ${ariaContext}`
|
1799
1849
|
};
|
1800
1850
|
}
|
1801
1851
|
});
|
@@ -1888,6 +1938,7 @@ var init_CountryCodeSelect = __esm({
|
|
1888
1938
|
label: t2(texts4.countryCode),
|
1889
1939
|
isLabelSrOnly: true,
|
1890
1940
|
items: callingCodes,
|
1941
|
+
variant: props.variant,
|
1891
1942
|
...props
|
1892
1943
|
},
|
1893
1944
|
(item) => /* @__PURE__ */ React85__namespace.default.createElement(reactStately.Item, { key: item.key }, item.key)
|
@@ -1915,6 +1966,7 @@ var init_PhoneNumberInput = __esm({
|
|
1915
1966
|
name,
|
1916
1967
|
value: externalValue,
|
1917
1968
|
onChange: externalOnChange,
|
1969
|
+
variant,
|
1918
1970
|
...boxProps
|
1919
1971
|
}, ref) => {
|
1920
1972
|
const { t: t2 } = useTranslation();
|
@@ -1937,7 +1989,8 @@ var init_PhoneNumberInput = __esm({
|
|
1937
1989
|
label: t2(texts5.countryCodeLabel),
|
1938
1990
|
width: "6.25rem",
|
1939
1991
|
height: "100%",
|
1940
|
-
value: "+47"
|
1992
|
+
value: "+47",
|
1993
|
+
variant
|
1941
1994
|
},
|
1942
1995
|
/* @__PURE__ */ React85__namespace.default.createElement(reactStately.Item, { key: "+47" }, "+47")
|
1943
1996
|
)
|
@@ -1952,7 +2005,8 @@ var init_PhoneNumberInput = __esm({
|
|
1952
2005
|
}),
|
1953
2006
|
name: name ? `${name}-country-code` : "country-code",
|
1954
2007
|
height: "100%",
|
1955
|
-
width: "6.25rem"
|
2008
|
+
width: "6.25rem",
|
2009
|
+
variant
|
1956
2010
|
}
|
1957
2011
|
)
|
1958
2012
|
), /* @__PURE__ */ React85__namespace.default.createElement(
|
@@ -1971,7 +2025,8 @@ var init_PhoneNumberInput = __esm({
|
|
1971
2025
|
});
|
1972
2026
|
},
|
1973
2027
|
position: "relative",
|
1974
|
-
left: "1px"
|
2028
|
+
left: "1px",
|
2029
|
+
variant
|
1975
2030
|
}
|
1976
2031
|
));
|
1977
2032
|
}
|
@@ -2074,8 +2129,8 @@ exports.Switch = void 0;
|
|
2074
2129
|
var init_Switch = __esm({
|
2075
2130
|
"src/input/Switch.tsx"() {
|
2076
2131
|
exports.Switch = react.forwardRef(
|
2077
|
-
({ size: size2 = "md", ...props }, ref) => {
|
2078
|
-
return /* @__PURE__ */ React85__namespace.default.createElement(react.Switch, { size: size2, ...props, ref });
|
2132
|
+
({ size: size2 = "md", as = "div", ...props }, ref) => {
|
2133
|
+
return /* @__PURE__ */ React85__namespace.default.createElement(react.Switch, { as, size: size2, ...props, ref });
|
2079
2134
|
}
|
2080
2135
|
);
|
2081
2136
|
}
|
@@ -13665,6 +13720,7 @@ var init_info_select = __esm({
|
|
13665
13720
|
label: {
|
13666
13721
|
position: "relative",
|
13667
13722
|
fontSize: ["mobile.xs", "desktop.sm"],
|
13723
|
+
marginTop: props.hasChosenValue ? 2 : 0,
|
13668
13724
|
...props.isLabelSrOnly ? srOnly2 : {}
|
13669
13725
|
},
|
13670
13726
|
innerButton: {
|
@@ -14043,102 +14099,146 @@ var init_info_tag = __esm({
|
|
14043
14099
|
info_tag_default = config20;
|
14044
14100
|
}
|
14045
14101
|
});
|
14046
|
-
|
14047
|
-
|
14048
|
-
|
14049
|
-
|
14102
|
+
|
14103
|
+
// src/theme/utils/input-utils.ts
|
14104
|
+
function inputVariant(state2, props) {
|
14105
|
+
switch (state2) {
|
14106
|
+
case "base":
|
14107
|
+
return {
|
14108
|
+
...baseBackground("default", props),
|
14109
|
+
...baseBorder("default", props),
|
14110
|
+
_hover: {
|
14111
|
+
...baseBorder("hover", props)
|
14112
|
+
},
|
14113
|
+
_active: {
|
14114
|
+
...baseBackground("active", props),
|
14115
|
+
...baseBorder("default", props)
|
14116
|
+
},
|
14117
|
+
_selected: {
|
14118
|
+
...baseBackground("selected", props),
|
14119
|
+
...baseBorder("selected", props)
|
14120
|
+
}
|
14121
|
+
};
|
14122
|
+
case "floating":
|
14123
|
+
return {
|
14124
|
+
boxShadow: "sm",
|
14125
|
+
...floatingBackground("default", props),
|
14126
|
+
...floatingBorder("default", props),
|
14127
|
+
_hover: {
|
14128
|
+
...floatingBorder("hover", props),
|
14129
|
+
...floatingBackground("hover", props)
|
14130
|
+
},
|
14131
|
+
_active: {
|
14132
|
+
...floatingBorder("active", props),
|
14133
|
+
...floatingBackground("active", props)
|
14134
|
+
},
|
14135
|
+
_selected: {
|
14136
|
+
...floatingBorder("selected", props),
|
14137
|
+
...floatingBackground("selected", props)
|
14138
|
+
}
|
14139
|
+
};
|
14140
|
+
case "default":
|
14141
|
+
default:
|
14142
|
+
return {
|
14143
|
+
...baseBackground("default", props),
|
14144
|
+
...baseBorder("default", props),
|
14145
|
+
_hover: {
|
14146
|
+
...baseBorder("hover", props)
|
14147
|
+
},
|
14148
|
+
_active: {
|
14149
|
+
...baseBackground("active", props),
|
14150
|
+
...baseBorder("default", props)
|
14151
|
+
},
|
14152
|
+
_selected: {
|
14153
|
+
...baseBackground("selected", props),
|
14154
|
+
...baseBorder("selected", props)
|
14155
|
+
}
|
14156
|
+
};
|
14157
|
+
}
|
14158
|
+
}
|
14159
|
+
var inputBaseStyle;
|
14160
|
+
var init_input_utils = __esm({
|
14161
|
+
"src/theme/utils/input-utils.ts"() {
|
14050
14162
|
init_base_utils();
|
14163
|
+
init_floating_utils();
|
14051
14164
|
init_focus_utils();
|
14052
14165
|
init_surface_utils();
|
14053
|
-
|
14054
|
-
|
14055
|
-
|
14056
|
-
|
14057
|
-
|
14058
|
-
|
14059
|
-
|
14060
|
-
|
14061
|
-
|
14062
|
-
|
14063
|
-
|
14064
|
-
|
14065
|
-
|
14066
|
-
|
14067
|
-
|
14068
|
-
|
14166
|
+
inputBaseStyle = (props) => ({
|
14167
|
+
field: {
|
14168
|
+
appearance: "none",
|
14169
|
+
width: "100%",
|
14170
|
+
outline: "none",
|
14171
|
+
border: 0,
|
14172
|
+
borderRadius: "sm",
|
14173
|
+
transitionProperty: "common",
|
14174
|
+
transitionDuration: "fast",
|
14175
|
+
position: "relative",
|
14176
|
+
paddingX: 3,
|
14177
|
+
height: 8,
|
14178
|
+
fontSize: "mobile.md",
|
14179
|
+
_focusVisible: {
|
14180
|
+
...focusVisibleStyles(props)._focusVisible,
|
14181
|
+
outlineOffset: 0
|
14182
|
+
},
|
14183
|
+
_disabled: {
|
14184
|
+
...surface("disabled", props),
|
14185
|
+
...baseBorder("disabled", props),
|
14186
|
+
pointerEvents: "none"
|
14187
|
+
},
|
14188
|
+
_invalid: {
|
14189
|
+
...baseBorder("invalid", props),
|
14069
14190
|
_hover: {
|
14070
14191
|
...baseBorder("hover", props)
|
14071
|
-
},
|
14072
|
-
_active: {
|
14073
|
-
...baseBackground("active", props),
|
14074
|
-
...baseBorder("default", props)
|
14075
|
-
},
|
14076
|
-
_focusVisible: {
|
14077
|
-
...focusVisibleStyles(props)._focusVisible,
|
14078
|
-
outlineOffset: 0
|
14079
|
-
},
|
14080
|
-
_disabled: {
|
14081
|
-
...surface("disabled", props),
|
14082
|
-
...baseBorder("disabled", props),
|
14083
|
-
pointerEvents: "none"
|
14084
|
-
},
|
14085
|
-
_invalid: {
|
14086
|
-
...baseBorder("invalid", props),
|
14087
|
-
_hover: {
|
14088
|
-
...baseBorder("hover", props)
|
14089
|
-
}
|
14090
|
-
},
|
14091
|
-
" + label": {
|
14092
|
-
fontSize: ["mobile.sm", "desktop.sm"],
|
14093
|
-
top: "2px",
|
14094
|
-
left: props.paddingLeft || props.pl || 3,
|
14095
|
-
zIndex: 2,
|
14096
|
-
position: "absolute",
|
14097
|
-
marginY: 2,
|
14098
|
-
transition: ".1s ease-out",
|
14099
|
-
transformOrigin: "top left",
|
14100
|
-
cursor: "text"
|
14101
|
-
},
|
14102
|
-
"&:not(:placeholder-shown)": {
|
14103
|
-
paddingTop: "1rem",
|
14104
|
-
"& + label": {
|
14105
|
-
transform: "scale(0.825) translateY(-10px)"
|
14106
|
-
}
|
14107
14192
|
}
|
14108
14193
|
},
|
14109
|
-
|
14110
|
-
|
14194
|
+
" + label": {
|
14195
|
+
fontSize: ["mobile.sm", "desktop.sm"],
|
14196
|
+
top: "2px",
|
14197
|
+
left: props.paddingLeft || props.pl || 3,
|
14198
|
+
zIndex: 2,
|
14199
|
+
position: "absolute",
|
14200
|
+
marginY: 2,
|
14201
|
+
transition: ".1s ease-out",
|
14202
|
+
transformOrigin: "top left",
|
14203
|
+
cursor: "text"
|
14111
14204
|
},
|
14112
|
-
|
14113
|
-
|
14114
|
-
|
14205
|
+
"&:not(:placeholder-shown)": {
|
14206
|
+
paddingTop: "1rem",
|
14207
|
+
"& + label": {
|
14208
|
+
transform: "scale(0.825) translateY(-10px)"
|
14115
14209
|
}
|
14116
14210
|
}
|
14211
|
+
},
|
14212
|
+
element: {
|
14213
|
+
height: "100%"
|
14214
|
+
},
|
14215
|
+
group: {
|
14216
|
+
":has(:disabled)": {
|
14217
|
+
...baseText("disabled", props)
|
14218
|
+
}
|
14219
|
+
}
|
14220
|
+
});
|
14221
|
+
}
|
14222
|
+
});
|
14223
|
+
var helpers14, config21, input_default;
|
14224
|
+
var init_input2 = __esm({
|
14225
|
+
"src/theme/components/input.ts"() {
|
14226
|
+
init_dist4();
|
14227
|
+
init_input_utils();
|
14228
|
+
helpers14 = react.createMultiStyleConfigHelpers(inputAnatomy.keys);
|
14229
|
+
config21 = helpers14.defineMultiStyleConfig({
|
14230
|
+
baseStyle: (props) => ({
|
14231
|
+
...inputBaseStyle(props)
|
14117
14232
|
}),
|
14118
14233
|
variants: {
|
14119
14234
|
base: (props) => ({
|
14120
14235
|
field: {
|
14121
|
-
...
|
14122
|
-
...baseBorder("default", props)
|
14236
|
+
...inputVariant("base", props)
|
14123
14237
|
}
|
14124
14238
|
}),
|
14125
14239
|
floating: (props) => ({
|
14126
14240
|
field: {
|
14127
|
-
|
14128
|
-
...floatingBackground("default", props),
|
14129
|
-
...floatingBorder("default", props),
|
14130
|
-
_hover: {
|
14131
|
-
...floatingBorder("hover", props),
|
14132
|
-
...floatingBackground("hover", props)
|
14133
|
-
},
|
14134
|
-
_active: {
|
14135
|
-
...floatingBorder("active", props),
|
14136
|
-
...floatingBackground("active", props)
|
14137
|
-
},
|
14138
|
-
_selected: {
|
14139
|
-
...floatingBorder("selected", props),
|
14140
|
-
...floatingBackground("selected", props)
|
14141
|
-
}
|
14241
|
+
...inputVariant("floating", props)
|
14142
14242
|
}
|
14143
14243
|
})
|
14144
14244
|
},
|
@@ -14408,6 +14508,7 @@ var init_listbox = __esm({
|
|
14408
14508
|
init_ghost_utils();
|
14409
14509
|
init_surface_utils();
|
14410
14510
|
init_outline_utils();
|
14511
|
+
init_floating_utils();
|
14411
14512
|
parts11 = anatomy("ListBox").parts(
|
14412
14513
|
"container",
|
14413
14514
|
"item",
|
@@ -14424,8 +14525,7 @@ var init_listbox = __esm({
|
|
14424
14525
|
maxHeight: "50vh",
|
14425
14526
|
width: "100%",
|
14426
14527
|
listStyle: "none",
|
14427
|
-
borderBottomRadius: "sm"
|
14428
|
-
...baseBorder("default", props)
|
14528
|
+
borderBottomRadius: "sm"
|
14429
14529
|
},
|
14430
14530
|
item: {
|
14431
14531
|
paddingX: 2,
|
@@ -14457,7 +14557,22 @@ var init_listbox = __esm({
|
|
14457
14557
|
...ghostText("selected", props)
|
14458
14558
|
}
|
14459
14559
|
}
|
14460
|
-
})
|
14560
|
+
}),
|
14561
|
+
variants: {
|
14562
|
+
base: (props) => ({
|
14563
|
+
container: {
|
14564
|
+
...baseBorder("default", props)
|
14565
|
+
}
|
14566
|
+
}),
|
14567
|
+
floating: (props) => ({
|
14568
|
+
container: {
|
14569
|
+
...floatingBorder("default", props)
|
14570
|
+
}
|
14571
|
+
})
|
14572
|
+
},
|
14573
|
+
defaultProps: {
|
14574
|
+
variant: "base"
|
14575
|
+
}
|
14461
14576
|
});
|
14462
14577
|
listbox_default = config24;
|
14463
14578
|
}
|
@@ -15143,7 +15258,7 @@ var init_select = __esm({
|
|
15143
15258
|
"src/theme/components/select.ts"() {
|
15144
15259
|
init_dist4();
|
15145
15260
|
init_base_utils();
|
15146
|
-
|
15261
|
+
init_input_utils();
|
15147
15262
|
parts18 = selectAnatomy.extend("root");
|
15148
15263
|
helpers26 = react.createMultiStyleConfigHelpers(parts18.keys);
|
15149
15264
|
config34 = helpers26.defineMultiStyleConfig({
|
@@ -15154,7 +15269,7 @@ var init_select = __esm({
|
|
15154
15269
|
position: "relative",
|
15155
15270
|
"& + label": {
|
15156
15271
|
fontSize: ["mobile.sm", "desktop.sm"],
|
15157
|
-
top: "
|
15272
|
+
top: "0.2rem",
|
15158
15273
|
left: 3,
|
15159
15274
|
zIndex: 2,
|
15160
15275
|
position: "absolute",
|
@@ -15167,10 +15282,9 @@ var init_select = __esm({
|
|
15167
15282
|
}
|
15168
15283
|
},
|
15169
15284
|
field: {
|
15170
|
-
...
|
15285
|
+
...inputBaseStyle(props).field,
|
15171
15286
|
appearance: "none",
|
15172
|
-
paddingTop: "1rem"
|
15173
|
-
"option, optgroup": {}
|
15287
|
+
paddingTop: "1rem"
|
15174
15288
|
},
|
15175
15289
|
icon: {
|
15176
15290
|
width: 5,
|
@@ -15184,7 +15298,22 @@ var init_select = __esm({
|
|
15184
15298
|
...baseText("disabled", props)
|
15185
15299
|
}
|
15186
15300
|
}
|
15187
|
-
})
|
15301
|
+
}),
|
15302
|
+
variants: {
|
15303
|
+
base: (props) => ({
|
15304
|
+
field: {
|
15305
|
+
...inputVariant("base", props)
|
15306
|
+
}
|
15307
|
+
}),
|
15308
|
+
floating: (props) => ({
|
15309
|
+
field: {
|
15310
|
+
...inputVariant("floating", props)
|
15311
|
+
}
|
15312
|
+
})
|
15313
|
+
},
|
15314
|
+
defaultProps: {
|
15315
|
+
variant: "base"
|
15316
|
+
}
|
15188
15317
|
});
|
15189
15318
|
select_default = config34;
|
15190
15319
|
}
|
@@ -15736,10 +15865,10 @@ var init_tabs = __esm({
|
|
15736
15865
|
var config40, textarea_default;
|
15737
15866
|
var init_textarea = __esm({
|
15738
15867
|
"src/theme/components/textarea.ts"() {
|
15739
|
-
|
15868
|
+
init_input_utils();
|
15740
15869
|
config40 = react.defineStyleConfig({
|
15741
15870
|
baseStyle: (props) => ({
|
15742
|
-
...
|
15871
|
+
...inputBaseStyle(props).field,
|
15743
15872
|
minHeight: "5rem",
|
15744
15873
|
verticalAlign: "top",
|
15745
15874
|
appearance: "none",
|
@@ -15752,7 +15881,18 @@ var init_textarea = __esm({
|
|
15752
15881
|
transform: "scale(0.825) translateY(-10px)"
|
15753
15882
|
}
|
15754
15883
|
}
|
15755
|
-
})
|
15884
|
+
}),
|
15885
|
+
variants: {
|
15886
|
+
base: (props) => ({
|
15887
|
+
...inputVariant("base", props)
|
15888
|
+
}),
|
15889
|
+
floating: (props) => ({
|
15890
|
+
...inputVariant("floating", props)
|
15891
|
+
})
|
15892
|
+
},
|
15893
|
+
defaultProps: {
|
15894
|
+
variant: "base"
|
15895
|
+
}
|
15756
15896
|
});
|
15757
15897
|
textarea_default = config40;
|
15758
15898
|
}
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, CardSelect, CargonetLogo, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, CardSelect, CargonetLogo, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardGroupContext, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, VyLogoPride, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-T4CLCBB5.mjs';
|