@gobolt/genesis 0.0.7 → 0.0.9
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/README.md +18 -2
- package/dist/{AntdIcon-Bsnbyy6g.js → AntdIcon-BoLh1dP8.js} +37 -35
- package/dist/CheckOutlined-CeTKr6II.js +13 -0
- package/dist/{CloseCircleFilled-ZIY-u-27.js → CloseCircleFilled-DXCxlIQL.js} +2 -2
- package/dist/CloseOutlined-ClXDNn82.js +13 -0
- package/dist/{Compact-CJBo3f0u.js → Compact-CGY560JF.js} +45 -53
- package/dist/{ContextIsolator-CGkdKtc3.js → ContextIsolator-D5x2Ih51.js} +2 -2
- package/dist/{ExclamationCircleFilled-BICVVQIg.js → ExclamationCircleFilled-C0Kj5KQV.js} +2 -2
- package/dist/{CheckOutlined-DAynWe12.js → KeyCode-DM2sFh3-.js} +10 -20
- package/dist/LoadingOutlined-8EnJdZ7I.js +13 -0
- package/dist/Overflow-PBZD-PFm.js +360 -0
- package/dist/PurePanel-BqPLRtc2.js +203 -0
- package/dist/SearchOutlined-BP3Z2K6j.js +13 -0
- package/dist/{TextArea-3MOYYuAQ.js → TextArea-DKwCct3i.js} +26 -16
- package/dist/Typography-aGoDUl4R.js +710 -0
- package/dist/bundle.css +1204 -0
- package/dist/{button-BNV2qdrP.js → button-CDQgO1OK.js} +200 -197
- package/dist/collapse-Dtpt-6W_.js +20 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.js +103 -0
- package/dist/components/Badge/__stories__/Badge.stories.d.ts +13 -0
- package/dist/components/Badge/__tests__/Badge.test.js +18 -0
- package/dist/components/Badge/icons/ASN.d.ts +2 -0
- package/dist/components/Badge/icons/ASN.js +23 -0
- package/dist/components/Badge/icons/Appointment.d.ts +2 -0
- package/dist/components/Badge/icons/Appointment.js +23 -0
- package/dist/components/Badge/icons/Inventory.d.ts +2 -0
- package/dist/components/Badge/icons/Inventory.js +23 -0
- package/dist/components/Badge/icons/Parcel.d.ts +2 -0
- package/dist/components/Badge/icons/Parcel.js +23 -0
- package/dist/components/Badge/icons/Product.d.ts +2 -0
- package/dist/components/Badge/icons/Product.js +23 -0
- package/dist/components/Badge/icons/Route.d.ts +2 -0
- package/dist/components/Badge/icons/Route.js +23 -0
- package/dist/components/Badge/icons/Shipment.d.ts +2 -0
- package/dist/components/Badge/icons/Shipment.js +23 -0
- package/dist/components/Badge/icons/ShoppingCart.d.ts +2 -0
- package/dist/components/Badge/icons/ShoppingCart.js +23 -0
- package/dist/components/Badge/icons/System.d.ts +2 -0
- package/dist/components/Badge/icons/System.js +23 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +4 -0
- package/dist/components/Badge/styles.d.ts +3 -0
- package/dist/components/Badge/styles.js +34 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +11 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +22 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/components/Breadcrumb/__stories__/Breadcrumb.stories.d.ts +10 -0
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +23 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.js +4 -0
- package/dist/components/Breadcrumb/styles.d.ts +27 -0
- package/dist/components/Breadcrumb/styles.js +2436 -0
- package/dist/components/Button/Button.d.ts +14 -0
- package/dist/components/Button/Button.js +22 -0
- package/dist/components/Button/__tests__/Button.test.js +16 -0
- package/dist/components/Button/styles.d.ts +16 -0
- package/dist/components/{atoms/button → Button}/styles.js +12 -12
- package/dist/components/{atoms/checkbox → Checkbox}/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +40 -0
- package/dist/components/{atoms/checkbox → Checkbox}/__tests__/Checkbox.test.js +1 -1
- package/dist/components/{atoms/checkbox → Checkbox}/styles.d.ts +5 -0
- package/dist/components/{atoms/checkbox → Checkbox}/styles.js +97 -96
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +8 -0
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +40 -0
- package/dist/components/ErrorBoundaryFallback/index.d.ts +2 -0
- package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/styles.js +22 -21
- package/dist/components/Form/Form.d.ts +26 -0
- package/dist/components/Form/Form.js +8 -0
- package/dist/components/Form/__stories__/FormStory.js +93 -0
- package/dist/components/Form/__tests__/form.test.d.ts +1 -0
- package/dist/components/Form/__tests__/form.test.js +18 -0
- package/dist/components/Form/index.js +4 -0
- package/dist/components/Form/styles.d.ts +3 -0
- package/dist/components/Form/styles.js +5 -0
- package/dist/components/{atoms/input → Input}/Input.d.ts +1 -3
- package/dist/components/Input/Input.js +19 -0
- package/dist/components/{atoms/input → Input}/__stories__/Input.stories.d.ts +5 -1
- package/dist/components/Input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/Input/__tests__/Input.test.js +24 -0
- package/dist/components/{atoms/input → Input}/styles.d.ts +2 -0
- package/dist/components/Input/styles.js +529 -0
- package/dist/components/Message/Message.d.ts +13 -0
- package/dist/components/Message/Message.js +78 -0
- package/dist/components/Message/__stories__/Message.stories.d.ts +15 -0
- package/dist/components/Message/__tests__/Message.test.d.ts +1 -0
- package/dist/components/Message/__tests__/Message.test.js +42 -0
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/Message/index.js +4 -0
- package/dist/components/Message/styles.d.ts +8 -0
- package/dist/components/Message/styles.js +41 -0
- package/dist/components/Notification/Notification.d.ts +17 -0
- package/dist/components/Notification/Notification.js +1370 -0
- package/dist/components/Notification/NotificationRightChevron.d.ts +2 -0
- package/dist/components/Notification/NotificationRightChevron.js +23 -0
- package/dist/components/Notification/__stories__/Notification.stories.d.ts +10 -0
- package/dist/components/Notification/__tests__/Notification.test.d.ts +1 -0
- package/dist/components/Notification/__tests__/Notification.test.js +15 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/Notification/index.js +4 -0
- package/dist/components/Notification/styles.d.ts +16 -0
- package/dist/components/Notification/styles.js +65 -0
- package/dist/components/Radio/Radio.d.ts +14 -0
- package/dist/components/Radio/Radio.js +28 -0
- package/dist/components/Radio/RadioGroup.d.ts +12 -0
- package/dist/components/Radio/RadioGroup.js +33 -0
- package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +9 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.d.ts +1 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.js +30 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +4 -0
- package/dist/components/Radio/states/RadioChecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioChecked.js +18 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.js +18 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.js +30 -0
- package/dist/components/Radio/states/RadioCheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedHover.js +18 -0
- package/dist/components/Radio/states/RadioUnchecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioUnchecked.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.js +29 -0
- package/dist/components/Radio/states/RadioUncheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedHover.js +18 -0
- package/dist/components/Select/DropdownChevron.d.ts +2 -0
- package/dist/components/Select/DropdownChevron.js +23 -0
- package/dist/components/Select/Select.d.ts +16 -0
- package/dist/components/Select/Select.js +36 -0
- package/dist/components/{atoms/select → Select}/__stories__/Select.stories.d.ts +3 -1
- package/dist/components/Select/__tests__/Select.test.d.ts +1 -0
- package/dist/components/{atoms/select → Select}/__tests__/Select.test.js +1165 -1140
- package/dist/components/Select/styles.d.ts +32 -0
- package/dist/components/{atoms/select → Select}/styles.js +1517 -1651
- package/dist/components/Toast/Toast.d.ts +14 -0
- package/dist/components/Toast/Toast.js +19 -0
- package/dist/components/Toast/__stories__/Toast.stories.d.ts +16 -0
- package/dist/components/Toast/__tests__/Toast.test.d.ts +1 -0
- package/dist/components/Toast/__tests__/Toast.test.js +18 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +4 -0
- package/dist/components/Toast/styles.d.ts +10 -0
- package/dist/components/Toast/styles.js +54 -0
- package/dist/components/Typography/Typography.d.ts +15 -0
- package/dist/components/Typography/Typography.js +8 -0
- package/dist/components/{atoms/typography → Typography}/__stories__/Typography.stories.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +23 -0
- package/dist/components/Typography/index.js +4 -0
- package/dist/components/Typography/styles.d.ts +21 -0
- package/dist/components/Typography/styles.js +48 -0
- package/dist/components/index.d.ts +26 -14
- package/dist/components/index.js +23 -13
- package/dist/constants/index.d.ts +104 -0
- package/dist/constants/index.js +41 -7
- package/dist/{context-CZsFJmh6.js → context-BMW3aJEf.js} +162 -161
- package/dist/genesis/GenesisThemeBreakdown.js +54 -24
- package/dist/genesis/GenesisThemeDemo.d.ts +0 -2
- package/dist/genesis/GenesisThemeDemo.js +3 -4
- package/dist/genesis/styles.js +1095 -2186
- package/dist/{index-C7kFNqp2.js → index-1CBpubM3.js} +36 -36
- package/dist/{index-3MWkSVA1.js → index-BZAhCB_K.js} +6 -5
- package/dist/{index-D1v_7IIx.js → index-C0SmxWLS.js} +95 -94
- package/dist/index-C8haFnXI.js +1112 -0
- package/dist/{index-VDH3iLaC.js → index-CfDY25LP.js} +298 -309
- package/dist/{index-SAAXFt-P.js → index-DPW8XdWj.js} +255 -249
- package/dist/{index-BQO27mgE.js → index-bKlRxQp4.js} +52 -51
- package/dist/index-oK7z6jnz.js +22795 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +31 -18
- package/dist/{isVisible-CNQjrJPN.js → isVisible-A-IfeFoT.js} +34 -33
- package/dist/{magic-string.es-BkUFmFT4.js → magic-string.es-D2FWSwU3.js} +1 -1
- package/dist/{SearchOutlined-DuzJkIiQ.js → pickAttrs-B0YTfcV1.js} +16 -26
- package/dist/providers/GenesisProvider.js +9 -5
- package/dist/providers/ThemeProvider.d.ts +2 -2
- package/dist/providers/ThemeProvider.js +4 -1
- package/dist/providers/ToastProvider.d.ts +13 -0
- package/dist/providers/ToastProvider.js +20 -0
- package/dist/providers/__stories__/GenesisProvider.stories.d.ts +6 -0
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +4 -4
- package/dist/providers/useGenesis.d.ts +7 -0
- package/dist/providers/useGenesis.js +6 -0
- package/dist/{setup-CMYVZCPF.js → setup-BvfREoHl.js} +6948 -6940
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +22 -16
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +21 -15
- package/dist/styles/design-tokens/{typography → typography-tokens}/TypographyTokens.stories.d.ts +1 -0
- package/dist/styles/design-tokens/variables.d.ts +17 -17
- package/dist/styles/design-tokens/variables.js +48 -48
- package/dist/styles/global-styles.d.ts +1 -0
- package/dist/styles/global-styles.js +13 -29
- package/dist/styles/theme/genesis-theme.d.ts +3 -0
- package/dist/styles/theme/genesis-theme.js +461 -277
- package/dist/styles/theme/genesis-theme.types.d.ts +46 -0
- package/dist/{Form-Cylpi4M4.js → styles-CT_fyXBd.js} +417 -424
- package/dist/test/setup.js +2 -1
- package/dist/useLocale-DT-z_vQ6.js +16 -0
- package/dist/{useVariants-CEpw6Ww6.js → useVariants-DvhXfgJY.js} +9 -8
- package/dist/warning-C63HNL9U.js +789 -0
- package/package.json +10 -4
- package/dist/Overflow-CP1M4Z0s.js +0 -369
- package/dist/components/atoms/button/Button.d.ts +0 -12
- package/dist/components/atoms/button/Button.js +0 -27
- package/dist/components/atoms/button/styles.d.ts +0 -12
- package/dist/components/atoms/checkbox/Checkbox.js +0 -13
- package/dist/components/atoms/index.d.ts +0 -1
- package/dist/components/atoms/index.js +0 -3
- package/dist/components/atoms/input/Input.js +0 -12
- package/dist/components/atoms/input/__tests__/Input.test.js +0 -28
- package/dist/components/atoms/input/styles.js +0 -415
- package/dist/components/atoms/select/Select.d.ts +0 -11
- package/dist/components/atoms/select/Select.js +0 -24
- package/dist/components/atoms/select/styles.d.ts +0 -15
- package/dist/components/atoms/typography/Typography.d.ts +0 -11
- package/dist/components/atoms/typography/Typography.js +0 -44
- package/dist/components/atoms/typography/__tests__/Typography.test.js +0 -16
- package/dist/components/atoms/typography/index.js +0 -4
- package/dist/components/atoms/typography/styles.d.ts +0 -11
- package/dist/components/atoms/typography/styles.js +0 -28
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.d.ts +0 -10
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +0 -35
- package/dist/components/molecules/error-boundary-fallback/index.d.ts +0 -1
- package/dist/components/molecules/form/Form.d.ts +0 -15
- package/dist/components/molecules/form/Form.js +0 -7
- package/dist/components/molecules/form/__stories__/FormStory.js +0 -90
- package/dist/components/molecules/form/index.js +0 -4
- package/dist/index-BPtFqhcp.js +0 -19110
- package/dist/index-BWys7dkb.js +0 -4462
- package/dist/styles/theme/global-styles.d.ts +0 -1
- package/dist/styles/theme/global-styles.js +0 -35
- /package/dist/components/{atoms/checkbox/__tests__/Checkbox.test.d.ts → Badge/__tests__/Badge.test.d.ts} +0 -0
- /package/dist/components/{atoms/input/__tests__/Input.test.d.ts → Breadcrumb/__tests__/Breadcrumb.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/__stories__/Button.stories.d.ts +0 -0
- /package/dist/components/{atoms/select/__tests__/Select.test.d.ts → Button/__tests__/Button.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/index.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/index.js +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/__stories__/Checkbox.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography/__tests__/Typography.test.d.ts → Checkbox/__tests__/Checkbox.test.d.ts} +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/index.d.ts +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/index.js +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/__stories__/ErrorBoundaryFallback.stories.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/index.js +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/styles.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/Form.stories.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/FormStory.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/index.d.ts +0 -0
- /package/dist/components/{atoms/input → Input}/index.d.ts +0 -0
- /package/dist/components/{atoms/input → Input}/index.js +0 -0
- /package/dist/components/{atoms/select → Select}/index.d.ts +0 -0
- /package/dist/components/{atoms/select → Select}/index.js +0 -0
- /package/dist/components/{atoms/typography → Typography}/index.d.ts +0 -0
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
import { d as pe } from "../../styled-components.browser.esm-CZ1XM4o4.js";
|
|
2
|
+
import { TYPE as oe, STATE as V } from "../../constants/index.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { useContext as ee, useMemo as me, useState as ge, useRef as Ce } from "react";
|
|
5
|
+
import { a as re, c as q } from "../../warning-C63HNL9U.js";
|
|
6
|
+
import { C as Q, v as se, g as be, m as ve, w as xe, b as ne, x as ye, D as he, t as ie } from "../../index-oK7z6jnz.js";
|
|
7
|
+
import { F as X, u as Oe } from "../../context-BMW3aJEf.js";
|
|
8
|
+
import { u as we, i as Ee, a as Pe, I as W, b as $e, T as Ie } from "../../TextArea-DKwCct3i.js";
|
|
9
|
+
import { p as Se } from "../../pickAttrs-B0YTfcV1.js";
|
|
10
|
+
import { g as _e } from "../../useVariants-DvhXfgJY.js";
|
|
11
|
+
import { a as ae, b as ze } from "../../Compact-CGY560JF.js";
|
|
12
|
+
import { I as ue } from "../../AntdIcon-BoLh1dP8.js";
|
|
13
|
+
import { o as Ne } from "../../isVisible-A-IfeFoT.js";
|
|
14
|
+
import { R as je } from "../../SearchOutlined-BP3Z2K6j.js";
|
|
15
|
+
import { c as te } from "../../reactNode-sKPeiqPL.js";
|
|
16
|
+
import { B as Me } from "../../button-CDQgO1OK.js";
|
|
17
|
+
var Re = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { tag: "path", attrs: { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, name: "eye-invisible", theme: "outlined" }, ke = function(o, r) {
|
|
18
|
+
return /* @__PURE__ */ s.createElement(ue, re({}, o, {
|
|
19
|
+
ref: r,
|
|
20
|
+
icon: Re
|
|
21
|
+
}));
|
|
22
|
+
}, le = /* @__PURE__ */ s.forwardRef(ke);
|
|
23
|
+
process.env.NODE_ENV !== "production" && (le.displayName = "EyeInvisibleOutlined");
|
|
24
|
+
var Ae = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, name: "eye", theme: "outlined" }, Be = function(o, r) {
|
|
25
|
+
return /* @__PURE__ */ s.createElement(ue, re({}, o, {
|
|
26
|
+
ref: r,
|
|
27
|
+
icon: Ae
|
|
28
|
+
}));
|
|
29
|
+
}, ce = /* @__PURE__ */ s.forwardRef(Be);
|
|
30
|
+
process.env.NODE_ENV !== "production" && (ce.displayName = "EyeOutlined");
|
|
31
|
+
const Te = (e) => {
|
|
32
|
+
const {
|
|
33
|
+
getPrefixCls: o,
|
|
34
|
+
direction: r
|
|
35
|
+
} = ee(Q), {
|
|
36
|
+
prefixCls: n,
|
|
37
|
+
className: t
|
|
38
|
+
} = e, a = o("input-group", n), b = o("input"), [d, x] = we(b), v = q(a, {
|
|
39
|
+
[`${a}-lg`]: e.size === "large",
|
|
40
|
+
[`${a}-sm`]: e.size === "small",
|
|
41
|
+
[`${a}-compact`]: e.compact,
|
|
42
|
+
[`${a}-rtl`]: r === "rtl"
|
|
43
|
+
}, x, t), f = ee(X), p = me(() => Object.assign(Object.assign({}, f), {
|
|
44
|
+
isFormItemInput: !1
|
|
45
|
+
}), [f]);
|
|
46
|
+
return process.env.NODE_ENV !== "production" && se("Input.Group").deprecated(!1, "Input.Group", "Space.Compact"), d(/* @__PURE__ */ s.createElement("span", {
|
|
47
|
+
className: v,
|
|
48
|
+
style: e.style,
|
|
49
|
+
onMouseEnter: e.onMouseEnter,
|
|
50
|
+
onMouseLeave: e.onMouseLeave,
|
|
51
|
+
onFocus: e.onFocus,
|
|
52
|
+
onBlur: e.onBlur
|
|
53
|
+
}, /* @__PURE__ */ s.createElement(X.Provider, {
|
|
54
|
+
value: p
|
|
55
|
+
}, e.children)));
|
|
56
|
+
}, Ve = (e) => {
|
|
57
|
+
const {
|
|
58
|
+
componentCls: o,
|
|
59
|
+
paddingXS: r
|
|
60
|
+
} = e;
|
|
61
|
+
return {
|
|
62
|
+
[o]: {
|
|
63
|
+
display: "inline-flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
flexWrap: "nowrap",
|
|
66
|
+
columnGap: r,
|
|
67
|
+
"&-rtl": {
|
|
68
|
+
direction: "rtl"
|
|
69
|
+
},
|
|
70
|
+
[`${o}-input`]: {
|
|
71
|
+
textAlign: "center",
|
|
72
|
+
paddingInline: e.paddingXXS
|
|
73
|
+
},
|
|
74
|
+
// ================= Size =================
|
|
75
|
+
[`&${o}-sm ${o}-input`]: {
|
|
76
|
+
paddingInline: e.calc(e.paddingXXS).div(2).equal()
|
|
77
|
+
},
|
|
78
|
+
[`&${o}-lg ${o}-input`]: {
|
|
79
|
+
paddingInline: e.paddingXS
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}, De = be(["Input", "OTP"], (e) => {
|
|
84
|
+
const o = ve(e, Ee(e));
|
|
85
|
+
return [Ve(o)];
|
|
86
|
+
}, Pe);
|
|
87
|
+
var Fe = function(e, o) {
|
|
88
|
+
var r = {};
|
|
89
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (r[n] = e[n]);
|
|
90
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, n = Object.getOwnPropertySymbols(e); t < n.length; t++)
|
|
91
|
+
o.indexOf(n[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[t]) && (r[n[t]] = e[n[t]]);
|
|
92
|
+
return r;
|
|
93
|
+
};
|
|
94
|
+
const Le = /* @__PURE__ */ s.forwardRef((e, o) => {
|
|
95
|
+
const {
|
|
96
|
+
value: r,
|
|
97
|
+
onChange: n,
|
|
98
|
+
onActiveChange: t,
|
|
99
|
+
index: a,
|
|
100
|
+
mask: b
|
|
101
|
+
} = e, d = Fe(e, ["value", "onChange", "onActiveChange", "index", "mask"]), x = r && typeof b == "string" ? b : r, v = (m) => {
|
|
102
|
+
n(a, m.target.value);
|
|
103
|
+
}, f = s.useRef(null);
|
|
104
|
+
s.useImperativeHandle(o, () => f.current);
|
|
105
|
+
const p = () => {
|
|
106
|
+
xe(() => {
|
|
107
|
+
var m;
|
|
108
|
+
const y = (m = f.current) === null || m === void 0 ? void 0 : m.input;
|
|
109
|
+
document.activeElement === y && y && y.select();
|
|
110
|
+
});
|
|
111
|
+
}, I = (m) => {
|
|
112
|
+
const {
|
|
113
|
+
key: y,
|
|
114
|
+
ctrlKey: M,
|
|
115
|
+
metaKey: R
|
|
116
|
+
} = m;
|
|
117
|
+
y === "ArrowLeft" ? t(a - 1) : y === "ArrowRight" ? t(a + 1) : y === "z" && (M || R) && m.preventDefault(), p();
|
|
118
|
+
}, P = (m) => {
|
|
119
|
+
m.key === "Backspace" && !r && t(a - 1), p();
|
|
120
|
+
};
|
|
121
|
+
return /* @__PURE__ */ s.createElement(W, Object.assign({
|
|
122
|
+
type: b === !0 ? "password" : "text"
|
|
123
|
+
}, d, {
|
|
124
|
+
ref: f,
|
|
125
|
+
value: x,
|
|
126
|
+
onInput: v,
|
|
127
|
+
onFocus: p,
|
|
128
|
+
onKeyDown: I,
|
|
129
|
+
onKeyUp: P,
|
|
130
|
+
onMouseDown: p,
|
|
131
|
+
onMouseUp: p
|
|
132
|
+
}));
|
|
133
|
+
});
|
|
134
|
+
var Ke = function(e, o) {
|
|
135
|
+
var r = {};
|
|
136
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (r[n] = e[n]);
|
|
137
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, n = Object.getOwnPropertySymbols(e); t < n.length; t++)
|
|
138
|
+
o.indexOf(n[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[t]) && (r[n[t]] = e[n[t]]);
|
|
139
|
+
return r;
|
|
140
|
+
};
|
|
141
|
+
function U(e) {
|
|
142
|
+
return (e || "").split("");
|
|
143
|
+
}
|
|
144
|
+
const Ge = /* @__PURE__ */ s.forwardRef((e, o) => {
|
|
145
|
+
const {
|
|
146
|
+
prefixCls: r,
|
|
147
|
+
length: n = 6,
|
|
148
|
+
size: t,
|
|
149
|
+
defaultValue: a,
|
|
150
|
+
value: b,
|
|
151
|
+
onChange: d,
|
|
152
|
+
formatter: x,
|
|
153
|
+
variant: v,
|
|
154
|
+
disabled: f,
|
|
155
|
+
status: p,
|
|
156
|
+
autoFocus: I,
|
|
157
|
+
mask: P,
|
|
158
|
+
type: m,
|
|
159
|
+
onInput: y,
|
|
160
|
+
inputMode: M
|
|
161
|
+
} = e, R = Ke(e, ["prefixCls", "length", "size", "defaultValue", "value", "onChange", "formatter", "variant", "disabled", "status", "autoFocus", "mask", "type", "onInput", "inputMode"]);
|
|
162
|
+
if (process.env.NODE_ENV !== "production") {
|
|
163
|
+
const i = se("Input.OTP");
|
|
164
|
+
process.env.NODE_ENV !== "production" && i(!(typeof P == "string" && P.length > 1), "usage", "`mask` prop should be a single character.");
|
|
165
|
+
}
|
|
166
|
+
const {
|
|
167
|
+
getPrefixCls: S,
|
|
168
|
+
direction: _
|
|
169
|
+
} = s.useContext(Q), w = S("otp", r), F = Se(R, {
|
|
170
|
+
aria: !0,
|
|
171
|
+
data: !0,
|
|
172
|
+
attr: !0
|
|
173
|
+
}), $ = Oe(w), [k, L, A] = De(w, $), h = ae((i) => t ?? i), z = s.useContext(X), N = _e(z.status, p), B = s.useMemo(() => Object.assign(Object.assign({}, z), {
|
|
174
|
+
status: N,
|
|
175
|
+
hasFeedback: !1,
|
|
176
|
+
feedbackIcon: null
|
|
177
|
+
}), [z, N]), E = s.useRef(null), O = s.useRef({});
|
|
178
|
+
s.useImperativeHandle(o, () => ({
|
|
179
|
+
focus: () => {
|
|
180
|
+
var i;
|
|
181
|
+
(i = O.current[0]) === null || i === void 0 || i.focus();
|
|
182
|
+
},
|
|
183
|
+
blur: () => {
|
|
184
|
+
var i;
|
|
185
|
+
for (let l = 0; l < n; l += 1)
|
|
186
|
+
(i = O.current[l]) === null || i === void 0 || i.blur();
|
|
187
|
+
},
|
|
188
|
+
nativeElement: E.current
|
|
189
|
+
}));
|
|
190
|
+
const K = (i) => x ? x(i) : i, [G, H] = s.useState(U(K(a || "")));
|
|
191
|
+
s.useEffect(() => {
|
|
192
|
+
b !== void 0 && H(U(b));
|
|
193
|
+
}, [b]);
|
|
194
|
+
const Y = ne((i) => {
|
|
195
|
+
H(i), y && y(i), d && i.length === n && i.every((l) => l) && i.some((l, c) => G[c] !== l) && d(i.join(""));
|
|
196
|
+
}), J = ne((i, l) => {
|
|
197
|
+
let c = ye(G);
|
|
198
|
+
for (let C = 0; C < i; C += 1)
|
|
199
|
+
c[C] || (c[C] = "");
|
|
200
|
+
l.length <= 1 ? c[i] = l : c = c.slice(0, i).concat(U(l)), c = c.slice(0, n);
|
|
201
|
+
for (let C = c.length - 1; C >= 0 && !c[C]; C -= 1)
|
|
202
|
+
c.pop();
|
|
203
|
+
const T = K(c.map((C) => C || " ").join(""));
|
|
204
|
+
return c = U(T).map((C, Z) => C === " " && !c[Z] ? c[Z] : C), c;
|
|
205
|
+
}), u = (i, l) => {
|
|
206
|
+
var c;
|
|
207
|
+
const T = J(i, l), C = Math.min(i + l.length, n - 1);
|
|
208
|
+
C !== i && T[i] !== void 0 && ((c = O.current[C]) === null || c === void 0 || c.focus()), Y(T);
|
|
209
|
+
}, g = (i) => {
|
|
210
|
+
var l;
|
|
211
|
+
(l = O.current[i]) === null || l === void 0 || l.focus();
|
|
212
|
+
}, j = {
|
|
213
|
+
variant: v,
|
|
214
|
+
disabled: f,
|
|
215
|
+
status: N,
|
|
216
|
+
mask: P,
|
|
217
|
+
type: m,
|
|
218
|
+
inputMode: M
|
|
219
|
+
};
|
|
220
|
+
return k(/* @__PURE__ */ s.createElement("div", Object.assign({}, F, {
|
|
221
|
+
ref: E,
|
|
222
|
+
className: q(w, {
|
|
223
|
+
[`${w}-sm`]: h === "small",
|
|
224
|
+
[`${w}-lg`]: h === "large",
|
|
225
|
+
[`${w}-rtl`]: _ === "rtl"
|
|
226
|
+
}, A, L)
|
|
227
|
+
}), /* @__PURE__ */ s.createElement(X.Provider, {
|
|
228
|
+
value: B
|
|
229
|
+
}, Array.from({
|
|
230
|
+
length: n
|
|
231
|
+
}).map((i, l) => {
|
|
232
|
+
const c = `otp-${l}`, T = G[l] || "";
|
|
233
|
+
return /* @__PURE__ */ s.createElement(Le, Object.assign({
|
|
234
|
+
ref: (C) => {
|
|
235
|
+
O.current[l] = C;
|
|
236
|
+
},
|
|
237
|
+
key: c,
|
|
238
|
+
index: l,
|
|
239
|
+
size: h,
|
|
240
|
+
htmlSize: 1,
|
|
241
|
+
className: `${w}-input`,
|
|
242
|
+
onChange: u,
|
|
243
|
+
value: T,
|
|
244
|
+
onActiveChange: g,
|
|
245
|
+
autoFocus: l === 0 && I
|
|
246
|
+
}, j));
|
|
247
|
+
}))));
|
|
248
|
+
});
|
|
249
|
+
var He = function(e, o) {
|
|
250
|
+
var r = {};
|
|
251
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (r[n] = e[n]);
|
|
252
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, n = Object.getOwnPropertySymbols(e); t < n.length; t++)
|
|
253
|
+
o.indexOf(n[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[t]) && (r[n[t]] = e[n[t]]);
|
|
254
|
+
return r;
|
|
255
|
+
};
|
|
256
|
+
const Ue = (e) => e ? /* @__PURE__ */ s.createElement(ce, null) : /* @__PURE__ */ s.createElement(le, null), Xe = {
|
|
257
|
+
click: "onClick",
|
|
258
|
+
hover: "onMouseOver"
|
|
259
|
+
}, de = /* @__PURE__ */ s.forwardRef((e, o) => {
|
|
260
|
+
const {
|
|
261
|
+
disabled: r,
|
|
262
|
+
action: n = "click",
|
|
263
|
+
visibilityToggle: t = !0,
|
|
264
|
+
iconRender: a = Ue
|
|
265
|
+
} = e, b = s.useContext(he), d = r ?? b, x = typeof t == "object" && t.visible !== void 0, [v, f] = ge(() => x ? t.visible : !1), p = Ce(null);
|
|
266
|
+
s.useEffect(() => {
|
|
267
|
+
x && f(t.visible);
|
|
268
|
+
}, [x, t]);
|
|
269
|
+
const I = $e(p), P = () => {
|
|
270
|
+
var h;
|
|
271
|
+
if (d)
|
|
272
|
+
return;
|
|
273
|
+
v && I();
|
|
274
|
+
const z = !v;
|
|
275
|
+
f(z), typeof t == "object" && ((h = t.onVisibleChange) === null || h === void 0 || h.call(t, z));
|
|
276
|
+
}, m = (h) => {
|
|
277
|
+
const z = Xe[n] || "", N = a(v), B = {
|
|
278
|
+
[z]: P,
|
|
279
|
+
className: `${h}-icon`,
|
|
280
|
+
key: "passwordIcon",
|
|
281
|
+
onMouseDown: (E) => {
|
|
282
|
+
E.preventDefault();
|
|
283
|
+
},
|
|
284
|
+
onMouseUp: (E) => {
|
|
285
|
+
E.preventDefault();
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
return /* @__PURE__ */ s.cloneElement(/* @__PURE__ */ s.isValidElement(N) ? N : /* @__PURE__ */ s.createElement("span", null, N), B);
|
|
289
|
+
}, {
|
|
290
|
+
className: y,
|
|
291
|
+
prefixCls: M,
|
|
292
|
+
inputPrefixCls: R,
|
|
293
|
+
size: S
|
|
294
|
+
} = e, _ = He(e, ["className", "prefixCls", "inputPrefixCls", "size"]), {
|
|
295
|
+
getPrefixCls: w
|
|
296
|
+
} = s.useContext(Q), F = w("input", R), $ = w("input-password", M), k = t && m($), L = q($, y, {
|
|
297
|
+
[`${$}-${S}`]: !!S
|
|
298
|
+
}), A = Object.assign(Object.assign({}, Ne(_, ["suffix", "iconRender", "visibilityToggle"])), {
|
|
299
|
+
type: v ? "text" : "password",
|
|
300
|
+
className: L,
|
|
301
|
+
prefixCls: F,
|
|
302
|
+
suffix: k
|
|
303
|
+
});
|
|
304
|
+
return S && (A.size = S), /* @__PURE__ */ s.createElement(W, Object.assign({
|
|
305
|
+
ref: ie(o, p)
|
|
306
|
+
}, A));
|
|
307
|
+
});
|
|
308
|
+
process.env.NODE_ENV !== "production" && (de.displayName = "Input.Password");
|
|
309
|
+
var qe = function(e, o) {
|
|
310
|
+
var r = {};
|
|
311
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && o.indexOf(n) < 0 && (r[n] = e[n]);
|
|
312
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var t = 0, n = Object.getOwnPropertySymbols(e); t < n.length; t++)
|
|
313
|
+
o.indexOf(n[t]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[t]) && (r[n[t]] = e[n[t]]);
|
|
314
|
+
return r;
|
|
315
|
+
};
|
|
316
|
+
const fe = /* @__PURE__ */ s.forwardRef((e, o) => {
|
|
317
|
+
const {
|
|
318
|
+
prefixCls: r,
|
|
319
|
+
inputPrefixCls: n,
|
|
320
|
+
className: t,
|
|
321
|
+
size: a,
|
|
322
|
+
suffix: b,
|
|
323
|
+
enterButton: d = !1,
|
|
324
|
+
addonAfter: x,
|
|
325
|
+
loading: v,
|
|
326
|
+
disabled: f,
|
|
327
|
+
onSearch: p,
|
|
328
|
+
onChange: I,
|
|
329
|
+
onCompositionStart: P,
|
|
330
|
+
onCompositionEnd: m
|
|
331
|
+
} = e, y = qe(e, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]), {
|
|
332
|
+
getPrefixCls: M,
|
|
333
|
+
direction: R
|
|
334
|
+
} = s.useContext(Q), S = s.useRef(!1), _ = M("input-search", r), w = M("input", n), {
|
|
335
|
+
compactSize: F
|
|
336
|
+
} = ze(_, R), $ = ae((u) => {
|
|
337
|
+
var g;
|
|
338
|
+
return (g = a ?? F) !== null && g !== void 0 ? g : u;
|
|
339
|
+
}), k = s.useRef(null), L = (u) => {
|
|
340
|
+
u != null && u.target && u.type === "click" && p && p(u.target.value, u, {
|
|
341
|
+
source: "clear"
|
|
342
|
+
}), I == null || I(u);
|
|
343
|
+
}, A = (u) => {
|
|
344
|
+
var g;
|
|
345
|
+
document.activeElement === ((g = k.current) === null || g === void 0 ? void 0 : g.input) && u.preventDefault();
|
|
346
|
+
}, h = (u) => {
|
|
347
|
+
var g, j;
|
|
348
|
+
p && p((j = (g = k.current) === null || g === void 0 ? void 0 : g.input) === null || j === void 0 ? void 0 : j.value, u, {
|
|
349
|
+
source: "input"
|
|
350
|
+
});
|
|
351
|
+
}, z = (u) => {
|
|
352
|
+
S.current || v || h(u);
|
|
353
|
+
}, N = typeof d == "boolean" ? /* @__PURE__ */ s.createElement(je, null) : null, B = `${_}-button`;
|
|
354
|
+
let E;
|
|
355
|
+
const O = d || {}, K = O.type && O.type.__ANT_BUTTON === !0;
|
|
356
|
+
K || O.type === "button" ? E = te(O, Object.assign({
|
|
357
|
+
onMouseDown: A,
|
|
358
|
+
onClick: (u) => {
|
|
359
|
+
var g, j;
|
|
360
|
+
(j = (g = O == null ? void 0 : O.props) === null || g === void 0 ? void 0 : g.onClick) === null || j === void 0 || j.call(g, u), h(u);
|
|
361
|
+
},
|
|
362
|
+
key: "enterButton"
|
|
363
|
+
}, K ? {
|
|
364
|
+
className: B,
|
|
365
|
+
size: $
|
|
366
|
+
} : {})) : E = /* @__PURE__ */ s.createElement(Me, {
|
|
367
|
+
className: B,
|
|
368
|
+
type: d ? "primary" : void 0,
|
|
369
|
+
size: $,
|
|
370
|
+
disabled: f,
|
|
371
|
+
key: "enterButton",
|
|
372
|
+
onMouseDown: A,
|
|
373
|
+
onClick: h,
|
|
374
|
+
loading: v,
|
|
375
|
+
icon: N
|
|
376
|
+
}, d), x && (E = [E, te(x, {
|
|
377
|
+
key: "addonAfter"
|
|
378
|
+
})]);
|
|
379
|
+
const G = q(_, {
|
|
380
|
+
[`${_}-rtl`]: R === "rtl",
|
|
381
|
+
[`${_}-${$}`]: !!$,
|
|
382
|
+
[`${_}-with-button`]: !!d
|
|
383
|
+
}, t), H = Object.assign(Object.assign({}, y), {
|
|
384
|
+
className: G,
|
|
385
|
+
prefixCls: w,
|
|
386
|
+
type: "search"
|
|
387
|
+
}), Y = (u) => {
|
|
388
|
+
S.current = !0, P == null || P(u);
|
|
389
|
+
}, J = (u) => {
|
|
390
|
+
S.current = !1, m == null || m(u);
|
|
391
|
+
};
|
|
392
|
+
return /* @__PURE__ */ s.createElement(W, Object.assign({
|
|
393
|
+
ref: ie(k, o),
|
|
394
|
+
onPressEnter: z
|
|
395
|
+
}, H, {
|
|
396
|
+
size: $,
|
|
397
|
+
onCompositionStart: Y,
|
|
398
|
+
onCompositionEnd: J,
|
|
399
|
+
addonAfter: E,
|
|
400
|
+
suffix: b,
|
|
401
|
+
onChange: L,
|
|
402
|
+
disabled: f
|
|
403
|
+
}));
|
|
404
|
+
});
|
|
405
|
+
process.env.NODE_ENV !== "production" && (fe.displayName = "Search");
|
|
406
|
+
const D = W;
|
|
407
|
+
D.Group = Te;
|
|
408
|
+
D.Search = fe;
|
|
409
|
+
D.TextArea = Ie;
|
|
410
|
+
D.Password = de;
|
|
411
|
+
D.OTP = Ge;
|
|
412
|
+
const Qe = (e, o, r) => {
|
|
413
|
+
const n = {
|
|
414
|
+
color: e.inputs.onsurface.active,
|
|
415
|
+
borderColor: e[oe.secondary].active.borderColor,
|
|
416
|
+
ringColor: e[o].focussed.ringColor
|
|
417
|
+
}, t = {
|
|
418
|
+
color: e.status.success.default,
|
|
419
|
+
borderColor: e.status.success.default,
|
|
420
|
+
ringColor: e.status.success.ringColor
|
|
421
|
+
}, a = {
|
|
422
|
+
color: e.status.error.default,
|
|
423
|
+
borderColor: e.status.error.default,
|
|
424
|
+
ringColor: e.status.error.ringColor
|
|
425
|
+
}, b = r !== V.error && r !== V.success && r !== V.filled ? {
|
|
426
|
+
color: e.inputs.onsurface.active,
|
|
427
|
+
backgroundColor: e.inputs.surface.active,
|
|
428
|
+
borderColor: e.inputs.surface.border,
|
|
429
|
+
ringColor: e[o][r].ringColor
|
|
430
|
+
} : null;
|
|
431
|
+
return {
|
|
432
|
+
filled: n,
|
|
433
|
+
error: a,
|
|
434
|
+
success: t,
|
|
435
|
+
themeState: b
|
|
436
|
+
}[((f) => [V.filled, V.error, V.success].includes(f) ? f : "themeState")(r)];
|
|
437
|
+
}, We = ({ colors: e, borderRadius: o, components: r }, n, t, a, b) => {
|
|
438
|
+
const d = Qe(e, n, t), x = (v, f) => f && !v ? `${o.BorderRadiusMd}px 0px 0px ${o.BorderRadiusMd}px` : v && !f ? `0px ${o.BorderRadiusMd}px ${o.BorderRadiusMd}px 0px` : "0px";
|
|
439
|
+
return `
|
|
440
|
+
&.ant-input {
|
|
441
|
+
font-family: 'Inter', sans-serif;
|
|
442
|
+
color: ${d.color};
|
|
443
|
+
border-color: ${d.borderColor};
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.ant-input-group & {
|
|
447
|
+
&:focus-within {
|
|
448
|
+
outline: none;
|
|
449
|
+
color: ${d.color};
|
|
450
|
+
box-shadow: none;
|
|
451
|
+
border-color: ${e[n].focussed.borderColor};
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.ant-input-group:focus-within {
|
|
456
|
+
outline: none;
|
|
457
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${e[n].focussed.ringColor};
|
|
458
|
+
border-radius: ${o.BorderRadiusMd}px;
|
|
459
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
460
|
+
|
|
461
|
+
/* Hide focus styles on inner input when parent is focused */
|
|
462
|
+
.ant-input:focus-within {
|
|
463
|
+
box-shadow: none;
|
|
464
|
+
border-radius: 0;
|
|
465
|
+
border-radius: ${x(a, b)};
|
|
466
|
+
border-color: #ddd;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/* Remove inner input focus styles when in a group */
|
|
471
|
+
.ant-input-group .ant-input:focus,
|
|
472
|
+
.ant-input-group .ant-input:focus-visible,
|
|
473
|
+
.ant-input-group .ant-input:focus-within {
|
|
474
|
+
outline: none;
|
|
475
|
+
box-shadow: none;
|
|
476
|
+
border-color: ${e[n].focussed.borderColor};
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* Single focus ring on group */
|
|
480
|
+
.ant-input-group:focus-within {
|
|
481
|
+
outline: none;
|
|
482
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${e[n].focussed.ringColor};
|
|
483
|
+
border-radius: ${o.BorderRadiusMd}px;
|
|
484
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/* Remove focus styles for standalone inputs */
|
|
488
|
+
&:not(.ant-input-group):focus-visible {
|
|
489
|
+
outline: none;
|
|
490
|
+
color: ${d.color};
|
|
491
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${e[n].focussed.ringColor};
|
|
492
|
+
border-radius: ${o.BorderRadiusMd}px;
|
|
493
|
+
border-color: ${e[n].focussed.borderColor};
|
|
494
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
&:not(.ant-input-group .ant-input):focus-visible {
|
|
498
|
+
outline: none;
|
|
499
|
+
color: ${d.color};
|
|
500
|
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${e[n].focussed.ringColor};
|
|
501
|
+
border-radius: ${o.BorderRadiusMd}px;
|
|
502
|
+
border-color: ${e[n].focussed.borderColor};
|
|
503
|
+
transition: box-shadow 0.2s ease-in-out;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
&.ant-input-group-wrapper {
|
|
507
|
+
.ant-input-group-addon {
|
|
508
|
+
padding-left: ${r.input.suffixPrefixHorPadding};
|
|
509
|
+
padding-right: ${r.input.suffixPrefixHorPadding};
|
|
510
|
+
padding-top: ${r.input.suffixPrefixVerPadding};
|
|
511
|
+
padding-bottom: ${r.input.suffixPrefixVerPadding};
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
`;
|
|
515
|
+
}, pn = pe(D)`
|
|
516
|
+
${({ theme: e, state: o, type: r = oe.primary, ...n }) => {
|
|
517
|
+
const t = !!n.addonBefore, a = !!n.addonAfter;
|
|
518
|
+
return We(
|
|
519
|
+
e,
|
|
520
|
+
r,
|
|
521
|
+
o,
|
|
522
|
+
t,
|
|
523
|
+
a
|
|
524
|
+
);
|
|
525
|
+
}}
|
|
526
|
+
`;
|
|
527
|
+
export {
|
|
528
|
+
pn as Input
|
|
529
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { STATE, SIZE } from '../../constants';
|
|
2
|
+
|
|
3
|
+
export interface MessageProps {
|
|
4
|
+
state: keyof typeof STATE;
|
|
5
|
+
message: string;
|
|
6
|
+
action?: {
|
|
7
|
+
label?: string;
|
|
8
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
};
|
|
10
|
+
size?: Extract<keyof typeof SIZE, "small" | "standard">;
|
|
11
|
+
}
|
|
12
|
+
declare const Message: ({ state, message, action, size, }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default Message;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { TYPOGRAPHY_VARIANT as f, STATE as s, SIZE as m } from "../../constants/index.js";
|
|
3
|
+
import { n as p } from "../../styled-components.browser.esm-CZ1XM4o4.js";
|
|
4
|
+
import "../Badge/styles.js";
|
|
5
|
+
import "../Breadcrumb/styles.js";
|
|
6
|
+
import "../../providers/ThemeProvider.js";
|
|
7
|
+
import { a as u, R as g, b as d, c as I, d as R, e as y } from "../../Typography-aGoDUl4R.js";
|
|
8
|
+
import "../Button/styles.js";
|
|
9
|
+
import "../Checkbox/styles.js";
|
|
10
|
+
import "../ErrorBoundaryFallback/styles.js";
|
|
11
|
+
import "../Input/styles.js";
|
|
12
|
+
import "../Notification/styles.js";
|
|
13
|
+
import "react";
|
|
14
|
+
import "../Select/styles.js";
|
|
15
|
+
import "../Toast/styles.js";
|
|
16
|
+
import { MessageRow as T, MessageContent as w, ActionButton as h } from "./styles.js";
|
|
17
|
+
const x = (o, r) => {
|
|
18
|
+
switch (o) {
|
|
19
|
+
case s.error:
|
|
20
|
+
return r.colors.status.error.onsurface;
|
|
21
|
+
case s.success:
|
|
22
|
+
return r.colors.status.success.onsurface;
|
|
23
|
+
case s.warning:
|
|
24
|
+
return r.colors.status.warning.onsurface;
|
|
25
|
+
case s.generic:
|
|
26
|
+
return r.colors.status.generic.onsurface;
|
|
27
|
+
case s.info:
|
|
28
|
+
default:
|
|
29
|
+
return r.colors.status.info.onsurface;
|
|
30
|
+
}
|
|
31
|
+
}, A = (o, r) => {
|
|
32
|
+
switch (o) {
|
|
33
|
+
case s.warning:
|
|
34
|
+
return /* @__PURE__ */ e(y, { style: { color: r } });
|
|
35
|
+
case s.error:
|
|
36
|
+
return /* @__PURE__ */ e(R, { style: { color: r } });
|
|
37
|
+
case s.success:
|
|
38
|
+
return /* @__PURE__ */ e(I, { style: { color: r } });
|
|
39
|
+
case s.generic:
|
|
40
|
+
return /* @__PURE__ */ e(d, { style: { color: r } });
|
|
41
|
+
case s.info:
|
|
42
|
+
default:
|
|
43
|
+
return /* @__PURE__ */ e(g, { style: { color: r } });
|
|
44
|
+
}
|
|
45
|
+
}, V = ({
|
|
46
|
+
state: o = s.info,
|
|
47
|
+
message: r,
|
|
48
|
+
action: t,
|
|
49
|
+
size: l = m.standard
|
|
50
|
+
}) => {
|
|
51
|
+
const n = p(), c = x(o, n), a = f.message;
|
|
52
|
+
return /* @__PURE__ */ i(T, { state: o, size: l, children: [
|
|
53
|
+
/* @__PURE__ */ i(w, { children: [
|
|
54
|
+
A(o, c),
|
|
55
|
+
/* @__PURE__ */ e(
|
|
56
|
+
u,
|
|
57
|
+
{
|
|
58
|
+
variant: a,
|
|
59
|
+
color: c,
|
|
60
|
+
isText: !0,
|
|
61
|
+
children: r
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
] }),
|
|
65
|
+
t ? /* @__PURE__ */ e(h, { onClick: t.onClick, children: /* @__PURE__ */ e(
|
|
66
|
+
u,
|
|
67
|
+
{
|
|
68
|
+
variant: a,
|
|
69
|
+
color: n.colors.interactive.link.active,
|
|
70
|
+
isText: !0,
|
|
71
|
+
children: t.label
|
|
72
|
+
}
|
|
73
|
+
) }) : null
|
|
74
|
+
] });
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
V as default
|
|
78
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Message } from '../Message';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof Message>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof Message>;
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
export declare const SuccessMessage: Story;
|
|
9
|
+
export declare const ErrorMessage: Story;
|
|
10
|
+
export declare const InfoMessage: Story;
|
|
11
|
+
export declare const WarningMessage: Story;
|
|
12
|
+
export declare const GenericMessage: Story;
|
|
13
|
+
export declare const LongWarningMessage: Story;
|
|
14
|
+
export declare const NoAction: Story;
|
|
15
|
+
export declare const SmallSize: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { v as r, f as a, a as i } from "../../../setup-BvfREoHl.js";
|
|
3
|
+
import m from "../Message.js";
|
|
4
|
+
import { STATE as s } from "../../../constants/index.js";
|
|
5
|
+
describe("<Message />", () => {
|
|
6
|
+
const t = (e) => i(/* @__PURE__ */ c(m, { ...e }));
|
|
7
|
+
it("should render message text correctly", () => {
|
|
8
|
+
const { getByText: e } = t({
|
|
9
|
+
message: "Test message",
|
|
10
|
+
state: s.info
|
|
11
|
+
});
|
|
12
|
+
expect(e("Test message")).toBeInTheDocument();
|
|
13
|
+
}), it("should render success state correctly", () => {
|
|
14
|
+
const { getByText: e } = t({
|
|
15
|
+
message: "Success message",
|
|
16
|
+
state: s.success
|
|
17
|
+
});
|
|
18
|
+
expect(e("Success message")).toBeInTheDocument();
|
|
19
|
+
}), it("should render error state correctly", () => {
|
|
20
|
+
const { getByText: e } = t({
|
|
21
|
+
message: "Error message",
|
|
22
|
+
state: s.error
|
|
23
|
+
});
|
|
24
|
+
expect(e("Error message")).toBeInTheDocument();
|
|
25
|
+
}), it("should render action button when action prop is provided", () => {
|
|
26
|
+
const e = r.fn(), { getByText: o } = t({
|
|
27
|
+
message: "Message with action",
|
|
28
|
+
state: s.info,
|
|
29
|
+
action: {
|
|
30
|
+
label: "Click me",
|
|
31
|
+
onClick: e
|
|
32
|
+
}
|
|
33
|
+
}), n = o("Click me");
|
|
34
|
+
expect(n).toBeInTheDocument(), a.click(n), expect(e).toHaveBeenCalled();
|
|
35
|
+
}), it("should not render action button when action prop is not provided", () => {
|
|
36
|
+
const { container: e } = t({
|
|
37
|
+
message: "Message without action",
|
|
38
|
+
state: s.info
|
|
39
|
+
}), o = e.querySelector("button");
|
|
40
|
+
expect(o).not.toBeInTheDocument();
|
|
41
|
+
});
|
|
42
|
+
});
|