@ornikar/kitt-universal 23.2.7 → 23.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 +18 -0
- package/dist/definitions/BottomSheet/useStaticBottomSheet.d.ts +3 -3
- package/dist/definitions/BottomSheet/useStaticBottomSheet.d.ts.map +1 -1
- package/dist/definitions/Tag/Tag.d.ts +10 -6
- package/dist/definitions/Tag/Tag.d.ts.map +1 -1
- package/dist/definitions/forms/DocumentPicker/DocumentPicker.d.ts +15 -0
- package/dist/definitions/forms/DocumentPicker/DocumentPicker.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActions.d.ts +13 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActions.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActionsItem.d.ts +7 -0
- package/dist/definitions/forms/FilePicker/BottomSheetActions/BottomSheetActionsItem.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/FilePicker.d.ts +17 -0
- package/dist/definitions/forms/FilePicker/FilePicker.d.ts.map +1 -0
- package/dist/definitions/forms/FilePicker/FilePicker.web.d.ts +4 -0
- package/dist/definitions/forms/FilePicker/FilePicker.web.d.ts.map +1 -0
- package/dist/definitions/forms/ImagePicker/ImagePicker.d.ts +15 -0
- package/dist/definitions/forms/ImagePicker/ImagePicker.d.ts.map +1 -0
- package/dist/definitions/index.d.ts +7 -2
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +43 -78
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/tag.d.ts +22 -14
- package/dist/definitions/themes/late-ocean/tag.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +463 -319
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +463 -319
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-20.10.cjs.js +383 -238
- package/dist/index-node-20.10.cjs.js.map +1 -1
- package/dist/index-node-20.10.cjs.web.js +214 -155
- package/dist/index-node-20.10.cjs.web.js.map +1 -1
- package/dist/index-node-20.10.es.mjs +383 -241
- package/dist/index-node-20.10.es.mjs.map +1 -1
- package/dist/index-node-20.10.es.web.mjs +212 -156
- package/dist/index-node-20.10.es.web.mjs.map +1 -1
- package/dist/index.es.js +496 -314
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +257 -157
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-metro.es.android.js +38 -44
- package/dist/linaria-themes-metro.es.android.js.map +1 -1
- package/dist/linaria-themes-metro.es.ios.js +38 -44
- package/dist/linaria-themes-metro.es.ios.js.map +1 -1
- package/dist/linaria-themes-node-20.10.cjs.js +38 -44
- package/dist/linaria-themes-node-20.10.cjs.js.map +1 -1
- package/dist/linaria-themes-node-20.10.cjs.web.js +38 -44
- package/dist/linaria-themes-node-20.10.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-20.10.es.mjs +38 -44
- package/dist/linaria-themes-node-20.10.es.mjs.map +1 -1
- package/dist/linaria-themes-node-20.10.es.web.mjs +38 -44
- package/dist/linaria-themes-node-20.10.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.js +38 -44
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +38 -44
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +5 -2
- package/translations/fr-FR.json +2 -0
package/dist/index.es.web.js
CHANGED
|
@@ -19,6 +19,8 @@ export { useWindowDimensions as useWindowSize } from 'react-native';
|
|
|
19
19
|
import { parse } from 'twemoji-parser';
|
|
20
20
|
import { CaretUpFillIcon, CaretDownFillIcon, EyeClosedRegularIcon, EyeRegularIcon, CaretDownRegularIcon, XRegularIcon } from '@ornikar/kitt-icons/phosphor';
|
|
21
21
|
import Downshift, { useSelect } from 'downshift';
|
|
22
|
+
import { getDocumentAsync } from 'expo-document-picker';
|
|
23
|
+
import { launchImageLibraryAsync } from 'expo-image-picker';
|
|
22
24
|
import { useDebouncedCallback } from 'use-debounce';
|
|
23
25
|
import { Loader } from '@googlemaps/js-api-loader';
|
|
24
26
|
import { parseNumber, getCountryCallingCode, isValidNumber } from 'libphonenumber-js';
|
|
@@ -1655,57 +1657,51 @@ var skeleton$1 = {
|
|
|
1655
1657
|
};
|
|
1656
1658
|
|
|
1657
1659
|
var tag = {
|
|
1658
|
-
borderRadius:
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
fill: {
|
|
1664
|
-
backgroundColor: lateOceanColorPalette.moonPurpleLight1,
|
|
1665
|
-
borderWidth: 0,
|
|
1666
|
-
borderColor: colors.transparent
|
|
1667
|
-
},
|
|
1668
|
-
outline: {
|
|
1669
|
-
backgroundColor: colors.transparent,
|
|
1670
|
-
borderWidth: 1,
|
|
1671
|
-
borderColor: colors.primary
|
|
1672
|
-
}
|
|
1660
|
+
borderRadius: 16,
|
|
1661
|
+
icon: {
|
|
1662
|
+
small: 16,
|
|
1663
|
+
medium: 16,
|
|
1664
|
+
large: 20
|
|
1673
1665
|
},
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1666
|
+
withIcon: {
|
|
1667
|
+
small: {
|
|
1668
|
+
paddingLeft: 2,
|
|
1669
|
+
paddingRight: 8,
|
|
1670
|
+
height: 20
|
|
1679
1671
|
},
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
}
|
|
1685
|
-
},
|
|
1686
|
-
danger: {
|
|
1687
|
-
fill: {
|
|
1688
|
-
backgroundColor: colors.danger,
|
|
1689
|
-
borderWidth: 0,
|
|
1690
|
-
borderColor: colors.transparent
|
|
1672
|
+
medium: {
|
|
1673
|
+
paddingLeft: 4,
|
|
1674
|
+
paddingRight: 8,
|
|
1675
|
+
height: 24
|
|
1691
1676
|
},
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1677
|
+
large: {
|
|
1678
|
+
paddingLeft: 6,
|
|
1679
|
+
paddingRight: 8,
|
|
1680
|
+
height: 32
|
|
1696
1681
|
}
|
|
1697
1682
|
},
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1683
|
+
withoutIcon: {
|
|
1684
|
+
small: {
|
|
1685
|
+
paddingLeft: 8,
|
|
1686
|
+
paddingRight: 8,
|
|
1687
|
+
height: 20
|
|
1703
1688
|
},
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1689
|
+
medium: {
|
|
1690
|
+
paddingLeft: 8,
|
|
1691
|
+
paddingRight: 8,
|
|
1692
|
+
height: 22
|
|
1693
|
+
},
|
|
1694
|
+
large: {
|
|
1695
|
+
paddingLeft: 8,
|
|
1696
|
+
paddingRight: 8,
|
|
1697
|
+
height: 28
|
|
1708
1698
|
}
|
|
1699
|
+
},
|
|
1700
|
+
fill: {
|
|
1701
|
+
borderWidth: 0
|
|
1702
|
+
},
|
|
1703
|
+
outline: {
|
|
1704
|
+
borderWidth: 1
|
|
1709
1705
|
}
|
|
1710
1706
|
};
|
|
1711
1707
|
|
|
@@ -4814,6 +4810,107 @@ var DatePicker = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
4814
4810
|
}));
|
|
4815
4811
|
});
|
|
4816
4812
|
|
|
4813
|
+
function DocumentPicker(_ref) {
|
|
4814
|
+
var onDocumentUpload = _ref.onDocumentUpload,
|
|
4815
|
+
children = _ref.children,
|
|
4816
|
+
disabled = _ref.disabled,
|
|
4817
|
+
documentPickerOptions = _ref.documentPickerOptions;
|
|
4818
|
+
var childElement = Children.only(children);
|
|
4819
|
+
var handlePickDocument = /*#__PURE__*/function () {
|
|
4820
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4821
|
+
var _childElement$props$o, _childElement$props;
|
|
4822
|
+
var result;
|
|
4823
|
+
return _regeneratorRuntime().wrap(function (_context) {
|
|
4824
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4825
|
+
case 0:
|
|
4826
|
+
if (!disabled) {
|
|
4827
|
+
_context.next = 2;
|
|
4828
|
+
break;
|
|
4829
|
+
}
|
|
4830
|
+
return _context.abrupt("return");
|
|
4831
|
+
case 2:
|
|
4832
|
+
(_childElement$props$o = (_childElement$props = childElement.props).onPress) === null || _childElement$props$o === void 0 || _childElement$props$o.call(_childElement$props);
|
|
4833
|
+
_context.next = 5;
|
|
4834
|
+
return getDocumentAsync(_objectSpread(_objectSpread({}, documentPickerOptions), {}, {
|
|
4835
|
+
multiple: false
|
|
4836
|
+
}));
|
|
4837
|
+
case 5:
|
|
4838
|
+
result = _context.sent;
|
|
4839
|
+
if (!result.canceled && result.assets[0].file) {
|
|
4840
|
+
onDocumentUpload(result.assets[0].file);
|
|
4841
|
+
}
|
|
4842
|
+
case 7:
|
|
4843
|
+
case "end":
|
|
4844
|
+
return _context.stop();
|
|
4845
|
+
}
|
|
4846
|
+
}, _callee);
|
|
4847
|
+
}));
|
|
4848
|
+
return function () {
|
|
4849
|
+
return _ref2.apply(this, arguments);
|
|
4850
|
+
};
|
|
4851
|
+
}();
|
|
4852
|
+
return /*#__PURE__*/cloneElement(childElement, {
|
|
4853
|
+
// ensure that the press event is not prevented by Button component
|
|
4854
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
4855
|
+
onPress: handlePickDocument,
|
|
4856
|
+
disabled: disabled
|
|
4857
|
+
});
|
|
4858
|
+
}
|
|
4859
|
+
|
|
4860
|
+
function FilePicker() {
|
|
4861
|
+
throw new Error('FilePicker only works on native');
|
|
4862
|
+
}
|
|
4863
|
+
|
|
4864
|
+
function ImagePicker(_ref) {
|
|
4865
|
+
var onImageSelected = _ref.onImageSelected,
|
|
4866
|
+
children = _ref.children,
|
|
4867
|
+
disabled = _ref.disabled,
|
|
4868
|
+
imagePickerOptions = _ref.imagePickerOptions;
|
|
4869
|
+
var childElement = Children.only(children);
|
|
4870
|
+
var handlePickImage = /*#__PURE__*/function () {
|
|
4871
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
4872
|
+
var _childElement$props$o, _childElement$props;
|
|
4873
|
+
var result;
|
|
4874
|
+
return _regeneratorRuntime().wrap(function (_context) {
|
|
4875
|
+
while (1) switch (_context.prev = _context.next) {
|
|
4876
|
+
case 0:
|
|
4877
|
+
if (!disabled) {
|
|
4878
|
+
_context.next = 2;
|
|
4879
|
+
break;
|
|
4880
|
+
}
|
|
4881
|
+
return _context.abrupt("return");
|
|
4882
|
+
case 2:
|
|
4883
|
+
(_childElement$props$o = (_childElement$props = childElement.props).onPress) === null || _childElement$props$o === void 0 || _childElement$props$o.call(_childElement$props);
|
|
4884
|
+
|
|
4885
|
+
// No permissions request is necessary for launching the image library
|
|
4886
|
+
_context.next = 5;
|
|
4887
|
+
return launchImageLibraryAsync(_objectSpread(_objectSpread({}, imagePickerOptions), {}, {
|
|
4888
|
+
allowsMultipleSelection: false
|
|
4889
|
+
}));
|
|
4890
|
+
case 5:
|
|
4891
|
+
result = _context.sent;
|
|
4892
|
+
if (!result.canceled) {
|
|
4893
|
+
onImageSelected(result.assets[0]);
|
|
4894
|
+
}
|
|
4895
|
+
case 7:
|
|
4896
|
+
case "end":
|
|
4897
|
+
return _context.stop();
|
|
4898
|
+
}
|
|
4899
|
+
}, _callee);
|
|
4900
|
+
}));
|
|
4901
|
+
return function () {
|
|
4902
|
+
return _ref2.apply(this, arguments);
|
|
4903
|
+
};
|
|
4904
|
+
}();
|
|
4905
|
+
return /*#__PURE__*/jsx(View, {
|
|
4906
|
+
children: /*#__PURE__*/cloneElement(childElement, {
|
|
4907
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
4908
|
+
onPress: handlePickImage,
|
|
4909
|
+
disabled: disabled
|
|
4910
|
+
})
|
|
4911
|
+
});
|
|
4912
|
+
}
|
|
4913
|
+
|
|
4817
4914
|
var GoogleMapsApiKeyContext = /*#__PURE__*/createContext(undefined);
|
|
4818
4915
|
function GoogleMapsApiKeyProvider(_ref) {
|
|
4819
4916
|
var children = _ref.children,
|
|
@@ -7202,48 +7299,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7202
7299
|
}
|
|
7203
7300
|
}
|
|
7204
7301
|
},
|
|
7205
|
-
tag: {
|
|
7206
|
-
primary: {
|
|
7207
|
-
fill: {
|
|
7208
|
-
backgroundColor: theme.tag.primary.fill.backgroundColor,
|
|
7209
|
-
borderColor: theme.tag.primary.fill.borderColor
|
|
7210
|
-
},
|
|
7211
|
-
outline: {
|
|
7212
|
-
backgroundColor: theme.tag.primary.outline.backgroundColor,
|
|
7213
|
-
borderColor: theme.tag.primary.outline.borderColor
|
|
7214
|
-
}
|
|
7215
|
-
},
|
|
7216
|
-
"default": {
|
|
7217
|
-
fill: {
|
|
7218
|
-
backgroundColor: theme.tag["default"].fill.backgroundColor,
|
|
7219
|
-
borderColor: theme.tag["default"].fill.borderColor
|
|
7220
|
-
},
|
|
7221
|
-
outline: {
|
|
7222
|
-
backgroundColor: theme.tag["default"].outline.backgroundColor,
|
|
7223
|
-
borderColor: theme.tag["default"].outline.borderColor
|
|
7224
|
-
}
|
|
7225
|
-
},
|
|
7226
|
-
danger: {
|
|
7227
|
-
fill: {
|
|
7228
|
-
backgroundColor: theme.tag.danger.fill.backgroundColor,
|
|
7229
|
-
borderColor: theme.tag.danger.fill.borderColor
|
|
7230
|
-
},
|
|
7231
|
-
outline: {
|
|
7232
|
-
backgroundColor: theme.tag.danger.outline.backgroundColor,
|
|
7233
|
-
borderColor: theme.tag.danger.outline.borderColor
|
|
7234
|
-
}
|
|
7235
|
-
},
|
|
7236
|
-
warn: {
|
|
7237
|
-
fill: {
|
|
7238
|
-
backgroundColor: theme.tag.warn.fill.backgroundColor,
|
|
7239
|
-
borderColor: theme.tag.warn.fill.borderColor
|
|
7240
|
-
},
|
|
7241
|
-
outline: {
|
|
7242
|
-
backgroundColor: theme.tag.warn.outline.backgroundColor,
|
|
7243
|
-
borderColor: theme.tag.warn.outline.borderColor
|
|
7244
|
-
}
|
|
7245
|
-
}
|
|
7246
|
-
},
|
|
7247
7302
|
tooltip: {
|
|
7248
7303
|
backgroundColor: theme.tooltip.backgroundColor
|
|
7249
7304
|
},
|
|
@@ -7731,37 +7786,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7731
7786
|
borderWidth: theme.listItem.borderWidth
|
|
7732
7787
|
},
|
|
7733
7788
|
tag: {
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
borderWidth: theme.tag.primary.fill.borderWidth
|
|
7737
|
-
},
|
|
7738
|
-
outline: {
|
|
7739
|
-
borderWidth: theme.tag.primary.outline.borderWidth
|
|
7740
|
-
}
|
|
7741
|
-
},
|
|
7742
|
-
"default": {
|
|
7743
|
-
fill: {
|
|
7744
|
-
borderWidth: theme.tag["default"].fill.borderWidth
|
|
7745
|
-
},
|
|
7746
|
-
outline: {
|
|
7747
|
-
borderWidth: theme.tag["default"].outline.borderWidth
|
|
7748
|
-
}
|
|
7789
|
+
fill: {
|
|
7790
|
+
borderWidth: theme.tag.fill.borderWidth
|
|
7749
7791
|
},
|
|
7750
|
-
|
|
7751
|
-
|
|
7752
|
-
borderWidth: theme.tag.danger.fill.borderWidth
|
|
7753
|
-
},
|
|
7754
|
-
outline: {
|
|
7755
|
-
borderWidth: theme.tag.danger.outline.borderWidth
|
|
7756
|
-
}
|
|
7757
|
-
},
|
|
7758
|
-
warn: {
|
|
7759
|
-
fill: {
|
|
7760
|
-
borderWidth: theme.tag.warn.fill.borderWidth
|
|
7761
|
-
},
|
|
7762
|
-
outline: {
|
|
7763
|
-
borderWidth: theme.tag.warn.outline.borderWidth
|
|
7764
|
-
}
|
|
7792
|
+
outline: {
|
|
7793
|
+
borderWidth: theme.tag.outline.borderWidth
|
|
7765
7794
|
}
|
|
7766
7795
|
}
|
|
7767
7796
|
},
|
|
@@ -7856,6 +7885,39 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7856
7885
|
pageLoader: {
|
|
7857
7886
|
size: theme.pageLoader.size
|
|
7858
7887
|
},
|
|
7888
|
+
tag: {
|
|
7889
|
+
small: {
|
|
7890
|
+
iconSize: theme.tag.icon.small
|
|
7891
|
+
},
|
|
7892
|
+
medium: {
|
|
7893
|
+
iconSize: theme.tag.icon.medium
|
|
7894
|
+
},
|
|
7895
|
+
large: {
|
|
7896
|
+
iconSize: theme.tag.icon.large
|
|
7897
|
+
},
|
|
7898
|
+
withIcon: {
|
|
7899
|
+
small: {
|
|
7900
|
+
height: theme.tag.withIcon.small.height
|
|
7901
|
+
},
|
|
7902
|
+
medium: {
|
|
7903
|
+
height: theme.tag.withIcon.medium.height
|
|
7904
|
+
},
|
|
7905
|
+
large: {
|
|
7906
|
+
height: theme.tag.withIcon.large.height
|
|
7907
|
+
}
|
|
7908
|
+
},
|
|
7909
|
+
withoutIcon: {
|
|
7910
|
+
small: {
|
|
7911
|
+
height: theme.tag.withoutIcon.small.height
|
|
7912
|
+
},
|
|
7913
|
+
medium: {
|
|
7914
|
+
height: theme.tag.withoutIcon.medium.height
|
|
7915
|
+
},
|
|
7916
|
+
large: {
|
|
7917
|
+
height: theme.tag.withoutIcon.large.height
|
|
7918
|
+
}
|
|
7919
|
+
}
|
|
7920
|
+
},
|
|
7859
7921
|
tooltip: {
|
|
7860
7922
|
maxWidth: theme.tooltip.maxWidth,
|
|
7861
7923
|
arrow: {
|
|
@@ -7945,8 +8007,34 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
|
|
|
7945
8007
|
horizontalPadding: theme.listItem.horizontalPadding
|
|
7946
8008
|
},
|
|
7947
8009
|
tag: {
|
|
7948
|
-
|
|
7949
|
-
|
|
8010
|
+
withoutIcon: {
|
|
8011
|
+
small: {
|
|
8012
|
+
paddingLeft: theme.tag.withoutIcon.small.paddingLeft,
|
|
8013
|
+
paddingRight: theme.tag.withoutIcon.small.paddingRight
|
|
8014
|
+
},
|
|
8015
|
+
medium: {
|
|
8016
|
+
paddingLeft: theme.tag.withoutIcon.medium.paddingLeft,
|
|
8017
|
+
paddingRight: theme.tag.withoutIcon.medium.paddingRight
|
|
8018
|
+
},
|
|
8019
|
+
large: {
|
|
8020
|
+
paddingLeft: theme.tag.withoutIcon.large.paddingLeft,
|
|
8021
|
+
paddingRight: theme.tag.withoutIcon.large.paddingRight
|
|
8022
|
+
}
|
|
8023
|
+
},
|
|
8024
|
+
withIcon: {
|
|
8025
|
+
small: {
|
|
8026
|
+
paddingLeft: theme.tag.withIcon.small.paddingLeft,
|
|
8027
|
+
paddingRight: theme.tag.withIcon.small.paddingRight
|
|
8028
|
+
},
|
|
8029
|
+
medium: {
|
|
8030
|
+
paddingLeft: theme.tag.withIcon.medium.paddingLeft,
|
|
8031
|
+
paddingRight: theme.tag.withIcon.medium.paddingRight
|
|
8032
|
+
},
|
|
8033
|
+
large: {
|
|
8034
|
+
paddingLeft: theme.tag.withIcon.large.paddingLeft,
|
|
8035
|
+
paddingRight: theme.tag.withIcon.large.paddingRight
|
|
8036
|
+
}
|
|
8037
|
+
}
|
|
7950
8038
|
},
|
|
7951
8039
|
tooltip: {
|
|
7952
8040
|
horizontalPadding: theme.tooltip.horizontalPadding,
|
|
@@ -9867,49 +9955,69 @@ var StoryGrid = {
|
|
|
9867
9955
|
Col: StoryGridCol
|
|
9868
9956
|
};
|
|
9869
9957
|
|
|
9870
|
-
|
|
9958
|
+
function useKittTheme() {
|
|
9959
|
+
return useMemo(function () {
|
|
9960
|
+
return {
|
|
9961
|
+
kitt: theme
|
|
9962
|
+
};
|
|
9963
|
+
}, []);
|
|
9964
|
+
}
|
|
9965
|
+
|
|
9966
|
+
var getTypography = function (size) {
|
|
9967
|
+
switch (size) {
|
|
9968
|
+
case 'small':
|
|
9969
|
+
return 'body-xs';
|
|
9970
|
+
case 'medium':
|
|
9971
|
+
return 'body-s';
|
|
9972
|
+
case 'large':
|
|
9973
|
+
default:
|
|
9974
|
+
return 'body-m';
|
|
9975
|
+
}
|
|
9976
|
+
};
|
|
9977
|
+
var typeToColor = function (color, type) {
|
|
9978
|
+
if (color) return color;
|
|
9871
9979
|
switch (type) {
|
|
9872
|
-
case 'danger':
|
|
9873
|
-
{
|
|
9874
|
-
return variant === 'outline' ? 'danger' : 'black';
|
|
9875
|
-
}
|
|
9876
|
-
case 'warn':
|
|
9877
|
-
{
|
|
9878
|
-
return variant === 'outline' ? 'warning' : 'black';
|
|
9879
|
-
}
|
|
9880
9980
|
case 'primary':
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9981
|
+
return 'violine';
|
|
9982
|
+
case 'warn':
|
|
9983
|
+
return 'sun';
|
|
9984
|
+
case 'danger':
|
|
9985
|
+
return 'coral';
|
|
9884
9986
|
case 'default':
|
|
9885
|
-
{
|
|
9886
|
-
return 'black';
|
|
9887
|
-
}
|
|
9888
9987
|
default:
|
|
9889
|
-
|
|
9890
|
-
return 'black';
|
|
9891
|
-
}
|
|
9988
|
+
return 'eggshell';
|
|
9892
9989
|
}
|
|
9893
9990
|
};
|
|
9894
9991
|
function Tag(_ref) {
|
|
9895
9992
|
var label = _ref.label,
|
|
9896
|
-
|
|
9897
|
-
|
|
9993
|
+
icon = _ref.icon,
|
|
9994
|
+
color = _ref.color,
|
|
9995
|
+
type = _ref.type,
|
|
9996
|
+
_ref$size = _ref.size,
|
|
9997
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
9898
9998
|
_ref$variant = _ref.variant,
|
|
9899
9999
|
variant = _ref$variant === void 0 ? 'fill' : _ref$variant;
|
|
9900
|
-
|
|
10000
|
+
var kittTheme = useKittTheme();
|
|
10001
|
+
var tagColor = typeToColor(color, type);
|
|
10002
|
+
return /*#__PURE__*/jsxs(HStack, {
|
|
9901
10003
|
alignSelf: "flex-start",
|
|
9902
10004
|
borderRadius: "kitt.tag.borderRadius",
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
10005
|
+
height: "kitt.tag.".concat(icon ? 'withIcon' : 'withoutIcon', ".").concat(size, ".height"),
|
|
10006
|
+
paddingLeft: "kitt.tag.".concat(icon ? 'withIcon' : 'withoutIcon', ".").concat(size, ".paddingLeft"),
|
|
10007
|
+
paddingRight: "kitt.tag.".concat(icon ? 'withIcon' : 'withoutIcon', ".").concat(size, ".paddingRight"),
|
|
10008
|
+
backgroundColor: variant === 'fill' ? kittTheme.kitt.palettes.lateOcean["".concat(tagColor, ".4")] : 'kitt.transparent',
|
|
10009
|
+
borderColor: kittTheme.kitt.palettes.lateOcean["".concat(tagColor, ".6")],
|
|
10010
|
+
borderWidth: "kitt.tag.".concat(variant, ".borderWidth"),
|
|
10011
|
+
space: "kitt.1",
|
|
10012
|
+
alignItems: "center",
|
|
10013
|
+
children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
|
|
10014
|
+
icon: icon,
|
|
10015
|
+
size: "kitt.tag.".concat(size, ".iconSize")
|
|
10016
|
+
}) : null, /*#__PURE__*/jsx(Typography.Text, {
|
|
10017
|
+
base: getTypography(size),
|
|
10018
|
+
color: "black",
|
|
9911
10019
|
children: label
|
|
9912
|
-
})
|
|
10020
|
+
})]
|
|
9913
10021
|
});
|
|
9914
10022
|
}
|
|
9915
10023
|
|
|
@@ -10458,14 +10566,6 @@ function TypographyLink(_ref) {
|
|
|
10458
10566
|
});
|
|
10459
10567
|
}
|
|
10460
10568
|
|
|
10461
|
-
function useKittTheme() {
|
|
10462
|
-
return useMemo(function () {
|
|
10463
|
-
return {
|
|
10464
|
-
kitt: theme
|
|
10465
|
-
};
|
|
10466
|
-
}, []);
|
|
10467
|
-
}
|
|
10468
|
-
|
|
10469
10569
|
function KittThemeProvider(_ref) {
|
|
10470
10570
|
var isSSR = _ref.isSSR,
|
|
10471
10571
|
children = _ref.children,
|
|
@@ -10690,5 +10790,5 @@ function VerticalSteps(_ref) {
|
|
|
10690
10790
|
}
|
|
10691
10791
|
VerticalSteps.Step = ExternalStep;
|
|
10692
10792
|
|
|
10693
|
-
export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, Emoji, ExternalAppLink, ExternalLink, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, HStack, Highlight, Icon, IconButton, Image, InputAddress, InputEmail, InputFeedback, InputField, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarkerLarge, MapMarkerPosition, MapMarkerSimple, MatchWindowSize, Message, ModalBehaviour, NativeOnlyFlatList, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
|
|
10793
|
+
export { ActionCard, Actions, Autocomplete, Avatar, BottomSheet, Button, CardModal, Center, Checkbox, ChoicesElements, CloseIconButton, DatePicker, DialogModal, DocumentPicker, Emoji, ExternalAppLink, ExternalLink, FilePicker, FlatList, Flex, FullscreenModal, GoogleMapsApiKeyProvider, GoogleMapsAutocompleteProvider, HStack, Highlight, Icon, IconButton, Image, ImagePicker, InputAddress, InputEmail, InputFeedback, InputField, InputIcon, InputNumber, InputPassword, InputPhone, InputPressable, InputTag, InputText, KittBreakpointNameEnum, KittBreakpoints, KittBreakpointsMax, KittMapConfigProvider, KittNativeBaseProvider, KittThemeDecorator, KittThemeProvider, Label, ListItem, LoaderIcon, MapMarkerLarge, MapMarkerPosition, MapMarkerSimple, MatchWindowSize, Message, ModalBehaviour, NativeOnlyFlatList, NavigationModal, Notification, Overlay, PageLoader, Picker, Pressable, Radio, RadioButtonGroup, ScrollView, DeprecatedSection as Section, SectionList, SegmentedProgressBar, Skeleton, SpinningIcon, Stack, StaticMap, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, SwitchBreakpoints, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, VStack, VerticalSteps, View, createChoicesComponent, createResponsiveStyleFromProp, getStaticMapImageUrl, hex2rgba, matchWindowSize, storyPadding, theme, useBottomSheet, useBreakpointValue, useCurrentBreakpointName, useGetStaticMapImageUrl, useKittMapConfig, useKittTheme, useMatchWindowSize, useOpenExternalLink, useStaticBottomSheet, useStoryBlockColor, useTheme };
|
|
10694
10794
|
//# sourceMappingURL=index.es.web.js.map
|