@ornikar/kitt-universal 4.5.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/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +3 -4
- package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -1
- package/dist/definitions/Button/Button.d.ts +1 -1
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts +4 -4
- package/dist/definitions/forms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/DatePicker.android.d.ts +4 -0
- package/dist/definitions/forms/DatePicker/DatePicker.android.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts +2 -28
- package/dist/definitions/forms/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/definitions/forms/DatePicker/DatePicker.web.d.ts +4 -0
- package/dist/definitions/forms/DatePicker/DatePicker.web.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/DatePickerInputs.d.ts +9 -0
- package/dist/definitions/forms/DatePicker/DatePickerInputs.d.ts.map +1 -0
- package/dist/definitions/forms/DatePicker/types.d.ts +34 -0
- package/dist/definitions/forms/DatePicker/types.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +1 -1
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +639 -740
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +2 -2
- package/dist/index-browser-all.es.ios.js +155 -145
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +157 -147
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +538 -676
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +2 -2
- package/dist/index-node-14.17.cjs.js +106 -100
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +7 -7
- package/dist/index-node-14.17.cjs.web.js +463 -579
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +7 -7
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@media (hover:none) and (pointer:coarse){.
|
|
2
|
-
.
|
|
1
|
+
@media (hover:none) and (pointer:coarse){.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:hover,.kitt-hover .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-0));-ms-transform:scale(var(--p1nlccvg-0));transform:scale(var(--p1nlccvg-0));}}@media (min-width:768px){.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:hover,.kitt-hover .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-2));-ms-transform:scale(var(--p1nlccvg-2));transform:scale(var(--p1nlccvg-2));}}.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:active,.kitt-active .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-3));-ms-transform:scale(var(--p1nlccvg-3));transform:scale(var(--p1nlccvg-3));}.kitt-u_PressableIconButtonWebWrapper_p1nlccvg,.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > [data-focusvisible-polyfill]{outline:none;}.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:hover,.kitt-hover .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *,.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:focus,.kitt-focus .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *,.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > [data-focusvisible-polyfill],.kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *:active,.kitt-active .kitt-u_PressableIconButtonWebWrapper_p1nlccvg > *{background-color:var(--p1nlccvg-4);}
|
|
2
|
+
.kitt-u_TypographyLinkWebWrapper_tcwz3nt > *:hover,.kitt-u_TypographyLinkWebWrapper_tcwz3nt > *:active,.kitt-hover .kitt-u_TypographyLinkWebWrapper_tcwz3nt > *{-webkit-text-decoration:none;text-decoration:none;}.kitt-u_TypographyLinkWebWrapper_tcwz3nt > *:hover,.kitt-u_TypographyLinkWebWrapper_tcwz3nt > *:active,.kitt-hover .kitt-u_TypographyLinkWebWrapper_tcwz3nt > *{-webkit-text-decoration:var(--tcwz3nt-0);text-decoration:var(--tcwz3nt-0);}
|
|
@@ -1522,7 +1522,7 @@ function Checkbox({
|
|
|
1522
1522
|
onChange,
|
|
1523
1523
|
onBlur,
|
|
1524
1524
|
onFocus,
|
|
1525
|
-
|
|
1525
|
+
checked,
|
|
1526
1526
|
hitSlop = 40,
|
|
1527
1527
|
id,
|
|
1528
1528
|
children
|
|
@@ -1531,19 +1531,19 @@ function Checkbox({
|
|
|
1531
1531
|
return /*#__PURE__*/jsxRuntime.jsxs(CheckboxAndLabelPressableWrapper, {
|
|
1532
1532
|
accessibilityRole: "checkbox",
|
|
1533
1533
|
accessibilityState: {
|
|
1534
|
-
checked
|
|
1534
|
+
checked
|
|
1535
1535
|
},
|
|
1536
1536
|
hitSlop: hitSlop,
|
|
1537
1537
|
onPress: e => {
|
|
1538
1538
|
if (onFocus) onFocus(e);
|
|
1539
|
-
if (onChange) onChange(e);
|
|
1539
|
+
if (onChange) onChange(!checked, e);
|
|
1540
1540
|
if (onBlur) onBlur(e);
|
|
1541
1541
|
},
|
|
1542
1542
|
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxContainer, {
|
|
1543
|
-
$isChecked:
|
|
1543
|
+
$isChecked: checked,
|
|
1544
1544
|
$hasLabel: !!children,
|
|
1545
1545
|
testID: id,
|
|
1546
|
-
children:
|
|
1546
|
+
children: checked ? /*#__PURE__*/jsxRuntime.jsx(Icon, {
|
|
1547
1547
|
align: "center",
|
|
1548
1548
|
color: theme.kitt.forms.checkbox.markColor,
|
|
1549
1549
|
size: theme.kitt.forms.checkbox.iconSize,
|
|
@@ -1624,6 +1624,84 @@ function DatePickerInputPart({
|
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
1626
1626
|
|
|
1627
|
+
function prefixWithZero(value) {
|
|
1628
|
+
return `${value}`.padStart(2, '0');
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
const PartContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
1632
|
+
displayName: "DatePickerInputs__PartContainer",
|
|
1633
|
+
componentId: "kitt-universal__sc-j9hin5-0"
|
|
1634
|
+
})(["margin-right:", ";", ";"], ({
|
|
1635
|
+
theme,
|
|
1636
|
+
$isLast
|
|
1637
|
+
}) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
|
|
1638
|
+
$isStretch
|
|
1639
|
+
}) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
|
|
1640
|
+
const DatePickerPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
1641
|
+
displayName: "DatePickerInputs__DatePickerPressable",
|
|
1642
|
+
componentId: "kitt-universal__sc-j9hin5-1"
|
|
1643
|
+
})(["display:flex;flex-direction:row;", ";"], ({
|
|
1644
|
+
$isStretch
|
|
1645
|
+
}) => {
|
|
1646
|
+
if ($isStretch) {
|
|
1647
|
+
return styled.css(["width:100%;"]);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
return styled.css(["align-self:baseline;"]);
|
|
1651
|
+
});
|
|
1652
|
+
function DatePickerInputs({
|
|
1653
|
+
state,
|
|
1654
|
+
internalForceState,
|
|
1655
|
+
isFocused,
|
|
1656
|
+
disabled,
|
|
1657
|
+
stretch,
|
|
1658
|
+
id,
|
|
1659
|
+
testID,
|
|
1660
|
+
handleModalOpen,
|
|
1661
|
+
currentValue,
|
|
1662
|
+
placeholder
|
|
1663
|
+
}) {
|
|
1664
|
+
const currentState = internalForceState || getInputUIState({
|
|
1665
|
+
isFocused,
|
|
1666
|
+
isDisabled: Boolean(disabled),
|
|
1667
|
+
formState: state
|
|
1668
|
+
});
|
|
1669
|
+
const sharedPartProps = {
|
|
1670
|
+
disabled,
|
|
1671
|
+
$state: currentState
|
|
1672
|
+
};
|
|
1673
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DatePickerPressable, {
|
|
1674
|
+
$isStretch: stretch,
|
|
1675
|
+
nativeID: id,
|
|
1676
|
+
disabled: disabled,
|
|
1677
|
+
testID: testID,
|
|
1678
|
+
onPress: handleModalOpen,
|
|
1679
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
1680
|
+
$isStretch: stretch,
|
|
1681
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
1682
|
+
partName: "day",
|
|
1683
|
+
value: currentValue ? prefixWithZero(currentValue.getDate()) : undefined,
|
|
1684
|
+
placeholder: placeholder?.day
|
|
1685
|
+
})
|
|
1686
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
1687
|
+
$isStretch: stretch,
|
|
1688
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
1689
|
+
partName: "month",
|
|
1690
|
+
value: currentValue ? prefixWithZero(currentValue.getMonth() + 1) : undefined,
|
|
1691
|
+
placeholder: placeholder?.month
|
|
1692
|
+
})
|
|
1693
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PartContainer, {
|
|
1694
|
+
$isLast: true,
|
|
1695
|
+
$isStretch: stretch,
|
|
1696
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
1697
|
+
partName: "year",
|
|
1698
|
+
value: currentValue ? currentValue.getFullYear() : undefined,
|
|
1699
|
+
placeholder: placeholder?.year
|
|
1700
|
+
})
|
|
1701
|
+
})]
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1627
1705
|
// Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
|
|
1628
1706
|
const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
|
|
1629
1707
|
displayName: "Overlay__OverlayPressable",
|
|
@@ -1713,7 +1791,7 @@ function withTheme(WrappedComponent) {
|
|
|
1713
1791
|
|
|
1714
1792
|
const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
|
|
1715
1793
|
name: "PressableIconButtonWebWrapper",
|
|
1716
|
-
class: "
|
|
1794
|
+
class: "kitt-u_PressableIconButtonWebWrapper_p1nlccvg",
|
|
1717
1795
|
vars: {
|
|
1718
1796
|
"p1nlccvg-0": [({
|
|
1719
1797
|
theme,
|
|
@@ -2154,47 +2232,16 @@ function ModalPlatformDateTimePicker({
|
|
|
2154
2232
|
});
|
|
2155
2233
|
}
|
|
2156
2234
|
|
|
2157
|
-
function prefixWithZero(value) {
|
|
2158
|
-
return `${value}`.padStart(2, '0');
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
const PartContainer = /*#__PURE__*/styled__default.View.withConfig({
|
|
2162
|
-
displayName: "DatePicker__PartContainer",
|
|
2163
|
-
componentId: "kitt-universal__sc-ebllsn-0"
|
|
2164
|
-
})(["margin-right:", ";", ";"], ({
|
|
2165
|
-
theme,
|
|
2166
|
-
$isLast
|
|
2167
|
-
}) => !$isLast ? `${theme.kitt.spacing * 2}px` : 0, ({
|
|
2168
|
-
$isStretch
|
|
2169
|
-
}) => $isStretch ? styled.css(["flex:0.33;flex-grow:1;"]) : undefined);
|
|
2170
|
-
const DatePickerPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
2171
|
-
displayName: "DatePicker__DatePickerPressable",
|
|
2172
|
-
componentId: "kitt-universal__sc-ebllsn-1"
|
|
2173
|
-
})(["display:flex;flex-direction:row;", ";"], ({
|
|
2174
|
-
$isStretch
|
|
2175
|
-
}) => {
|
|
2176
|
-
if ($isStretch) {
|
|
2177
|
-
return styled.css(["width:100%;"]);
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
return styled.css(["align-self:baseline;"]);
|
|
2181
|
-
});
|
|
2182
2235
|
function DatePicker({
|
|
2183
2236
|
value,
|
|
2184
|
-
id,
|
|
2185
|
-
disabled,
|
|
2186
|
-
placeholder,
|
|
2187
|
-
state,
|
|
2188
|
-
internalForceState,
|
|
2189
|
-
testID,
|
|
2190
|
-
stretch,
|
|
2191
|
-
pickerDefaultDate,
|
|
2192
2237
|
pickerUITestID,
|
|
2193
2238
|
pickerUITitle,
|
|
2194
2239
|
pickerUIValidateButtonLabel,
|
|
2195
2240
|
onChange,
|
|
2196
2241
|
onFocus,
|
|
2197
|
-
onBlur
|
|
2242
|
+
onBlur,
|
|
2243
|
+
pickerDefaultDate,
|
|
2244
|
+
...props
|
|
2198
2245
|
}) {
|
|
2199
2246
|
const [isPickerUIVisible, setIsPickerUIVisible] = react.useState(false);
|
|
2200
2247
|
const [isFocused, setIsFocused] = react.useState(false);
|
|
@@ -2206,70 +2253,29 @@ function DatePicker({
|
|
|
2206
2253
|
setIsFocused(false);
|
|
2207
2254
|
};
|
|
2208
2255
|
|
|
2209
|
-
const handleChange = newDate => {
|
|
2210
|
-
setCurrentValue(newDate);
|
|
2211
|
-
onChange(newDate);
|
|
2212
|
-
handleModalClose();
|
|
2213
|
-
};
|
|
2214
|
-
|
|
2215
|
-
const currentState = internalForceState || getInputUIState({
|
|
2216
|
-
isFocused,
|
|
2217
|
-
isDisabled: Boolean(disabled),
|
|
2218
|
-
formState: state
|
|
2219
|
-
});
|
|
2220
|
-
const sharedPickerProps = {
|
|
2221
|
-
testID: pickerUITestID,
|
|
2222
|
-
value: currentValue,
|
|
2223
|
-
onChange: handleChange
|
|
2224
|
-
};
|
|
2225
|
-
const sharedPartProps = {
|
|
2226
|
-
disabled,
|
|
2227
|
-
$state: currentState,
|
|
2228
|
-
defaultDate: pickerDefaultDate
|
|
2229
|
-
};
|
|
2230
2256
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2231
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
2232
|
-
|
|
2233
|
-
nativeID: id,
|
|
2234
|
-
disabled: disabled,
|
|
2235
|
-
testID: testID,
|
|
2236
|
-
onPress: () => {
|
|
2257
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DatePickerInputs, {
|
|
2258
|
+
handleModalOpen: () => {
|
|
2237
2259
|
if (onFocus) onFocus();
|
|
2238
2260
|
setIsPickerUIVisible(true);
|
|
2239
2261
|
setIsFocused(true);
|
|
2240
2262
|
},
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
$isStretch: stretch,
|
|
2258
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DatePickerInputPart, { ...sharedPartProps,
|
|
2259
|
-
partName: "year",
|
|
2260
|
-
value: currentValue ? currentValue.getFullYear() : undefined,
|
|
2261
|
-
placeholder: placeholder?.year
|
|
2262
|
-
})
|
|
2263
|
-
})]
|
|
2264
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2265
|
-
children: [reactNative.Platform.OS === 'android' && isPickerUIVisible ? /*#__PURE__*/jsxRuntime.jsx(PlatformDateTimePicker, { ...sharedPickerProps
|
|
2266
|
-
}) : null, reactNative.Platform.OS !== 'android' ? /*#__PURE__*/jsxRuntime.jsx(ModalPlatformDateTimePicker, { ...sharedPickerProps,
|
|
2267
|
-
isVisible: isPickerUIVisible,
|
|
2268
|
-
title: pickerUITitle,
|
|
2269
|
-
validateButtonLabel: pickerUIValidateButtonLabel,
|
|
2270
|
-
onClose: handleModalClose,
|
|
2271
|
-
onChange: handleChange
|
|
2272
|
-
}) : null]
|
|
2263
|
+
currentValue: currentValue,
|
|
2264
|
+
isFocused: isFocused,
|
|
2265
|
+
...props
|
|
2266
|
+
}), /*#__PURE__*/jsxRuntime.jsx(ModalPlatformDateTimePicker, {
|
|
2267
|
+
testID: pickerUITestID,
|
|
2268
|
+
value: currentValue,
|
|
2269
|
+
isVisible: isPickerUIVisible,
|
|
2270
|
+
title: pickerUITitle,
|
|
2271
|
+
validateButtonLabel: pickerUIValidateButtonLabel,
|
|
2272
|
+
defaultDate: pickerDefaultDate,
|
|
2273
|
+
onClose: handleModalClose,
|
|
2274
|
+
onChange: newDate => {
|
|
2275
|
+
setCurrentValue(newDate);
|
|
2276
|
+
onChange(newDate);
|
|
2277
|
+
handleModalClose();
|
|
2278
|
+
}
|
|
2273
2279
|
})]
|
|
2274
2280
|
});
|
|
2275
2281
|
}
|
|
@@ -3990,7 +3996,7 @@ function TypographyEmoji({
|
|
|
3990
3996
|
|
|
3991
3997
|
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react$1.styled("span")({
|
|
3992
3998
|
name: "TypographyLinkWebWrapper",
|
|
3993
|
-
class: "
|
|
3999
|
+
class: "kitt-u_TypographyLinkWebWrapper_tcwz3nt",
|
|
3994
4000
|
vars: {
|
|
3995
4001
|
"tcwz3nt-0": [({
|
|
3996
4002
|
$hasNoUnderline
|