@apple-pie/slice 0.0.1 → 0.0.2
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/cjs/chunks/Avatar-8-wPWe0V.js +68 -0
- package/dist/cjs/chunks/AvatarGroup-CVKmgBbD.js +39 -0
- package/dist/cjs/chunks/Badge-CMapJCij.js +41 -0
- package/dist/cjs/chunks/CheckBox-7AACxrdZ.js +76 -0
- package/dist/cjs/chunks/DivInput-BKKJTFeV.js +204 -0
- package/dist/cjs/chunks/DocIcons-BRWOzK96.js +41 -0
- package/dist/cjs/chunks/Dot-Dnr9M9na.js +80 -0
- package/dist/cjs/chunks/DrggablePanel-C6TPsDB-.js +302 -0
- package/dist/cjs/chunks/DropDown-D9sf_m2I.js +154 -0
- package/dist/cjs/chunks/EditorButtonBar-CUNDgRQd.js +244 -0
- package/dist/cjs/chunks/ErrorSummary-Dv44onsV.js +42 -0
- package/dist/cjs/chunks/FlexDiv-DZBpswHV.js +103 -0
- package/dist/cjs/chunks/Grouper-_kd2nU78.js +50 -0
- package/dist/cjs/chunks/IconButton-BfsPlKTb.js +84 -0
- package/dist/cjs/chunks/Logos-DSlAUz8l.js +119 -0
- package/dist/cjs/chunks/MessageInput-CiHFo2j8.js +399 -0
- package/dist/cjs/chunks/Overlay-DwCPvGB5.js +45 -0
- package/dist/cjs/chunks/Pager-CFtZ0IIW.js +42 -0
- package/dist/cjs/chunks/ProgressIndicator-C5oB7Mky.js +121 -0
- package/dist/cjs/chunks/RadioButton-e_y2qiPE.js +65 -0
- package/dist/cjs/chunks/RadioButtonList-I81UwHmM.js +116 -0
- package/dist/cjs/chunks/Slider-C-gn7Sby.js +285 -0
- package/dist/cjs/chunks/Spacer-BEY2-_PB.js +16 -0
- package/dist/cjs/chunks/Switch-CtkFtogd.js +43 -0
- package/dist/cjs/chunks/TabBar-D3bj4pjj.js +176 -0
- package/dist/cjs/chunks/TextArea-B1oKK3_b.js +153 -0
- package/dist/cjs/chunks/TextField-CiQdPP5E.js +248 -0
- package/dist/cjs/chunks/Tip-C2pzExut.js +91 -0
- package/dist/cjs/chunks/Toast-DrijUwoL.js +141 -0
- package/dist/cjs/chunks/UIButton-CH4p-8yq.js +317 -0
- package/dist/cjs/chunks/UIButtonBar-0fHPB0ww.js +58 -0
- package/dist/cjs/chunks/UICard-DBDSyT7E.js +36 -0
- package/dist/cjs/chunks/UIChip-kjhvRrOV.js +93 -0
- package/dist/cjs/chunks/UIFileIcon-ZrbDIeYz.js +54 -0
- package/dist/cjs/chunks/UILabel-DkBE2AIt.js +116 -0
- package/dist/cjs/chunks/_types-CoWzQFsT.js +714 -0
- package/dist/cjs/chunks/sharedTypes-BvTjh6M5.js +9 -0
- package/dist/cjs/chunks/style-inject.es-XZHJH68X.js +30 -0
- package/dist/cjs/chunks/tipStore-C9oV9SIh.js +23 -0
- package/dist/cjs/chunks/toastStore-C-ETP9H6.js +23 -0
- package/dist/cjs/chunks/tslib.es6-4H29ixHs.js +48 -0
- package/dist/cjs/chunks/utils-CbayehuI.js +126 -0
- package/dist/cjs/hooks/useDoubleClick.js +26 -0
- package/dist/cjs/hooks/useKeyboardShortcuts.js +42 -0
- package/dist/cjs/hooks/useLastUpdated.js +53 -0
- package/dist/cjs/hooks/useLocalStore.js +52 -0
- package/dist/cjs/hooks/useObserveResize.js +56 -0
- package/dist/cjs/hooks/useObserveTheme.js +36 -0
- package/dist/cjs/hooks/useTheme.js +85 -0
- package/dist/cjs/hooks/useToolTip.js +36 -0
- package/dist/cjs/hooks/useTrackRenders.js +38 -0
- package/dist/cjs/hooks/useWindow.js +64 -0
- package/dist/cjs/hooks.js +32 -0
- package/dist/cjs/index.js +121 -0
- package/dist/cjs/providers/ThemeProvider.js +51 -0
- package/dist/cjs/providers.js +13 -0
- package/dist/cjs/stores/tip.js +12 -0
- package/dist/cjs/stores/toast.js +12 -0
- package/dist/cjs/stores.js +18 -0
- package/dist/cjs/theme/colors.js +383 -0
- package/dist/cjs/theme/corners.js +14 -0
- package/dist/cjs/theme/themes.js +23 -0
- package/dist/cjs/theme/type.js +316 -0
- package/dist/cjs/theme.js +13 -0
- package/dist/cjs/uikit/Avatar.js +11 -0
- package/dist/cjs/uikit/AvatarGroup.js +12 -0
- package/dist/cjs/uikit/Badge.js +11 -0
- package/dist/cjs/uikit/CheckBox.js +21 -0
- package/dist/cjs/uikit/DivInput.js +13 -0
- package/dist/cjs/uikit/DocIcon.js +17 -0
- package/dist/cjs/uikit/Dot.js +12 -0
- package/dist/cjs/uikit/DraggablePanel.js +20 -0
- package/dist/cjs/uikit/DropDown.js +20 -0
- package/dist/cjs/uikit/EditorButtonBar.js +27 -0
- package/dist/cjs/uikit/ErrorSummary.js +12 -0
- package/dist/cjs/uikit/FlexDiv.js +12 -0
- package/dist/cjs/uikit/Grouper.js +22 -0
- package/dist/cjs/uikit/Icon.js +22 -0
- package/dist/cjs/uikit/IconButton.js +24 -0
- package/dist/cjs/uikit/Logos.js +17 -0
- package/dist/cjs/uikit/MessageInput.js +29 -0
- package/dist/cjs/uikit/Overlay.js +12 -0
- package/dist/cjs/uikit/Pager.js +12 -0
- package/dist/cjs/uikit/Progress.js +20 -0
- package/dist/cjs/uikit/RadioButton.js +25 -0
- package/dist/cjs/uikit/RadioButtonList.js +26 -0
- package/dist/cjs/uikit/Slider.js +13 -0
- package/dist/cjs/uikit/Spacer.js +10 -0
- package/dist/cjs/uikit/Switch.js +12 -0
- package/dist/cjs/uikit/TabBar.js +25 -0
- package/dist/cjs/uikit/TextArea.js +26 -0
- package/dist/cjs/uikit/Textfield.js +27 -0
- package/dist/cjs/uikit/Tip.js +13 -0
- package/dist/cjs/uikit/Toast.js +25 -0
- package/dist/cjs/uikit/UIButton.js +25 -0
- package/dist/cjs/uikit/UIButtonBar.js +25 -0
- package/dist/cjs/uikit/UICard.js +20 -0
- package/dist/cjs/uikit/UIChip.js +21 -0
- package/dist/cjs/uikit/UIFileIcon.js +17 -0
- package/dist/cjs/uikit/UILabel.js +18 -0
- package/dist/esm/chunks/Avatar-D_muqPrW.js +66 -0
- package/dist/esm/chunks/AvatarGroup-D8Xmrn52.js +37 -0
- package/dist/esm/chunks/Badge-PPf5Uvw3.js +39 -0
- package/dist/esm/chunks/CheckBox-CswFI0Xc.js +74 -0
- package/dist/esm/chunks/DivInput-iKFkeU2F.js +202 -0
- package/dist/esm/chunks/DocIcons-CbOX4n8Y.js +39 -0
- package/dist/esm/chunks/Dot-B84UVs2e.js +78 -0
- package/dist/esm/chunks/DrggablePanel-CYYwTmFd.js +300 -0
- package/dist/esm/chunks/DropDown-D4t6EhKL.js +152 -0
- package/dist/esm/chunks/EditorButtonBar-FnMa8Zv2.js +242 -0
- package/dist/esm/chunks/ErrorSummary-DhU5SKPt.js +40 -0
- package/dist/esm/chunks/FlexDiv-CmMpORgn.js +101 -0
- package/dist/esm/chunks/Grouper-BbreOXI9.js +48 -0
- package/dist/esm/chunks/IconButton-CguHGkBM.js +82 -0
- package/dist/esm/chunks/Logos-DwZP-TR2.js +117 -0
- package/dist/esm/chunks/MessageInput-DMHzCwjO.js +397 -0
- package/dist/esm/chunks/Overlay-CCBy7n7H.js +43 -0
- package/dist/esm/chunks/Pager-BsSti93V.js +40 -0
- package/dist/esm/chunks/ProgressIndicator-BVukxMU6.js +118 -0
- package/dist/esm/chunks/RadioButton-B5BxQI0R.js +63 -0
- package/dist/esm/chunks/RadioButtonList-C2z8McAD.js +114 -0
- package/dist/esm/chunks/Slider-C-PcWqTz.js +283 -0
- package/dist/esm/chunks/Spacer-DbZSG5x3.js +14 -0
- package/dist/esm/chunks/Switch-DjfrSiQz.js +41 -0
- package/dist/esm/chunks/TabBar-BSBcgTbd.js +174 -0
- package/dist/esm/chunks/TextArea-COM0UPo2.js +151 -0
- package/dist/esm/chunks/TextField-Bh24bRWs.js +246 -0
- package/dist/esm/chunks/Tip-Ct19Ljul.js +89 -0
- package/dist/esm/chunks/Toast-BR0oMX6z.js +139 -0
- package/dist/esm/chunks/UIButton-DKx-_O8h.js +315 -0
- package/dist/esm/chunks/UIButtonBar-BNdA5eVq.js +56 -0
- package/dist/esm/chunks/UICard-Dn5f3wg8.js +34 -0
- package/dist/esm/chunks/UIChip-DqnGeVyR.js +91 -0
- package/dist/esm/chunks/UIFileIcon-qGxIPsJJ.js +52 -0
- package/dist/esm/chunks/UILabel-RnbodPCS.js +114 -0
- package/dist/esm/chunks/_types-BaYeLEWK.js +712 -0
- package/dist/esm/chunks/sharedTypes-BfZzG1KX.js +9 -0
- package/dist/esm/chunks/style-inject.es-tgCJW-Cu.js +28 -0
- package/dist/esm/chunks/tipStore-nBYJ6tmE.js +17 -0
- package/dist/esm/chunks/toastStore-r3pvNa28.js +17 -0
- package/dist/esm/chunks/tslib.es6-0pkUdtrF.js +45 -0
- package/dist/esm/chunks/utils-BRZK2Drn.js +119 -0
- package/dist/esm/hooks/useDoubleClick.js +24 -0
- package/dist/esm/hooks/useKeyboardShortcuts.js +40 -0
- package/dist/esm/hooks/useLastUpdated.js +51 -0
- package/dist/esm/hooks/useLocalStore.js +50 -0
- package/dist/esm/hooks/useObserveResize.js +54 -0
- package/dist/esm/hooks/useObserveTheme.js +34 -0
- package/dist/esm/hooks/useTheme.js +83 -0
- package/dist/esm/hooks/useToolTip.js +34 -0
- package/dist/esm/hooks/useTrackRenders.js +36 -0
- package/dist/esm/hooks/useWindow.js +62 -0
- package/dist/esm/hooks.js +14 -0
- package/dist/esm/index.js +57 -0
- package/dist/esm/providers/ThemeProvider.js +49 -0
- package/dist/esm/providers.js +7 -0
- package/dist/esm/stores/tip.js +2 -0
- package/dist/esm/stores/toast.js +2 -0
- package/dist/esm/stores.js +3 -0
- package/dist/esm/theme/colors.js +377 -0
- package/dist/esm/theme/corners.js +12 -0
- package/dist/esm/theme/themes.js +20 -0
- package/dist/esm/theme/type.js +312 -0
- package/dist/esm/theme.js +4 -0
- package/dist/esm/uikit/Avatar.js +5 -0
- package/dist/esm/uikit/AvatarGroup.js +6 -0
- package/dist/esm/uikit/Badge.js +5 -0
- package/dist/esm/uikit/CheckBox.js +15 -0
- package/dist/esm/uikit/DivInput.js +7 -0
- package/dist/esm/uikit/DocIcon.js +11 -0
- package/dist/esm/uikit/Dot.js +6 -0
- package/dist/esm/uikit/DraggablePanel.js +14 -0
- package/dist/esm/uikit/DropDown.js +14 -0
- package/dist/esm/uikit/EditorButtonBar.js +21 -0
- package/dist/esm/uikit/ErrorSummary.js +6 -0
- package/dist/esm/uikit/FlexDiv.js +6 -0
- package/dist/esm/uikit/Grouper.js +16 -0
- package/dist/esm/uikit/Icon.js +12 -0
- package/dist/esm/uikit/IconButton.js +18 -0
- package/dist/esm/uikit/Logos.js +11 -0
- package/dist/esm/uikit/MessageInput.js +23 -0
- package/dist/esm/uikit/Overlay.js +6 -0
- package/dist/esm/uikit/Pager.js +6 -0
- package/dist/esm/uikit/Progress.js +13 -0
- package/dist/esm/uikit/RadioButton.js +19 -0
- package/dist/esm/uikit/RadioButtonList.js +20 -0
- package/dist/esm/uikit/Slider.js +7 -0
- package/dist/esm/uikit/Spacer.js +4 -0
- package/dist/esm/uikit/Switch.js +6 -0
- package/dist/esm/uikit/TabBar.js +19 -0
- package/dist/esm/uikit/TextArea.js +20 -0
- package/dist/esm/uikit/Textfield.js +21 -0
- package/dist/esm/uikit/Tip.js +7 -0
- package/dist/esm/uikit/Toast.js +15 -0
- package/dist/esm/uikit/UIButton.js +19 -0
- package/dist/esm/uikit/UIButtonBar.js +19 -0
- package/dist/esm/uikit/UICard.js +14 -0
- package/dist/esm/uikit/UIChip.js +15 -0
- package/dist/esm/uikit/UIFileIcon.js +11 -0
- package/dist/esm/uikit/UILabel.js +12 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/stores/index.d.ts +2 -0
- package/dist/types/stores/tip/_types.d.ts +8 -0
- package/dist/types/stores/tip/index.d.ts +2 -0
- package/dist/types/stores/tip/tipStore.d.ts +12 -0
- package/dist/types/stores/toast/_types.d.ts +14 -0
- package/dist/types/stores/toast/index.d.ts +2 -0
- package/dist/types/stores/toast/toastStore.d.ts +12 -0
- package/dist/types/uikit/FlexDiv/FlexDiv.d.ts +2 -0
- package/dist/types/uikit/FlexDiv/_types.d.ts +1 -0
- package/dist/types/uikit/Toast/Toast.d.ts +1 -1
- package/dist/types/uikit/Toast/_types.d.ts +7 -1
- package/dist/types/uikit/Toast/index.d.ts +1 -1
- package/package.json +79 -5
- package/dist/index.esm.js +0 -5859
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -5911
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('motion/react');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var hooks_useTheme = require('../hooks/useTheme.js');
|
|
8
|
+
require('../theme/colors.js');
|
|
9
|
+
require('../hooks/useWindow.js');
|
|
10
|
+
var Badge = require('./Badge-CMapJCij.js');
|
|
11
|
+
var Dot = require('./Dot-Dnr9M9na.js');
|
|
12
|
+
var _types = require('./_types-CoWzQFsT.js');
|
|
13
|
+
var ProgressIndicator = require('./ProgressIndicator-C5oB7Mky.js');
|
|
14
|
+
var sharedTypes = require('./sharedTypes-BvTjh6M5.js');
|
|
15
|
+
var styleInject_es = require('./style-inject.es-XZHJH68X.js');
|
|
16
|
+
|
|
17
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UIButton-module_button__nAcQH {\n\tposition: relative;\n\tuser-select: none;\n\tmin-width: var(--ui-button-min-width);\n\t-webkit-user-select: none;\n}\n\n.UIButton-module_label__q4X-J {\n\tuser-select: none;\n\t-webkit-user-select: none;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\tword-break: break-all;\n\tdisplay: -webkit-box;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n\t&:hover {\n\t\ttext-decoration: var(--ui-button-decoration);\n\t}\n}\n\n.UIButton-module_count__AvZ7Z {\n\tposition: absolute;\n\ttop: 0;\n\tright: 0;\n\ttransform: translateX(10px) translateY(-2px);\n}\n\n.UIButton-module_icon__An3R1 {\n\tmin-width: var(--ui-button-icon-size);\n\tmin-height: var(--ui-button-icon-size);\n\theight: var(--ui-button-icon-size);\n\twidth: var(--ui-button-icon-size);\n}\n\n.UIButton-module_m__6qPGY {\n}\n\n.UIButton-module_l__8Pu8o {\n}\n\n.UIButton-module_s__YShP1 {\n}\n";
|
|
18
|
+
var css = {"button":"UIButton-module_button__nAcQH flexBox-module_row__PWxbe","label":"UIButton-module_label__q4X-J","count":"UIButton-module_count__AvZ7Z flexBox-module_row__PWxbe","icon":"UIButton-module_icon__An3R1 flexBox-module_row__PWxbe","m":"UIButton-module_m__6qPGY type-module_body-m-regular__Qtp5G","l":"UIButton-module_l__8Pu8o type-module_body-l-regular__Ar4d3","s":"UIButton-module_s__YShP1 type-module_body-s-regular__8-FO-"};
|
|
19
|
+
styleInject_es.styleInject(css_248z);
|
|
20
|
+
|
|
21
|
+
const UIButtonComponent = React.forwardRef((props, buttonRef) => {
|
|
22
|
+
const theme = hooks_useTheme.useTheme();
|
|
23
|
+
const { size = 'medium', variant = 'outline', label = undefined, labelSize = 'm', iconRight = undefined, iconLeft = undefined, count = props.count === undefined ? undefined : Number(props.count), showDot = undefined, tooltip = undefined, round = false, state = 'normal', fill = false, iconSize = props.iconSize === undefined ? 20 : Number(props.iconSize), width = 'auto', underline = false, borderRadius = undefined, iconColor = undefined, bgColor = undefined, bgColorDisabled = undefined, labelColor = undefined, transition = undefined, variants = undefined, initial = undefined, animate = undefined, exit = undefined, paddingRight = undefined, paddingLeft = undefined, progress = false, working = false, duration = undefined, trigger = false, destructive = false, onClick = () => null, onToolTip = () => null } = props, divAttributes = tslib_es6.__rest(props, ["size", "variant", "label", "labelSize", "iconRight", "iconLeft", "count", "showDot", "tooltip", "round", "state", "fill", "iconSize", "width", "underline", "borderRadius", "iconColor", "bgColor", "bgColorDisabled", "labelColor", "transition", "variants", "initial", "animate", "exit", "paddingRight", "paddingLeft", "progress", "working", "duration", "trigger", "destructive", "onClick", "onToolTip"]);
|
|
24
|
+
const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
|
|
25
|
+
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
26
|
+
const divClass = className ? ` ${className}` : '';
|
|
27
|
+
const [btnState, setBtnState] = React.useState(state);
|
|
28
|
+
const [btnWidth, setBtnWidth] = React.useState(undefined);
|
|
29
|
+
const [playing, setPlaying] = React.useState(working);
|
|
30
|
+
const ref = React.useRef(null);
|
|
31
|
+
const handleClick = React.useCallback((e) => {
|
|
32
|
+
onToolTip(null);
|
|
33
|
+
if (state === 'disabled')
|
|
34
|
+
return;
|
|
35
|
+
if (progress && duration) {
|
|
36
|
+
setPlaying(true);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
onClick(e);
|
|
40
|
+
}
|
|
41
|
+
}, [onToolTip, state, progress, duration, onClick]);
|
|
42
|
+
React.useEffect(() => setBtnState(state), [state]);
|
|
43
|
+
React.useEffect(() => setPlaying(working), [working]);
|
|
44
|
+
// memo button width - note the inclusion of unnecessary dependencies for story book purposes
|
|
45
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: avoid expensive observers
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
if (!variant || !size || !labelSize)
|
|
48
|
+
return;
|
|
49
|
+
if (ref === null || ref === void 0 ? void 0 : ref.current)
|
|
50
|
+
setBtnWidth(ref.current.offsetWidth);
|
|
51
|
+
else
|
|
52
|
+
setBtnWidth(width);
|
|
53
|
+
}, [width, variant, labelSize, size, iconLeft, iconRight]);
|
|
54
|
+
React.useImperativeHandle(buttonRef, () => ({
|
|
55
|
+
triggerClick: () => handleClick(undefined),
|
|
56
|
+
}));
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (trigger)
|
|
59
|
+
handleClick(undefined);
|
|
60
|
+
}, [trigger, handleClick]);
|
|
61
|
+
// memo destructive check
|
|
62
|
+
const destructiveColor = React.useCallback((icon) => {
|
|
63
|
+
if (icon && variant === 'solid') {
|
|
64
|
+
return theme.current.colors['core-text-light'];
|
|
65
|
+
}
|
|
66
|
+
if (destructive)
|
|
67
|
+
return theme.current.colors['feedback-warning'];
|
|
68
|
+
return theme.current.colors['core-text-primary'];
|
|
69
|
+
}, [destructive, theme, variant]);
|
|
70
|
+
// memo solid styles
|
|
71
|
+
const solid = React.useMemo(() => {
|
|
72
|
+
return {
|
|
73
|
+
border: '0px',
|
|
74
|
+
iconColor: {
|
|
75
|
+
normal: iconColor || destructiveColor(true),
|
|
76
|
+
hover: iconColor || destructiveColor(true),
|
|
77
|
+
disabled: iconColor || destructiveColor(true),
|
|
78
|
+
},
|
|
79
|
+
background: {
|
|
80
|
+
normal: bgColor ||
|
|
81
|
+
(destructive
|
|
82
|
+
? 'var(--feedback-warning)'
|
|
83
|
+
: 'var(--core-button-primary)'),
|
|
84
|
+
hover: bgColor ||
|
|
85
|
+
(destructive
|
|
86
|
+
? 'var(--feedback-warning)'
|
|
87
|
+
: 'var(--core-button-primary)'),
|
|
88
|
+
disabled: bgColorDisabled || 'var(--core-button-disabled)',
|
|
89
|
+
},
|
|
90
|
+
borderColor: {
|
|
91
|
+
normal: 'transparent',
|
|
92
|
+
hover: 'transparent',
|
|
93
|
+
disabled: 'transparent',
|
|
94
|
+
},
|
|
95
|
+
color: {
|
|
96
|
+
normal: labelColor || (destructive ? 'white' : 'var(--core-text-light)'),
|
|
97
|
+
hover: labelColor || (destructive ? 'white' : 'var(--core-text-light)'),
|
|
98
|
+
disabled: 'var(--core-text-disabled)',
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}, [
|
|
102
|
+
labelColor,
|
|
103
|
+
destructive,
|
|
104
|
+
destructiveColor,
|
|
105
|
+
bgColor,
|
|
106
|
+
bgColorDisabled,
|
|
107
|
+
iconColor,
|
|
108
|
+
]);
|
|
109
|
+
// memo outline styles
|
|
110
|
+
const outline = React.useMemo(() => {
|
|
111
|
+
return {
|
|
112
|
+
border: '1px',
|
|
113
|
+
iconColor: {
|
|
114
|
+
normal: iconColor || destructiveColor(true),
|
|
115
|
+
hover: iconColor || destructiveColor(true),
|
|
116
|
+
disabled: iconColor || 'var(--core-text-disabled)',
|
|
117
|
+
},
|
|
118
|
+
background: {
|
|
119
|
+
normal: bgColor || 'var(--core-surface-primary)',
|
|
120
|
+
hover: bgColor || 'var(--core-surface-primary)',
|
|
121
|
+
disabled: bgColorDisabled || 'var(--core-surface-primary)',
|
|
122
|
+
},
|
|
123
|
+
borderColor: {
|
|
124
|
+
normal: destructive
|
|
125
|
+
? 'var(--feedback-warning)'
|
|
126
|
+
: 'var(--core-outline-primary)',
|
|
127
|
+
hover: destructive
|
|
128
|
+
? 'var(--feedback-warning)'
|
|
129
|
+
: 'var(--core-outline-primary)',
|
|
130
|
+
disabled: 'var(--core-outline-primary)',
|
|
131
|
+
},
|
|
132
|
+
color: {
|
|
133
|
+
normal: labelColor ||
|
|
134
|
+
(destructive
|
|
135
|
+
? 'var(--feedback-warning)'
|
|
136
|
+
: 'var(--core-text-primary)'),
|
|
137
|
+
hover: labelColor ||
|
|
138
|
+
(destructive
|
|
139
|
+
? 'var(--feedback-warning)'
|
|
140
|
+
: 'var(--core-text-special)'),
|
|
141
|
+
disabled: 'var(--core-text-disabled)',
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}, [
|
|
145
|
+
iconColor,
|
|
146
|
+
destructive,
|
|
147
|
+
bgColor,
|
|
148
|
+
bgColorDisabled,
|
|
149
|
+
labelColor,
|
|
150
|
+
destructiveColor,
|
|
151
|
+
]);
|
|
152
|
+
// memo text styles
|
|
153
|
+
const text = React.useMemo(() => {
|
|
154
|
+
return {
|
|
155
|
+
border: '1px',
|
|
156
|
+
iconColor: {
|
|
157
|
+
normal: destructiveColor(true),
|
|
158
|
+
hover: destructiveColor(true),
|
|
159
|
+
disabled: 'var(--core-text-disabled)',
|
|
160
|
+
},
|
|
161
|
+
background: {
|
|
162
|
+
normal: 'transparent',
|
|
163
|
+
hover: 'transparent',
|
|
164
|
+
disabled: 'transparent',
|
|
165
|
+
},
|
|
166
|
+
borderColor: {
|
|
167
|
+
normal: 'transparent',
|
|
168
|
+
hover: 'transparent',
|
|
169
|
+
disabled: 'transparent',
|
|
170
|
+
},
|
|
171
|
+
color: {
|
|
172
|
+
normal: labelColor || destructiveColor(false),
|
|
173
|
+
hover: labelColor || destructiveColor(false),
|
|
174
|
+
disabled: 'var(--core-text-disabled)',
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
}, [destructiveColor, labelColor]);
|
|
178
|
+
// memo color styles
|
|
179
|
+
const colorStyles = React.useMemo(() => {
|
|
180
|
+
return {
|
|
181
|
+
solid,
|
|
182
|
+
outline,
|
|
183
|
+
text,
|
|
184
|
+
};
|
|
185
|
+
}, [solid, outline, text]);
|
|
186
|
+
// Memoize sizing styles
|
|
187
|
+
const setPadding = React.useCallback((side) => {
|
|
188
|
+
if (round)
|
|
189
|
+
return 0;
|
|
190
|
+
if (side === 'left' && iconLeft)
|
|
191
|
+
return 20;
|
|
192
|
+
if (side === 'right' && iconRight)
|
|
193
|
+
return 20;
|
|
194
|
+
return 24;
|
|
195
|
+
}, [round, iconLeft, iconRight]);
|
|
196
|
+
const sizingStyles = React.useMemo(() => {
|
|
197
|
+
return {
|
|
198
|
+
large: {
|
|
199
|
+
height: 48,
|
|
200
|
+
gap: 8,
|
|
201
|
+
iconSize,
|
|
202
|
+
paddingLeft: setPadding('left'),
|
|
203
|
+
paddingRight: setPadding('right'),
|
|
204
|
+
width: round ? '48px' : btnWidth || 'auto',
|
|
205
|
+
borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : '500px',
|
|
206
|
+
},
|
|
207
|
+
medium: {
|
|
208
|
+
height: 36,
|
|
209
|
+
gap: 8,
|
|
210
|
+
iconSize,
|
|
211
|
+
paddingLeft: setPadding('left'),
|
|
212
|
+
paddingRight: setPadding('right'),
|
|
213
|
+
width: round ? '36px' : btnWidth || 'auto',
|
|
214
|
+
borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : '500px',
|
|
215
|
+
},
|
|
216
|
+
text: {
|
|
217
|
+
height: 20,
|
|
218
|
+
gap: 8,
|
|
219
|
+
iconSize,
|
|
220
|
+
paddingLeft: 0,
|
|
221
|
+
paddingRight: 0,
|
|
222
|
+
btnWidth,
|
|
223
|
+
borderRadius: 0,
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
}, [iconSize, btnWidth, round, borderRadius, setPadding]);
|
|
227
|
+
// Memoize handleMouseEnter
|
|
228
|
+
const handleMouseEnter = React.useCallback((e) => {
|
|
229
|
+
if (btnState !== 'disabled')
|
|
230
|
+
setBtnState('hover');
|
|
231
|
+
if (!(ref === null || ref === void 0 ? void 0 : ref.current) || !tooltip)
|
|
232
|
+
return;
|
|
233
|
+
const tip = {
|
|
234
|
+
type: sharedTypes.ToolTipType.button,
|
|
235
|
+
payload: { label: tooltip },
|
|
236
|
+
event: e,
|
|
237
|
+
ref,
|
|
238
|
+
};
|
|
239
|
+
onToolTip(tip);
|
|
240
|
+
}, [btnState, tooltip, onToolTip]);
|
|
241
|
+
// Memoize handleMouseLeave
|
|
242
|
+
const handleMouseLeave = React.useCallback(() => {
|
|
243
|
+
if (btnState !== 'disabled')
|
|
244
|
+
setBtnState('normal');
|
|
245
|
+
if (tooltip)
|
|
246
|
+
onToolTip(null);
|
|
247
|
+
}, [btnState, tooltip, onToolTip]);
|
|
248
|
+
// Memoize handleDidStop
|
|
249
|
+
const handleDidStop = React.useCallback(() => {
|
|
250
|
+
setPlaying(false);
|
|
251
|
+
onClick(undefined);
|
|
252
|
+
}, [onClick]);
|
|
253
|
+
// Memoize showLabel
|
|
254
|
+
const shouldShowLabel = React.useMemo(() => !(playing && !iconLeft && !iconRight) && Boolean(label), [playing, iconLeft, iconRight, label]);
|
|
255
|
+
// Memoize button styles
|
|
256
|
+
const buttonStyle = React.useMemo(() => ({
|
|
257
|
+
color: colorStyles[variant].color[btnState],
|
|
258
|
+
background: fill
|
|
259
|
+
? theme.current.colors['core-surface-primary']
|
|
260
|
+
: colorStyles[variant].background[state],
|
|
261
|
+
paddingRight: paddingRight !== null && paddingRight !== void 0 ? paddingRight : sizingStyles[size].paddingRight,
|
|
262
|
+
paddingLeft: paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : sizingStyles[size].paddingLeft,
|
|
263
|
+
borderRadius: sizingStyles[size].borderRadius,
|
|
264
|
+
height: sizingStyles[size].height,
|
|
265
|
+
maxHeight: sizingStyles[size].height,
|
|
266
|
+
minHeight: sizingStyles[size].height,
|
|
267
|
+
flex: width === 'fill' ? 1 : 'unset',
|
|
268
|
+
gap: sizingStyles[size].gap,
|
|
269
|
+
borderWidth: colorStyles[variant].border,
|
|
270
|
+
borderStyle: 'solid',
|
|
271
|
+
borderColor: colorStyles[variant].borderColor[btnState],
|
|
272
|
+
cursor: state === 'disabled' ? 'default' : 'pointer',
|
|
273
|
+
transition: 'all 0s ease-in-out 0s',
|
|
274
|
+
}), [
|
|
275
|
+
colorStyles,
|
|
276
|
+
variant,
|
|
277
|
+
btnState,
|
|
278
|
+
fill,
|
|
279
|
+
theme,
|
|
280
|
+
state,
|
|
281
|
+
paddingRight,
|
|
282
|
+
paddingLeft,
|
|
283
|
+
sizingStyles,
|
|
284
|
+
size,
|
|
285
|
+
width,
|
|
286
|
+
]);
|
|
287
|
+
// memo icon stroke color
|
|
288
|
+
const iconStrokeColor = React.useMemo(() => colorStyles[variant].iconColor[state], [colorStyles, variant, state]);
|
|
289
|
+
// memo progress color
|
|
290
|
+
const progressColor = React.useMemo(() => destructive
|
|
291
|
+
? theme.current.colors['feedback-warning']
|
|
292
|
+
: colorStyles[variant].color[btnState], [destructive, theme, colorStyles, variant, btnState]);
|
|
293
|
+
const setStyle = React.useCallback((value) => {
|
|
294
|
+
if (value === undefined)
|
|
295
|
+
return 'unset';
|
|
296
|
+
if (typeof value === 'number')
|
|
297
|
+
return `${value}px`;
|
|
298
|
+
return value;
|
|
299
|
+
}, []);
|
|
300
|
+
const iconDivSize = React.useMemo(() => {
|
|
301
|
+
if (round)
|
|
302
|
+
return `${buttonStyle.minHeight}px`;
|
|
303
|
+
return iconSize ? setStyle(iconSize) : 'unset';
|
|
304
|
+
}, [round, iconSize, buttonStyle, setStyle]);
|
|
305
|
+
const cssVars = React.useMemo(() => {
|
|
306
|
+
return {
|
|
307
|
+
'--ui-button-decoration': underline ? 'underline' : 'unset',
|
|
308
|
+
'--ui-button-min-width': btnWidth ? setStyle(btnWidth) : 'unset',
|
|
309
|
+
'--ui-button-icon-size': iconDivSize,
|
|
310
|
+
};
|
|
311
|
+
}, [underline, btnWidth, setStyle, iconDivSize]);
|
|
312
|
+
return (jsxRuntime.jsxs(react.motion.div, Object.assign({ id: divId, className: `${css.button}${divClass}`, ref: ref, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: Object.assign(Object.assign(Object.assign({}, divStyle), buttonStyle), cssVars), transition: transition, variants: variants, initial: initial, animate: animate, exit: exit, onClick: handleClick }, rest, { children: [!playing && iconLeft && (jsxRuntime.jsx("div", { className: css.icon, children: jsxRuntime.jsx(_types.Icon, { name: iconLeft, size: sizingStyles[size].iconSize, strokeColor: iconStrokeColor, pointer: state !== 'disabled' }) })), playing && iconLeft && (jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, { show: playing, didStop: handleDidStop, duration: duration, size: sizingStyles[size].iconSize, color: progressColor, inline: true })), playing && !iconLeft && !iconRight && (jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, { show: playing, didStop: handleDidStop, duration: duration, size: sizingStyles[size].iconSize, color: progressColor, inline: false })), shouldShowLabel && (jsxRuntime.jsx("div", { className: `${css.label} ${css[labelSize]}`, children: label })), playing && iconRight && (jsxRuntime.jsx(ProgressIndicator.ProgressIndicator, { show: playing, didStop: handleDidStop, duration: duration, size: sizingStyles[size].iconSize, color: progressColor, inline: true })), !playing && iconRight && (jsxRuntime.jsx("div", { className: css.icon, children: jsxRuntime.jsx(_types.Icon, { name: iconRight, size: sizingStyles[size].iconSize, strokeColor: iconStrokeColor, pointer: state !== 'disabled' }) })), jsxRuntime.jsx(Dot.Dot, { show: !playing && showDot }), !playing && count && (jsxRuntime.jsx("div", { className: css.count, children: jsxRuntime.jsx(Badge.Badge, { variant: 'light', count: Number(count) }) }))] })));
|
|
313
|
+
});
|
|
314
|
+
UIButtonComponent.displayName = 'UIButton';
|
|
315
|
+
const UIButton = React.memo(UIButtonComponent);
|
|
316
|
+
|
|
317
|
+
exports.UIButton = UIButton;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var hooks_useTheme = require('../hooks/useTheme.js');
|
|
7
|
+
require('../theme/colors.js');
|
|
8
|
+
require('../hooks/useWindow.js');
|
|
9
|
+
var IconButton = require('./IconButton-BfsPlKTb.js');
|
|
10
|
+
var styleInject_es = require('./style-inject.es-XZHJH68X.js');
|
|
11
|
+
|
|
12
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UIButtonBar-module_wrapper__8z-P8 {\n}\n\n.UIButtonBar-module_label__w6ru4 {\n\tcolor: var(--core-text-disabled);\n\tpadding-right: 4px;\n}\n\n.UIButtonBar-module_button__CeXO1 {\n\theight: 32px;\n\tgap: 0;\n\tcursor: pointer;\n\tbackground: var(--core-surface-primary);\n\tcolor: var(--core-text-disabled);\n\t&:last-child {\n\t\t&:hover {\n\t\t\tbackground: var(--core-surface-primary);\n\t\t}\n\t}\n\t&:first-child {\n\t\t&:hover {\n\t\t\tbackground: var(--core-surface-primary);\n\t\t}\n\t}\n\t&:hover {\n\t\tbackground: var(--core-surface-primary);\n\t\tcolor: var(--core-text-primary);\n\t}\n}\n\n.UIButtonBar-module_selected__I7geu {\n\tbackground: var(--core-surface-primary);\n\tcolor: var(--core-link-primary);\n}\n\n.UIButtonBar-module_divider__E03Ym {\n\tdisplay: block;\n\tbackground: var(--core-outline-primary);\n\twidth: 1px;\n\theight: 16px;\n\tmargin: 0 4px;\n}\n\n.UIButtonBar-module_last__0vvyg {\n\tdisplay: none;\n}\n";
|
|
13
|
+
var css = {"wrapper":"UIButtonBar-module_wrapper__8z-P8 flexBox-module_rowStart__nJZnW","label":"UIButtonBar-module_label__w6ru4 flexBox-module_rowStart__nJZnW type-module_body-s-regular__8-FO-","button":"UIButtonBar-module_button__CeXO1 flexBox-module_rowStart__nJZnW","selected":"UIButtonBar-module_selected__I7geu","divider":"UIButtonBar-module_divider__E03Ym","last":"UIButtonBar-module_last__0vvyg"};
|
|
14
|
+
styleInject_es.styleInject(css_248z);
|
|
15
|
+
|
|
16
|
+
function UIButtonBar(props) {
|
|
17
|
+
const { options = [], current = 0, label, onChange = () => null, onToolTip = () => null } = props, divAttributes = tslib_es6.__rest(props, ["options", "current", "label", "onChange", "onToolTip"]);
|
|
18
|
+
const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
|
|
19
|
+
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
20
|
+
const divClass = className ? ` ${className}` : '';
|
|
21
|
+
const theme = hooks_useTheme.useTheme();
|
|
22
|
+
const [hovered, setHovered] = React.useState(-1);
|
|
23
|
+
const [currentPage, setCurrentPage] = React.useState(current);
|
|
24
|
+
React.useEffect(() => setCurrentPage(current), [current]);
|
|
25
|
+
const handleMouseEnter = React.useCallback((index) => {
|
|
26
|
+
setHovered(index);
|
|
27
|
+
}, []);
|
|
28
|
+
const handleMouseLeave = React.useCallback(() => {
|
|
29
|
+
setHovered(-1);
|
|
30
|
+
}, []);
|
|
31
|
+
const handleClick = React.useCallback((button, index) => {
|
|
32
|
+
setCurrentPage(index);
|
|
33
|
+
onChange(button);
|
|
34
|
+
}, [onChange]);
|
|
35
|
+
// memo display
|
|
36
|
+
const display = React.useCallback((index) => {
|
|
37
|
+
return index === options.length - 1 ? css.last : '';
|
|
38
|
+
}, [options.length]);
|
|
39
|
+
// memo selected
|
|
40
|
+
const selected = React.useCallback((index) => {
|
|
41
|
+
return currentPage === index ? css.selected : '';
|
|
42
|
+
}, [currentPage]);
|
|
43
|
+
// memo icon stroke color
|
|
44
|
+
const iconColor = React.useCallback((index) => {
|
|
45
|
+
const isSelected = currentPage === index;
|
|
46
|
+
const isHovered = hovered === index;
|
|
47
|
+
if (isSelected)
|
|
48
|
+
return theme.current.colors['core-icon-primary'];
|
|
49
|
+
if (isHovered)
|
|
50
|
+
return theme.current.colors['core-button-primary'];
|
|
51
|
+
return theme.current.colors['core-text-disabled'];
|
|
52
|
+
}, [currentPage, hovered, theme]);
|
|
53
|
+
return (jsxRuntime.jsxs("div", Object.assign({ id: divId, className: `${css.wrapper}${divClass}`, style: divStyle }, rest, { children: [label && jsxRuntime.jsx("div", { className: css.label, children: label }), options === null || options === void 0 ? void 0 : options.map((button, index) => {
|
|
54
|
+
return (jsxRuntime.jsxs("div", { className: css.button, onMouseEnter: () => handleMouseEnter(index), onMouseLeave: () => handleMouseLeave(), children: [jsxRuntime.jsx("div", { className: selected(index), onClick: () => handleClick(button, index), onKeyDown: () => handleClick(button, index), children: jsxRuntime.jsx(IconButton.IconButton, { icon: button.icon, color: iconColor(index), label: button.label, tooltip: button.tip, onToolTip: onToolTip, hover: true, toggle: false }) }), jsxRuntime.jsx("div", { className: `${css.divider} ${display(index)}` })] }, `button-bar-${button.icon}-${index}`));
|
|
55
|
+
})] })));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.UIButtonBar = UIButtonBar;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var _types = require('./_types-CoWzQFsT.js');
|
|
7
|
+
var styleInject_es = require('./style-inject.es-XZHJH68X.js');
|
|
8
|
+
|
|
9
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UICard-module_card__ENpS- {\n\tpadding: 8px 14px 8px 8px !important;\n\tcolor: var(--core-text-primary);\n\twidth: var(--card-width);\n\tmax-width: min-content;\n\tflex: var(--card-flex);\n\tgap: 8px;\n\tborder-radius: 8px;\n\tborder: 1px solid var(--core-outline-primary);\n\tcursor: pointer;\n\ttransition: all 0.25s ease-in-out 0s;\n\t&:hover {\n\t\tcolor: var(--core-button-primary);\n\t\tborder: 1px solid var(--core-button-primary);\n\t}\n}\n\n.UICard-module_icon__n4kmT {\n\tmin-width: 20px;\n\tmin-height: 20px;\n\tmax-width: 20px;\n\tmax-height: 20px;\n}\n\n.UICard-module_label__Ev9Fa {\n\tflex: 1;\n\tword-break: break-all;\n\ttext-overflow: ellipsis;\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\tdisplay: -webkit-box;\n\twhite-space: nowrap;\n\t-webkit-line-clamp: 1;\n\t-webkit-box-orient: vertical;\n}\n";
|
|
10
|
+
var css = {"card":"UICard-module_card__ENpS- flexBox-module_rowStart__nJZnW type-module_body-m-regular__Qtp5G","icon":"UICard-module_icon__n4kmT flexBox-module_row__PWxbe","label":"UICard-module_label__Ev9Fa"};
|
|
11
|
+
styleInject_es.styleInject(css_248z);
|
|
12
|
+
|
|
13
|
+
const UICard = React.memo(function UICard(props) {
|
|
14
|
+
const { id, icon, label, command, width, onCommand = () => null } = props, divAttributes = tslib_es6.__rest(props, ["id", "icon", "label", "command", "width", "onCommand"]);
|
|
15
|
+
const { className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["className", "style"]);
|
|
16
|
+
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
17
|
+
const divClass = className ? ` ${className}` : '';
|
|
18
|
+
// set style value callback
|
|
19
|
+
const setStyle = React.useCallback((value) => {
|
|
20
|
+
if (value === undefined || value === 'fill')
|
|
21
|
+
return 'unset';
|
|
22
|
+
if (typeof value === 'string')
|
|
23
|
+
return value;
|
|
24
|
+
return `${value}px`;
|
|
25
|
+
}, []);
|
|
26
|
+
// memo css vars
|
|
27
|
+
const cssVars = React.useMemo(() => {
|
|
28
|
+
return {
|
|
29
|
+
'--card-width': setStyle(width),
|
|
30
|
+
'--card-flex': width === 'fill' ? '1' : 'unset',
|
|
31
|
+
};
|
|
32
|
+
}, [setStyle, width]);
|
|
33
|
+
return (jsxRuntime.jsxs("div", Object.assign({ id: id, className: `${css.card}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), onClick: () => onCommand({ id, command }), onKeyDown: () => onCommand({ id, command }) }, rest, { children: [icon && (jsxRuntime.jsx("div", { className: css.icon, children: jsxRuntime.jsx(_types.Icon, { name: icon }) })), label && jsxRuntime.jsx("div", { className: css.label, children: label })] })));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
exports.UICard = UICard;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var hooks_useTheme = require('../hooks/useTheme.js');
|
|
7
|
+
require('../theme/colors.js');
|
|
8
|
+
require('../hooks/useWindow.js');
|
|
9
|
+
var _types = require('./_types-CoWzQFsT.js');
|
|
10
|
+
var sharedTypes = require('./sharedTypes-BvTjh6M5.js');
|
|
11
|
+
var styleInject_es = require('./style-inject.es-XZHJH68X.js');
|
|
12
|
+
|
|
13
|
+
var css_248z = ".flexBox-module_row__PWxbe {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__27lKK {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__nJZnW {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__dHcOU {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__MP2Xd {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__Kg8cV {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__zcmtk {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__157yI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__u2nwI {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__QWEzl {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__FxEAv {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__rf7AV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__8-FO- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__qyYq- {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__7GQ5Z {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__Qtp5G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__Ieh9K {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__0lZ3I {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__Ar4d3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__6tV1n {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__I8Q1v {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-bold__QFgN8 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-medium__jGIb2 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__tdBSi {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__-7Uyu {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__8hGYF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 560;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Cryjg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 650;\n\tfont-size: 28px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.UIChip-module_chip__Mlm-E {\n\tpadding: var(--ui-chip-padding) !important;\n\twidth: min-content;\n\tmin-height: 30px;\n\tgap: var(--ui-chip-gap);\n\tbackground: var(--ui-chip-background);\n\tline-height: 1em;\n\tcolor: var(--ui-chip-color);\n\tborder: var(--ui-chip-border) solid var(--ui-chip-border-color);\n\tborder-radius: var(--ui-chip-border-radius);\n\ttransition: all 0.25s ease-in-out 0s;\n\tcursor: pointer;\n\twhite-space: nowrap;\n\tuser-select: none;\n\t-webkit-user-select: none;\n}\n\n.UIChip-module_icon__T3CKh {\n\theight: var(--ui-chip-icon-size);\n\tmin-height: var(--ui-chip-icon-size);\n\twidth: var(--ui-chip-icon-size);\n\tmin-width: var(--ui-chip-icon-size);\n}\n\n.UIChip-module_s__xUUaz {\n}\n\n.UIChip-module_m__mNHBQ {\n}\n\n.UIChip-module_l__DWRA6 {\n}\n";
|
|
14
|
+
var css = {"chip":"UIChip-module_chip__Mlm-E flexBox-module_row__PWxbe","icon":"UIChip-module_icon__T3CKh flexBox-module_row__PWxbe","s":"UIChip-module_s__xUUaz type-module_body-s-regular__8-FO-","m":"UIChip-module_m__mNHBQ type-module_body-m-regular__Qtp5G","l":"UIChip-module_l__DWRA6 type-module_body-l-regular__Ar4d3"};
|
|
15
|
+
styleInject_es.styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
const UIChip = React.memo((props) => {
|
|
18
|
+
const { label, icon, background, disabled = false, focused = false, variant = 'regular', unframed = false, iconRight = false, labelSize = 'm', tooltip, iconColor, onToolTip = () => null, onClick = () => null, onMouseDown = () => null } = props, divAttributes = tslib_es6.__rest(props, ["label", "icon", "background", "disabled", "focused", "variant", "unframed", "iconRight", "labelSize", "tooltip", "iconColor", "onToolTip", "onClick", "onMouseDown"]);
|
|
19
|
+
const { id: divId, className, style } = divAttributes, rest = tslib_es6.__rest(divAttributes, ["id", "className", "style"]);
|
|
20
|
+
const divStyle = style !== null && style !== void 0 ? style : {};
|
|
21
|
+
const divClass = className ? ` ${className}` : '';
|
|
22
|
+
const theme = hooks_useTheme.useTheme();
|
|
23
|
+
const [isFocused, setIsFocused] = React.useState(focused);
|
|
24
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
25
|
+
React.useEffect(() => setIsFocused(focused), [focused]);
|
|
26
|
+
// click handler
|
|
27
|
+
const handleClick = React.useCallback((e) => {
|
|
28
|
+
if (!disabled)
|
|
29
|
+
onClick(e);
|
|
30
|
+
}, [disabled, onClick]);
|
|
31
|
+
// handle mouse down
|
|
32
|
+
const handleMouseDown = React.useCallback((e) => {
|
|
33
|
+
if (!disabled)
|
|
34
|
+
onMouseDown(e);
|
|
35
|
+
}, [disabled, onMouseDown]);
|
|
36
|
+
// handle mouse enter / leave
|
|
37
|
+
const handleMouseEnter = React.useCallback((enter, event) => {
|
|
38
|
+
if (enter) {
|
|
39
|
+
if (tooltip) {
|
|
40
|
+
const tip = {
|
|
41
|
+
type: sharedTypes.ToolTipType.button,
|
|
42
|
+
payload: { label: tooltip },
|
|
43
|
+
ref: null,
|
|
44
|
+
event,
|
|
45
|
+
};
|
|
46
|
+
onToolTip(tip);
|
|
47
|
+
}
|
|
48
|
+
setIsHovered(true);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
onToolTip(null);
|
|
52
|
+
setIsHovered(false);
|
|
53
|
+
}
|
|
54
|
+
}, [tooltip, onToolTip]);
|
|
55
|
+
// memo padding
|
|
56
|
+
const padding = React.useMemo(() => {
|
|
57
|
+
const isSmall = variant === 'small';
|
|
58
|
+
if (!icon) {
|
|
59
|
+
return isSmall ? '6px' : '9px 16px 9px 16px';
|
|
60
|
+
}
|
|
61
|
+
if (icon && iconRight) {
|
|
62
|
+
return isSmall ? '6px 6px 6px 10px' : '9px 12px 9px 16px';
|
|
63
|
+
}
|
|
64
|
+
return isSmall ? '6px 10px 6px 6px' : '9px 16px 9px 12px';
|
|
65
|
+
}, [variant, icon, iconRight]);
|
|
66
|
+
// memo icon color
|
|
67
|
+
const computedIconColor = React.useMemo(() => {
|
|
68
|
+
if (iconColor)
|
|
69
|
+
return iconColor;
|
|
70
|
+
if (disabled)
|
|
71
|
+
return theme.current.colors['core-icon-disabled'];
|
|
72
|
+
if (isHovered)
|
|
73
|
+
return theme.current.colors['core-link-primary'];
|
|
74
|
+
if (isFocused)
|
|
75
|
+
return theme.current.colors['core-link-primary'];
|
|
76
|
+
return theme.current.colors['core-text-primary'];
|
|
77
|
+
}, [iconColor, disabled, isFocused, isHovered, theme]);
|
|
78
|
+
// memo css vars
|
|
79
|
+
const cssVars = React.useMemo(() => {
|
|
80
|
+
return {
|
|
81
|
+
'--ui-chip-padding': padding,
|
|
82
|
+
'--ui-chip-background': background || 'transparent',
|
|
83
|
+
'--ui-chip-gap': variant === 'small' ? '4px' : '8px',
|
|
84
|
+
'--ui-chip-color': computedIconColor,
|
|
85
|
+
'--ui-chip-border-radius': variant === 'small' ? '4px' : '8px',
|
|
86
|
+
'--ui-chip-border': unframed ? '0' : '1px',
|
|
87
|
+
'--ui-chip-border-color': unframed ? 'transparent' : computedIconColor,
|
|
88
|
+
};
|
|
89
|
+
}, [padding, background, variant, unframed, computedIconColor]);
|
|
90
|
+
return (jsxRuntime.jsxs("div", Object.assign({ id: divId, className: `${css.chip}${divClass}`, style: Object.assign(Object.assign({}, divStyle), cssVars), onMouseDown: handleMouseDown, onKeyDown: () => null, onClick: handleClick, onMouseEnter: (e) => handleMouseEnter(true, e), onMouseLeave: (e) => handleMouseEnter(false, e), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false) }, rest, { children: [icon && !iconRight && (jsxRuntime.jsx("div", { className: css.icon, children: jsxRuntime.jsx(_types.Icon, { name: icon, size: variant === 'regular' ? 20 : 16, strokeColor: computedIconColor }) })), jsxRuntime.jsx("div", { className: css[labelSize], children: label }), icon && iconRight && (jsxRuntime.jsx("div", { className: css.icon, children: jsxRuntime.jsx(_types.Icon, { name: icon, size: variant === 'regular' ? 20 : 16, strokeColor: computedIconColor }) }))] })));
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
exports.UIChip = UIChip;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-4H29ixHs.js');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var hooks_useTheme = require('../hooks/useTheme.js');
|
|
7
|
+
require('../theme/colors.js');
|
|
8
|
+
require('../hooks/useWindow.js');
|
|
9
|
+
|
|
10
|
+
const UIFileIcon = React.memo((props) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const { name = 'document', size = 20, pointer = false, disabled = false, onClick = () => null } = props, svgAttributes = tslib_es6.__rest(props, ["name", "size", "pointer", "disabled", "onClick"]);
|
|
13
|
+
const { id: svgId, className, style } = svgAttributes, rest = tslib_es6.__rest(svgAttributes, ["id", "className", "style"]);
|
|
14
|
+
const theme = hooks_useTheme.useTheme();
|
|
15
|
+
const handleKeyDown = React.useCallback((e) => {
|
|
16
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
onClick(e);
|
|
19
|
+
}
|
|
20
|
+
}, [onClick]);
|
|
21
|
+
const FileIcon = React.useMemo(() => {
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
name: 'pdf',
|
|
25
|
+
icon: (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", style: {
|
|
26
|
+
cursor: disabled ? 'default' : pointer ? 'pointer' : 'inherit',
|
|
27
|
+
}, onClick: (e) => onClick(e), onKeyDown: handleKeyDown, tabIndex: pointer ? 0 : -1, fill: "none", role: "img", "aria-label": "PDF document icon", children: [jsxRuntime.jsx("title", { children: "PDF document" }), jsxRuntime.jsx("path", { d: "M 4.5 19 L 15.5 19 C 16.328 19 17 18.328 17 17.5 L 17 5 L 14.5 5 C 13.672 5 13 4.328 13 3.5 L 13 1 L 4.5 1 C 3.672 1 3 1.672 3 2.5 L 3 17.5 C 3 18.328 3.672 19 4.5 19 Z", fill: "rgb(250,15,0)" }), jsxRuntime.jsx("path", { d: "M 5.516 9.416 L 7.237 9.416 C 7.485 9.416 7.7 9.464 7.884 9.56 C 8.068 9.654 8.21 9.788 8.309 9.96 C 8.409 10.133 8.458 10.334 8.458 10.563 C 8.458 10.79 8.408 10.99 8.309 11.164 C 8.209 11.338 8.067 11.474 7.882 11.572 C 7.682 11.673 7.461 11.723 7.237 11.718 L 6.502 11.718 L 6.502 13 L 5.516 13 Z M 7.069 10.932 C 7.175 10.937 7.278 10.902 7.359 10.834 C 7.432 10.764 7.471 10.665 7.467 10.564 C 7.467 10.446 7.431 10.357 7.359 10.294 C 7.277 10.229 7.174 10.196 7.069 10.202 L 6.502 10.202 L 6.502 10.932 Z M 8.836 9.416 L 10.248 9.416 C 10.618 9.416 10.941 9.489 11.214 9.636 C 11.489 9.781 11.701 9.988 11.849 10.258 C 11.997 10.527 12.071 10.843 12.071 11.208 C 12.071 11.573 11.997 11.89 11.849 12.16 C 11.704 12.426 11.483 12.643 11.214 12.783 C 10.915 12.934 10.583 13.008 10.248 13 L 8.836 13 Z M 10.223 12.214 C 10.389 12.214 10.533 12.174 10.653 12.097 C 10.778 12.013 10.875 11.894 10.931 11.755 C 11 11.581 11.034 11.395 11.029 11.208 C 11.034 11.022 11.001 10.837 10.931 10.664 C 10.875 10.524 10.778 10.403 10.653 10.319 C 10.524 10.239 10.375 10.198 10.223 10.202 L 9.823 10.202 L 9.823 12.214 Z M 12.53 9.416 L 15.182 9.416 L 15.182 10.202 L 13.517 10.202 L 13.517 10.759 L 14.715 10.759 L 14.715 11.545 L 13.517 11.545 L 13.517 13 L 12.53 13 Z", fill: theme.current.colors['core-icon-light'] }), jsxRuntime.jsx("path", { d: "M 13 1 L 15 3 L 17 5 L 14 5 C 13.448 5 13 4.552 13 4 Z", fill: theme.current.coreColors['brand-purple-300'] })] })),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'spreadsheet',
|
|
31
|
+
icon: (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", style: {
|
|
32
|
+
cursor: disabled ? 'default' : pointer ? 'pointer' : 'inherit',
|
|
33
|
+
}, onClick: (e) => onClick(e), onKeyDown: handleKeyDown, tabIndex: pointer ? 0 : -1, fill: "none", role: "img", "aria-label": "Spreadsheet document icon", children: [jsxRuntime.jsx("title", { children: "Spreadsheet document" }), jsxRuntime.jsx("path", { d: "M 4.5 19 L 15.5 19 C 16.328 19 17 18.328 17 17.5 L 17 5 L 14.5 5 C 13.672 5 13 4.328 13 3.5 L 13 1 L 4.5 1 C 3.672 1 3 1.672 3 2.5 L 3 17.5 C 3 18.328 3.672 19 4.5 19 Z", fill: theme.current.coreColors['brand-land-700'] }), jsxRuntime.jsx("path", { d: "M 5 8 L 11 8 L 11 9.5 L 5 9.5 Z M 12 8 L 15 8 L 15 9.5 L 12 9.5 Z M 5 11 L 11 11 L 11 12.5 L 5 12.5 Z M 12 11 L 15 11 L 15 12.5 L 12 12.5 Z M 5 14 L 11 14 L 11 15.5 L 5 15.5 Z M 12 14 L 15 14 L 15 15.5 L 12 15.5 Z", fill: theme.current.colors['core-icon-light'] }), jsxRuntime.jsx("path", { d: "M 13 1 L 15 3 L 17 5 L 14 5 C 13.448 5 13 4.552 13 4 Z", fill: theme.current.coreColors['brand-purple-300'] })] })),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'document',
|
|
37
|
+
icon: (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", style: {
|
|
38
|
+
cursor: disabled ? 'default' : pointer ? 'pointer' : 'inherit',
|
|
39
|
+
}, onClick: (e) => onClick(e), onKeyDown: handleKeyDown, tabIndex: pointer ? 0 : -1, fill: "none", role: "img", "aria-label": "Document icon", children: [jsxRuntime.jsx("title", { children: "Document" }), jsxRuntime.jsx("path", { d: "M 4.5 19 L 15.5 19 C 16.328 19 17 18.328 17 17.5 L 17 5 L 14.5 5 C 13.672 5 13 4.328 13 3.5 L 13 1 L 4.5 1 C 3.672 1 3 1.672 3 2.5 L 3 17.5 C 3 18.328 3.672 19 4.5 19 Z", fill: theme.current.colors['core-badge-primary'] }), jsxRuntime.jsx("path", { d: "M 6 14 L 14 14 M 6 10 L 12 10", fill: "transparent", strokeWidth: "1.5", stroke: theme.current.colors['core-icon-light'], strokeMiterlimit: "10", strokeDasharray: "" }), jsxRuntime.jsx("path", { d: "M 13 1 L 15 3 L 17 5 L 14 5 C 13.448 5 13 4.552 13 4 Z", fill: theme.current.coreColors['brand-purple-300'] })] })),
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
}, [size, disabled, onClick, pointer, theme, handleKeyDown]);
|
|
43
|
+
// get the right icon in the array
|
|
44
|
+
const svgElement = FileIcon.filter((icon) => {
|
|
45
|
+
return icon.name.toLowerCase() === name.toLowerCase();
|
|
46
|
+
});
|
|
47
|
+
if (svgElement.length > 0) {
|
|
48
|
+
const iconNode = svgElement[0].icon;
|
|
49
|
+
return React.cloneElement(iconNode, Object.assign({ id: svgId, className, style: Object.assign(Object.assign({}, (style !== null && style !== void 0 ? style : {})), ((_b = (_a = iconNode.props) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {})), onClick: (e) => onClick(e) }, rest));
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
exports.UIFileIcon = UIFileIcon;
|