chop-logic-components 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -7
- package/dist/components/atoms/button/Button.css +1 -1
- package/dist/components/atoms/button/Button2.js +51 -0
- package/dist/components/atoms/button/icon-button/IconButton.css +1 -1
- package/dist/components/atoms/button/icon-button/IconButton2.js +18 -0
- package/dist/components/atoms/button/inner-button/InnerButton.css +1 -1
- package/dist/components/atoms/button/inner-button/InnerButton2.js +21 -0
- package/dist/components/atoms/button/primary-button/PrimaryButton.css +1 -1
- package/dist/components/atoms/button/primary-button/PrimaryButton2.js +20 -0
- package/dist/components/atoms/button/secondary-button/SecondaryButton.css +1 -1
- package/dist/components/atoms/button/secondary-button/SecondaryButton2.js +20 -0
- package/dist/components/atoms/editable-text/EditView.js +18 -37
- package/dist/components/atoms/editable-text/EditableText.css +1 -1
- package/dist/components/atoms/editable-text/EditableText2.js +53 -0
- package/dist/components/atoms/editable-text/ReadView.js +16 -25
- package/dist/components/atoms/editable-text/useEditModeState.js +16 -16
- package/dist/components/atoms/editable-text/useInputFocus.js +13 -8
- package/dist/components/atoms/editable-text/useValueState.js +20 -20
- package/dist/components/atoms/error-message/ErrorMessage.css +1 -1
- package/dist/components/atoms/error-message/ErrorMessage2.js +18 -0
- package/dist/components/atoms/header/Header.css +1 -1
- package/dist/components/atoms/header/Header2.js +23 -0
- package/dist/components/atoms/icon/Icon.css +1 -1
- package/dist/components/atoms/icon/Icon2.js +25 -0
- package/dist/components/atoms/image/BasicImage.js +15 -27
- package/dist/components/atoms/image/FallBackImage.js +16 -10
- package/dist/components/atoms/image/Image.css +1 -1
- package/dist/components/atoms/image/Image2.js +28 -0
- package/dist/components/atoms/image/ResponsivePicture.js +13 -17
- package/dist/components/atoms/input/Input.css +1 -1
- package/dist/components/atoms/input/Input2.js +13 -0
- package/dist/components/atoms/label/Label.css +1 -1
- package/dist/components/atoms/label/Label2.js +35 -0
- package/dist/components/atoms/link/Link.css +1 -1
- package/dist/components/atoms/link/Link2.js +36 -0
- package/dist/components/atoms/portal/Portal.js +10 -10
- package/dist/components/atoms/tooltip/Tooltip.controller.js +42 -34
- package/dist/components/atoms/tooltip/Tooltip.css +1 -1
- package/dist/components/atoms/tooltip/Tooltip2.js +49 -0
- package/dist/components/contexts/form/FormContext.js +5 -5
- package/dist/components/contexts/theme/ThemeContext.js +6 -9
- package/dist/components/contexts/theme/ThemeProvider.js +23 -20
- package/dist/components/hocs/with-error-boundary/index.js +2 -0
- package/dist/components/hocs/with-error-boundary/with-error-boundary.js +32 -0
- package/dist/components/hocs/with-figure-caption/Figure.css +1 -1
- package/dist/components/hocs/with-figure-caption/with-figure-caption.js +13 -10
- package/dist/components/hocs/with-tooltip/with-tooltip.js +10 -6
- package/dist/components/molecules/accordion/Accordion.css +1 -1
- package/dist/components/molecules/accordion/Accordion2.js +11 -0
- package/dist/components/molecules/accordion/AccordionItem.css +1 -1
- package/dist/components/molecules/accordion/AccordionItem2.js +24 -0
- package/dist/components/molecules/alert/Alert.css +1 -1
- package/dist/components/molecules/alert/Alert.helpers.js +24 -38
- package/dist/components/molecules/alert/Alert2.js +63 -0
- package/dist/components/molecules/alert/AlertProgressBar.js +10 -13
- package/dist/components/molecules/breadcrumbs/BreadcrumbItem.js +29 -27
- package/dist/components/molecules/breadcrumbs/BreadcrumbList.js +12 -6
- package/dist/components/molecules/breadcrumbs/Breadcrumbs.css +1 -1
- package/dist/components/molecules/breadcrumbs/Breadcrumbs2.js +20 -0
- package/dist/components/molecules/checkbox/Checkbox.controller.js +28 -24
- package/dist/components/molecules/checkbox/Checkbox.css +1 -1
- package/dist/components/molecules/checkbox/Checkbox.helpers.js +5 -9
- package/dist/components/molecules/checkbox/Checkbox2.js +7 -0
- package/dist/components/molecules/checkbox/CheckboxStateful.js +46 -59
- package/dist/components/molecules/checkbox/CheckboxStateless.js +41 -58
- package/dist/components/molecules/multi-select/MultiSelect.Combobox.js +34 -46
- package/dist/components/molecules/multi-select/MultiSelect.Dropdown.js +22 -30
- package/dist/components/molecules/multi-select/MultiSelect.controller.js +32 -36
- package/dist/components/molecules/multi-select/MultiSelect.helpers.js +17 -20
- package/dist/components/molecules/multi-select/MultiSelect.js +59 -60
- package/dist/components/molecules/multi-select/MultiSelectComboboxSelectedValues.js +7 -7
- package/dist/components/molecules/multi-select/Option.js +40 -39
- package/dist/components/molecules/numeric-input/NumericInput.controller.js +50 -44
- package/dist/components/molecules/numeric-input/NumericInput.css +1 -1
- package/dist/components/molecules/numeric-input/NumericInput.helpers.js +7 -18
- package/dist/components/molecules/numeric-input/NumericInput2.js +7 -0
- package/dist/components/molecules/numeric-input/NumericInputStateful.js +72 -107
- package/dist/components/molecules/numeric-input/NumericInputStateless.js +60 -95
- package/dist/components/molecules/search/Search.controller.js +31 -41
- package/dist/components/molecules/search/Search.css +1 -1
- package/dist/components/molecules/search/Search2.js +67 -0
- package/dist/components/molecules/select/Select.controller.js +35 -31
- package/dist/components/molecules/select/Select.css +1 -1
- package/dist/components/molecules/select/Select.helpers.js +10 -15
- package/dist/components/molecules/select/Select2.js +62 -0
- package/dist/components/molecules/select/combobox/Combobox.css +1 -1
- package/dist/components/molecules/select/combobox/Combobox2.js +31 -0
- package/dist/components/molecules/select/dropdown/Dropdown.css +1 -1
- package/dist/components/molecules/select/dropdown/Dropdown2.js +31 -0
- package/dist/components/molecules/select/option/Option.css +1 -1
- package/dist/components/molecules/select/option/Option2.js +36 -0
- package/dist/components/molecules/switch/Switch.controller.js +32 -32
- package/dist/components/molecules/switch/Switch.css +1 -1
- package/dist/components/molecules/switch/Switch.helpers.js +5 -9
- package/dist/components/molecules/switch/Switch2.js +58 -0
- package/dist/components/molecules/text-input/TextInput.controller.js +46 -35
- package/dist/components/molecules/text-input/TextInput.css +1 -1
- package/dist/components/molecules/text-input/TextInput.helpers.js +7 -16
- package/dist/components/molecules/text-input/TextInput2.js +7 -0
- package/dist/components/molecules/text-input/TextInputButtons.js +20 -37
- package/dist/components/molecules/text-input/TextInputStateful.js +62 -91
- package/dist/components/molecules/text-input/TextInputStateless.js +59 -88
- package/dist/components/organisms/dialog/Dialog.css +1 -1
- package/dist/components/organisms/dialog/Dialog2.js +50 -0
- package/dist/components/organisms/form/Form.controller.js +28 -28
- package/dist/components/organisms/form/Form.css +1 -1
- package/dist/components/organisms/form/Form.helpers.js +9 -11
- package/dist/components/organisms/form/Form2.js +52 -0
- package/dist/components/organisms/grid/Grid.controller.js +27 -33
- package/dist/components/organisms/grid/Grid.css +1 -1
- package/dist/components/organisms/grid/Grid.helpers.js +13 -14
- package/dist/components/organisms/grid/Grid2.js +52 -0
- package/dist/components/organisms/grid/body/GridBody.css +1 -1
- package/dist/components/organisms/grid/body/GridBody2.js +26 -0
- package/dist/components/organisms/grid/checkbox/GridCheckbox.css +1 -1
- package/dist/components/organisms/grid/checkbox/GridCheckbox2.js +35 -0
- package/dist/components/organisms/grid/column-group/GridColumnGroup2.js +14 -0
- package/dist/components/organisms/grid/data-cell/GridDataCell.js +5 -5
- package/dist/components/organisms/grid/grid-row/GridRow2.js +24 -0
- package/dist/components/organisms/grid/head/GridHead.css +1 -1
- package/dist/components/organisms/grid/head/GridHead2.js +23 -0
- package/dist/components/organisms/grid/header-cell/HeaderCell.js +5 -8
- package/dist/components/organisms/grid/select-all-grid-rows-cell/SelectAllGridRowsCell.js +15 -24
- package/dist/components/organisms/grid/select-grid-row-cell/SelectGridRowCell.js +14 -23
- package/dist/components/organisms/menu/Menu.css +1 -1
- package/dist/components/organisms/menu/Menu2.js +24 -0
- package/dist/components/organisms/menu/leaf/MenuLeaf.css +1 -1
- package/dist/components/organisms/menu/leaf/MenuLeaf2.js +31 -0
- package/dist/components/organisms/menu/list-item/MenuListItem.css +1 -1
- package/dist/components/organisms/menu/list-item/MenuListItem2.js +38 -0
- package/dist/components/organisms/menu/sub-menu/SubMenu.css +1 -1
- package/dist/components/organisms/menu/sub-menu/SubMenu2.js +56 -0
- package/dist/components/organisms/tabs/Tabs.css +1 -1
- package/dist/components/organisms/tabs/Tabs2.js +60 -0
- package/dist/components/organisms/tabs/button/TabButton.css +1 -1
- package/dist/components/organisms/tabs/button/TabButton2.js +83 -0
- package/dist/components/organisms/tabs/content/TabContent.css +1 -1
- package/dist/components/organisms/tabs/content/TabContent2.js +16 -0
- package/dist/components/organisms/tabs/edit-input/TabEditInput.css +1 -1
- package/dist/components/organisms/tabs/edit-input/TabEditInput2.js +45 -0
- package/dist/components/organisms/tabs/list/TabList.css +1 -1
- package/dist/components/organisms/tabs/list/TabList2.js +51 -0
- package/dist/enums/alert-mode.js +6 -4
- package/dist/enums/button-view.js +6 -4
- package/dist/enums/element-size.js +6 -4
- package/dist/enums/icon-name.js +6 -4
- package/dist/enums/loader-view.js +6 -4
- package/dist/enums/orientation-mode.js +6 -4
- package/dist/enums/semantic-color.js +6 -4
- package/dist/enums/tooltip-container.js +6 -4
- package/dist/hooks/use-auto-close/use-auto-close.js +17 -17
- package/dist/hooks/use-click-outside/use-click-outside.js +18 -18
- package/dist/hooks/use-container-dimensions/use-container-dimensions.js +15 -15
- package/dist/hooks/use-debounce/use-debounce.js +14 -14
- package/dist/hooks/use-element-ids/use-element-ids.js +11 -11
- package/dist/hooks/use-is-hovered/use-is-hovered.js +14 -14
- package/dist/hooks/use-is-mounted/use-is-mounted.js +14 -14
- package/dist/hooks/use-is-overflow/use-is-overflow.js +26 -26
- package/dist/hooks/use-key-press/use-key-press.js +17 -13
- package/dist/hooks/use-modal-focus-trap/use-modal-focus-trap.js +15 -19
- package/dist/hooks/use-remaining-timer/use-remaining-timer.js +35 -37
- package/dist/hooks/use-reset-form-input/use-reset-form-input.js +10 -10
- package/dist/hooks/use-theme/use-theme.js +6 -6
- package/dist/hooks/use-tooltip-position/use-tooltip-position.js +36 -30
- package/dist/hooks/use-window-dimensions/use-window-dimensions.js +18 -15
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +56 -112
- package/dist/styles/icons.css +1 -1
- package/dist/styles/main.css +1 -1
- package/dist/utils/get-class-name.js +13 -15
- package/dist/utils/handle-dropdown-list-key-press.js +26 -31
- package/dist/utils/move-focus-on-element-by-id.js +6 -6
- package/package.json +20 -22
- package/dist/components/atoms/button/Button.js +0 -66
- package/dist/components/atoms/button/icon-button/IconButton.js +0 -15
- package/dist/components/atoms/button/icon-button/index.js +0 -3
- package/dist/components/atoms/button/index.js +0 -3
- package/dist/components/atoms/button/inner-button/InnerButton.js +0 -28
- package/dist/components/atoms/button/inner-button/index.js +0 -3
- package/dist/components/atoms/button/primary-button/PrimaryButton.js +0 -18
- package/dist/components/atoms/button/primary-button/index.js +0 -3
- package/dist/components/atoms/button/secondary-button/SecondaryButton.js +0 -18
- package/dist/components/atoms/button/secondary-button/index.js +0 -3
- package/dist/components/atoms/editable-text/EditableText.js +0 -71
- package/dist/components/atoms/editable-text/index.js +0 -3
- package/dist/components/atoms/error-message/ErrorMessage.js +0 -30
- package/dist/components/atoms/error-message/index.js +0 -3
- package/dist/components/atoms/header/Header.js +0 -22
- package/dist/components/atoms/header/index.js +0 -3
- package/dist/components/atoms/icon/Icon.js +0 -31
- package/dist/components/atoms/icon/index.js +0 -3
- package/dist/components/atoms/image/Image.js +0 -24
- package/dist/components/atoms/image/index.js +0 -3
- package/dist/components/atoms/input/Input.js +0 -10
- package/dist/components/atoms/input/index.js +0 -3
- package/dist/components/atoms/label/Label.js +0 -30
- package/dist/components/atoms/label/index.js +0 -3
- package/dist/components/atoms/link/Link.js +0 -39
- package/dist/components/atoms/link/index.js +0 -3
- package/dist/components/atoms/tooltip/Tooltip.js +0 -70
- package/dist/components/atoms/tooltip/index.js +0 -3
- package/dist/components/molecules/accordion/Accordion.js +0 -11
- package/dist/components/molecules/accordion/AccordionItem.js +0 -24
- package/dist/components/molecules/accordion/index.js +0 -3
- package/dist/components/molecules/alert/Alert.js +0 -60
- package/dist/components/molecules/alert/index.js +0 -3
- package/dist/components/molecules/breadcrumbs/Breadcrumbs.js +0 -31
- package/dist/components/molecules/breadcrumbs/index.js +0 -3
- package/dist/components/molecules/checkbox/Checkbox.js +0 -7
- package/dist/components/molecules/checkbox/index.js +0 -3
- package/dist/components/molecules/numeric-input/NumericInput.js +0 -7
- package/dist/components/molecules/numeric-input/index.js +0 -3
- package/dist/components/molecules/search/Search.js +0 -112
- package/dist/components/molecules/search/index.js +0 -3
- package/dist/components/molecules/select/Select.js +0 -64
- package/dist/components/molecules/select/combobox/Combobox.js +0 -46
- package/dist/components/molecules/select/combobox/index.js +0 -3
- package/dist/components/molecules/select/dropdown/Dropdown.js +0 -46
- package/dist/components/molecules/select/dropdown/index.js +0 -3
- package/dist/components/molecules/select/index.js +0 -3
- package/dist/components/molecules/select/option/Option.js +0 -38
- package/dist/components/molecules/select/option/index.js +0 -3
- package/dist/components/molecules/switch/Switch.js +0 -68
- package/dist/components/molecules/switch/index.js +0 -3
- package/dist/components/molecules/text-input/TextInput.js +0 -7
- package/dist/components/molecules/text-input/index.js +0 -3
- package/dist/components/organisms/dialog/Dialog.js +0 -32
- package/dist/components/organisms/dialog/index.js +0 -3
- package/dist/components/organisms/form/Form.js +0 -48
- package/dist/components/organisms/form/index.js +0 -3
- package/dist/components/organisms/grid/Grid.js +0 -60
- package/dist/components/organisms/grid/body/GridBody.js +0 -31
- package/dist/components/organisms/grid/checkbox/GridCheckbox.js +0 -52
- package/dist/components/organisms/grid/column-group/GridColumnGroup.js +0 -26
- package/dist/components/organisms/grid/grid-row/GridRow.js +0 -35
- package/dist/components/organisms/grid/grid-row/index.js +0 -3
- package/dist/components/organisms/grid/head/GridHead.js +0 -35
- package/dist/components/organisms/grid/index.js +0 -3
- package/dist/components/organisms/menu/Menu.js +0 -22
- package/dist/components/organisms/menu/index.js +0 -3
- package/dist/components/organisms/menu/leaf/MenuLeaf.js +0 -28
- package/dist/components/organisms/menu/list-item/MenuListItem.js +0 -35
- package/dist/components/organisms/menu/sub-menu/SubMenu.js +0 -67
- package/dist/components/organisms/menu/sub-menu/index.js +0 -3
- package/dist/components/organisms/tabs/Tabs.js +0 -80
- package/dist/components/organisms/tabs/button/TabButton.js +0 -111
- package/dist/components/organisms/tabs/content/TabContent.js +0 -19
- package/dist/components/organisms/tabs/edit-input/TabEditInput.js +0 -64
- package/dist/components/organisms/tabs/index.js +0 -3
- package/dist/components/organisms/tabs/list/TabList.js +0 -67
package/dist/styles/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--cl-core-font:
|
|
1
|
+
:root{--cl-core-font:Arial, Helvetica, sans-serif;--cl-monospace-font:"Courier New", Courier, monospace;--cl-fancy-font:Georgia, "Times New Roman", Times, serif;--cl-xs-gap:2px;--cl-s-gap:4px;--cl-m-gap:8px;--cl-l-gap:16px;--cl-xl-gap:32px;--cl-xxl-gap:64px;--cl-icon-size:20px;--cl-thumb-size:24px;--cl-border-radius:4px;--cl-z-index-base:1;--cl-z-index-menu:5;--cl-z-index-popup:10;--cl-z-index-modal:20;--cl-typography-h1-mobile:2.25rem;--cl-typography-h1-tablet:2.5rem;--cl-typography-h1-desktop:3rem;--cl-typography-h2-mobile:2rem;--cl-typography-h2-tablet:2.25rem;--cl-typography-h2-desktop:2.5rem;--cl-typography-h3-mobile:1.75rem;--cl-typography-h3-tablet:2rem;--cl-typography-h3-desktop:2.25rem;--cl-typography-h4-mobile:1.5rem;--cl-typography-h4-tablet:1.75rem;--cl-typography-h4-desktop:2rem;--cl-typography-h5-mobile:1.25rem;--cl-typography-h5-tablet:1.5rem;--cl-typography-h5-desktop:1.75rem;--cl-typography-h6-mobile:1rem;--cl-typography-h6-tablet:1.125rem;--cl-typography-h6-desktop:1.25rem;--cl-typography-base-mobile:1rem;--cl-typography-base-tablet:1.125rem;--cl-typography-base-desktop:1.25rem;--cl-typography-small-mobile:.875rem;--cl-typography-small-tablet:1rem;--cl-typography-small-desktop:1.125rem;--cl-breakpoint-sm:640px;--cl-breakpoint-md:768px;--cl-breakpoint-lg:1024px;--cl-breakpoint-xl:1280px;--cl-breakpoint-xxl:1536px;--cl-base-font-color:#000;--cl-base-background-color:#fff;--cl-accent-a0:#8d1c12;--cl-accent-a10:#7d1c11;--cl-accent-a20:#6d1b10;--cl-accent-a30:#5e190f;--cl-surface-a0:#fff;--cl-surface-a10:#f0f0f0;--cl-surface-a20:#e1e1e1;--cl-surface-a30:#d3d3d3;--cl-surface-tonal-a0:#f7e8e4;--cl-surface-tonal-a10:#e9dcd8;--cl-surface-tonal-a20:#dbd0cd;--cl-surface-tonal-a30:#cec4c2;--cl-success-a0:#1b7f5c;--cl-success-a10:#28be8a;--cl-success-a20:#58dbad;--cl-warning-a0:#b8871f;--cl-warning-a10:#dfae44;--cl-warning-a20:#ebca85;--cl-danger-a0:#b13535;--cl-danger-a10:#d06262;--cl-danger-a20:#e29d9d;--cl-info-a0:#1e56a3;--cl-info-a10:#347ada;--cl-info-a20:#74a4e6;--cl-accent-gradient:linear-gradient(135deg, #8d1c12 0%, #7d1c11 50%, #6d1b10 100%);--cl-box-shadow:#0003 2.4px 2.4px 3.2px;--cl-box-shadow-extended:#0003 4.8px 4.8px 6.4px;--cl-text-shadow:2.4px 2.4px 3.2px #00000026;--cl-drop-shadow:drop-shadow(2.4px 2.4px 3.2px #00000026);--cl-shadow-background:#0000004d;--cl-accent-border:1px solid #8d1c12;--cl-danger-border:1px solid #d06262;--cl-success-border:1px solid #28be8a;--cl-warning-border:1px solid #dfae44;--cl-info-border:1px solid #347ada;--cl-light-border:1px solid #c0b8b6;--cl-outline-border:1px solid #000}.cl-components-dark-theme{--cl-base-background-color:#000;--cl-base-font-color:#fff;--cl-accent-a0:#eb5cbe;--cl-accent-a10:#ef71c5;--cl-accent-a20:#f385cc;--cl-accent-a30:#f697d4;--cl-surface-a0:#121212;--cl-surface-a10:#282828;--cl-surface-a20:#3f3f3f;--cl-surface-a30:#575757;--cl-surface-tonal-a0:#251a21;--cl-surface-tonal-a10:#3a2f36;--cl-surface-tonal-a20:#4f464c;--cl-surface-tonal-a30:#665d63;--cl-success-a0:#9ae8ce;--cl-success-a10:#47d5a6;--cl-success-a20:#22946e;--cl-warning-a0:#a87a2a;--cl-warning-a10:#d7ac61;--cl-warning-a20:#ecd7b2;--cl-danger-a0:#eb9e9e;--cl-danger-a10:#d94a4a;--cl-danger-a20:#9c2121;--cl-info-a0:#92b2e5;--cl-info-a10:#4077d1;--cl-info-a20:#21498a;--cl-accent-gradient:linear-gradient(135deg, #eb5cbe 0%, #ef71c5 50%, #f385cc 100%);--cl-box-shadow:#ffffff4d 2.4px 2.4px 3.2px;--cl-box-shadow-extended:#ffffff4d 4px 4px 5px;--cl-text-shadow:2.4px 2.4px 3.2px #ffffff80;--cl-drop-shadow:drop-shadow(2.4px 2.4px 3.2px #ffffff4d);--cl-shadow-background:#ffffff4d;--cl-accent-border:1px solid #eb5cbe;--cl-danger-border:1px solid #d94a4a;--cl-success-border:1px solid #47d5a6;--cl-warning-border:1px solid #d7ac61;--cl-info-border:1px solid #4077d1;--cl-light-border:1px solid #665d63;--cl-outline-border:1px solid #fff}@keyframes cl-fade-in{0%{opacity:0}to{opacity:1}}@keyframes cl-fade-out{0%{opacity:1}to{opacity:0}}.cl-fade-in{animation:.4s cl-fade-in}.cl-fade-out{animation:.4s cl-fade-out}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}).filter((n) => !!n).join(" ");
|
|
1
|
+
//#region src/utils/get-class-name.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e.map((e) => {
|
|
4
|
+
if (typeof e == "string") return e.trim();
|
|
5
|
+
if (typeof e == "object") {
|
|
6
|
+
let t = [];
|
|
7
|
+
for (let n in e) e[n] && t.push(n.trim());
|
|
8
|
+
return t.join(" ");
|
|
9
|
+
}
|
|
10
|
+
return "";
|
|
11
|
+
}).filter((e) => !!e).join(" ");
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { e as getClassName };
|
|
@@ -1,32 +1,27 @@
|
|
|
1
|
-
import { moveFocusOnElementById as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
t && d(t.id);
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import { moveFocusOnElementById as e } from "./move-focus-on-element-by-id.js";
|
|
2
|
+
//#region src/utils/handle-dropdown-list-key-press.ts
|
|
3
|
+
function t({ e: t, options: n, onClose: r }) {
|
|
4
|
+
let i = "";
|
|
5
|
+
for (let e of n) document.getElementById(e.id) === document.activeElement && (i = e.id);
|
|
6
|
+
let a = n.findIndex((e) => e.id === i);
|
|
7
|
+
switch (t.key) {
|
|
8
|
+
case "Escape":
|
|
9
|
+
t.preventDefault(), r();
|
|
10
|
+
break;
|
|
11
|
+
case "ArrowUp": {
|
|
12
|
+
t.preventDefault();
|
|
13
|
+
let r = n[a - 1 >= 0 ? a - 1 : n.length - 1];
|
|
14
|
+
r && e(r.id);
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
case "ArrowDown":
|
|
18
|
+
case "Tab": {
|
|
19
|
+
t.preventDefault();
|
|
20
|
+
let r = n[a === n.length - 1 ? 0 : a + 1];
|
|
21
|
+
r && e(r.id);
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { t as handleDropdownListKeyPress };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/utils/move-focus-on-element-by-id.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
let t = document.getElementById(e);
|
|
4
|
+
t && t.focus();
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { e as moveFocusOnElementById };
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "git+https://github.com/ChopLogic/chop-logic-components.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "4.0
|
|
7
|
+
"version": "4.1.0",
|
|
8
8
|
"description": "Reusable React components and hooks for the Chop Logic project",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"module": "dist/index.es.js",
|
|
@@ -93,10 +93,9 @@
|
|
|
93
93
|
"*.(ts|tsx)": [
|
|
94
94
|
"bash -c 'npm run typecheck'"
|
|
95
95
|
],
|
|
96
|
-
"*.{
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"biome check --diagnostic-level error",
|
|
96
|
+
"*.{ts,tsx,js,css}": [
|
|
97
|
+
"npm run lint:fix",
|
|
98
|
+
"npm run format",
|
|
100
99
|
"npm run test:ci"
|
|
101
100
|
],
|
|
102
101
|
"*.{md,mdx}": [
|
|
@@ -117,32 +116,31 @@
|
|
|
117
116
|
},
|
|
118
117
|
"homepage": "https://choplogic.github.io/chop-logic-components",
|
|
119
118
|
"devDependencies": {
|
|
120
|
-
"@biomejs/biome": "^2.4.
|
|
121
|
-
"@commitlint/cli": "^20.
|
|
122
|
-
"@commitlint/config-conventional": "^20.
|
|
123
|
-
"@storybook/addon-a11y": "^10.
|
|
124
|
-
"@storybook/addon-docs": "^10.
|
|
125
|
-
"@storybook/react-vite": "^10.
|
|
126
|
-
"@stryker-mutator/core": "^9.6.
|
|
127
|
-
"@stryker-mutator/vitest-runner": "^9.6.
|
|
119
|
+
"@biomejs/biome": "^2.4.12",
|
|
120
|
+
"@commitlint/cli": "^20.5.0",
|
|
121
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
122
|
+
"@storybook/addon-a11y": "^10.3.5",
|
|
123
|
+
"@storybook/addon-docs": "^10.3.5",
|
|
124
|
+
"@storybook/react-vite": "^10.3.5",
|
|
125
|
+
"@stryker-mutator/core": "^9.6.1",
|
|
126
|
+
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
128
127
|
"@testing-library/jest-dom": "^6.9.1",
|
|
129
128
|
"@testing-library/react": "^16.3.2",
|
|
130
|
-
"@types/node": "^25.
|
|
129
|
+
"@types/node": "^25.6.0",
|
|
131
130
|
"@types/react": "^19.2.14",
|
|
132
131
|
"@types/react-dom": "^19.2.3",
|
|
133
|
-
"@vitest/coverage-v8": "^4.
|
|
134
|
-
"globals": "^17.3.0",
|
|
132
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
135
133
|
"husky": "^9.1.7",
|
|
136
134
|
"husky-init": "^8.0.0",
|
|
137
|
-
"jsdom": "^
|
|
138
|
-
"prettier": "^3.8.
|
|
135
|
+
"jsdom": "^29.0.2",
|
|
136
|
+
"prettier": "^3.8.3",
|
|
139
137
|
"remark-gfm": "^4.0.1",
|
|
140
|
-
"storybook": "^10.
|
|
141
|
-
"typescript": "^
|
|
142
|
-
"vite": "^
|
|
138
|
+
"storybook": "^10.3.5",
|
|
139
|
+
"typescript": "^6.0.3",
|
|
140
|
+
"vite": "^8.0.8",
|
|
143
141
|
"vite-plugin-dts": "^4.5.4",
|
|
144
142
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
145
|
-
"vitest": "^4.
|
|
143
|
+
"vitest": "^4.1.4"
|
|
146
144
|
},
|
|
147
145
|
"overrides": {
|
|
148
146
|
"storybook": "$storybook"
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as i } from "../../../utils/get-class-name.js";
|
|
3
|
-
import { withTooltip as l } from "../../hocs/with-tooltip/with-tooltip.js";
|
|
4
|
-
import './Button.css';/* empty css */
|
|
5
|
-
import { IconButton as c } from "./icon-button/IconButton.js";
|
|
6
|
-
import { InnerButton as d } from "./inner-button/InnerButton.js";
|
|
7
|
-
import { PrimaryButton as B } from "./primary-button/PrimaryButton.js";
|
|
8
|
-
import { SecondaryButton as y } from "./secondary-button/SecondaryButton.js";
|
|
9
|
-
import { ButtonView as t } from "../../../enums/button-view.js";
|
|
10
|
-
const I = ({
|
|
11
|
-
text: u,
|
|
12
|
-
icon: r,
|
|
13
|
-
tooltip: w,
|
|
14
|
-
extended: s = !1,
|
|
15
|
-
view: f = t.Primary,
|
|
16
|
-
label: o,
|
|
17
|
-
className: a,
|
|
18
|
-
iconSize: n,
|
|
19
|
-
...m
|
|
20
|
-
}) => {
|
|
21
|
-
const p = i([a, "cl-button", { "cl-button_extended": s }]);
|
|
22
|
-
switch (f) {
|
|
23
|
-
case t.Primary:
|
|
24
|
-
return /* @__PURE__ */ e(
|
|
25
|
-
B,
|
|
26
|
-
{
|
|
27
|
-
className: p,
|
|
28
|
-
icon: r,
|
|
29
|
-
text: u,
|
|
30
|
-
"aria-label": o,
|
|
31
|
-
iconSize: n,
|
|
32
|
-
...m
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
case t.Secondary:
|
|
36
|
-
return /* @__PURE__ */ e(
|
|
37
|
-
y,
|
|
38
|
-
{
|
|
39
|
-
className: p,
|
|
40
|
-
icon: r,
|
|
41
|
-
text: u,
|
|
42
|
-
"aria-label": o,
|
|
43
|
-
iconSize: n,
|
|
44
|
-
...m
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
case t.Icon:
|
|
48
|
-
return /* @__PURE__ */ e(c, { label: o, icon: r, iconSize: n, ...m, className: a });
|
|
49
|
-
case t.Inner:
|
|
50
|
-
return /* @__PURE__ */ e(
|
|
51
|
-
d,
|
|
52
|
-
{
|
|
53
|
-
label: o,
|
|
54
|
-
icon: r,
|
|
55
|
-
iconSize: n,
|
|
56
|
-
...m,
|
|
57
|
-
className: a
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
default:
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
}, V = l(I);
|
|
64
|
-
export {
|
|
65
|
-
V as default
|
|
66
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as r } from "../../../../utils/get-class-name.js";
|
|
3
|
-
import './IconButton.css';/* empty css */
|
|
4
|
-
import a from "../../icon/Icon.js";
|
|
5
|
-
import { ElementSize as c } from "../../../../enums/element-size.js";
|
|
6
|
-
const f = ({
|
|
7
|
-
icon: o,
|
|
8
|
-
className: m,
|
|
9
|
-
label: e,
|
|
10
|
-
iconSize: i = c.Medium,
|
|
11
|
-
...n
|
|
12
|
-
}) => /* @__PURE__ */ t("button", { ...n, "aria-label": e, className: r(["cl-icon-button", m]), children: o && /* @__PURE__ */ t(a, { name: o, className: "cl-icon-button__icon", size: i }) });
|
|
13
|
-
export {
|
|
14
|
-
f as IconButton
|
|
15
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as l } from "../../../../utils/get-class-name.js";
|
|
3
|
-
import './InnerButton.css';/* empty css */
|
|
4
|
-
import s from "../../icon/Icon.js";
|
|
5
|
-
import { ElementSize as c } from "../../../../enums/element-size.js";
|
|
6
|
-
const x = ({
|
|
7
|
-
onClick: n,
|
|
8
|
-
label: o,
|
|
9
|
-
icon: e,
|
|
10
|
-
disabled: r,
|
|
11
|
-
className: m,
|
|
12
|
-
iconSize: i = c.Small,
|
|
13
|
-
...a
|
|
14
|
-
}) => /* @__PURE__ */ t(
|
|
15
|
-
"button",
|
|
16
|
-
{
|
|
17
|
-
className: l(["cl-inner-button", m]),
|
|
18
|
-
onClick: n,
|
|
19
|
-
"aria-label": o,
|
|
20
|
-
type: "button",
|
|
21
|
-
disabled: r,
|
|
22
|
-
...a,
|
|
23
|
-
children: /* @__PURE__ */ t(s, { name: e, size: i, className: "cl-inner-button__icon" })
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
export {
|
|
27
|
-
x as InnerButton
|
|
28
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as i } from "../../../../utils/get-class-name.js";
|
|
3
|
-
import './PrimaryButton.css';/* empty css */
|
|
4
|
-
import l from "../../icon/Icon.js";
|
|
5
|
-
import { ElementSize as n } from "../../../../enums/element-size.js";
|
|
6
|
-
const x = ({
|
|
7
|
-
icon: t,
|
|
8
|
-
text: r,
|
|
9
|
-
className: o,
|
|
10
|
-
iconSize: a = n.Small,
|
|
11
|
-
...e
|
|
12
|
-
}) => /* @__PURE__ */ s("button", { ...e, className: i(["cl-primary-button", o]), children: [
|
|
13
|
-
t && /* @__PURE__ */ m(l, { name: t, className: "cl-primary-button__icon", size: a }),
|
|
14
|
-
/* @__PURE__ */ m("span", { className: "cl-primary-button__text", children: r })
|
|
15
|
-
] });
|
|
16
|
-
export {
|
|
17
|
-
x as PrimaryButton
|
|
18
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as a } from "../../../../utils/get-class-name.js";
|
|
3
|
-
import './SecondaryButton.css';/* empty css */
|
|
4
|
-
import c from "../../icon/Icon.js";
|
|
5
|
-
import { ElementSize as l } from "../../../../enums/element-size.js";
|
|
6
|
-
const f = ({
|
|
7
|
-
icon: o,
|
|
8
|
-
text: e,
|
|
9
|
-
className: s,
|
|
10
|
-
iconSize: m = l.Small,
|
|
11
|
-
...n
|
|
12
|
-
}) => /* @__PURE__ */ r("button", { ...n, className: a(["cl-secondary-button", s]), children: [
|
|
13
|
-
o && /* @__PURE__ */ t(c, { name: o, className: "cl-secondary-button__icon", size: m }),
|
|
14
|
-
/* @__PURE__ */ t("span", { className: "cl-secondary-button__text", children: e })
|
|
15
|
-
] });
|
|
16
|
-
export {
|
|
17
|
-
f as SecondaryButton
|
|
18
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as D } from "../../../utils/get-class-name.js";
|
|
3
|
-
import { useRef as N, useCallback as r } from "react";
|
|
4
|
-
import './EditableText.css';/* empty css */
|
|
5
|
-
import { EditView as R } from "./EditView.js";
|
|
6
|
-
import { ReadView as _ } from "./ReadView.js";
|
|
7
|
-
import { useEditModeState as g } from "./useEditModeState.js";
|
|
8
|
-
import { useInputFocus as B } from "./useInputFocus.js";
|
|
9
|
-
import { useValueState as K } from "./useValueState.js";
|
|
10
|
-
const G = ({
|
|
11
|
-
value: V,
|
|
12
|
-
isEditMode: b,
|
|
13
|
-
onChange: C,
|
|
14
|
-
onClick: n,
|
|
15
|
-
className: k,
|
|
16
|
-
autoSelectTextOnEditMode: M = !1,
|
|
17
|
-
multiline: a = !1,
|
|
18
|
-
placeholder: d = "Click to edit...",
|
|
19
|
-
readOnly: t = !1,
|
|
20
|
-
...m
|
|
21
|
-
}) => {
|
|
22
|
-
const u = N(null), { editMode: i, enterEditMode: c, exitEditMode: o } = g(b, t), { internalValue: l, updateValue: w, commitValue: f, resetValue: p } = K(V, C);
|
|
23
|
-
B(u, i, M, t);
|
|
24
|
-
const h = r(
|
|
25
|
-
(e) => {
|
|
26
|
-
n?.(e), c();
|
|
27
|
-
},
|
|
28
|
-
[n, c]
|
|
29
|
-
), s = r(() => {
|
|
30
|
-
o(), f();
|
|
31
|
-
}, [o, f]), y = r(
|
|
32
|
-
(e) => {
|
|
33
|
-
e.key === "Enter" && !a && (e.preventDefault(), s()), e.key === "Escape" && (p(), o());
|
|
34
|
-
},
|
|
35
|
-
[a, s, p, o]
|
|
36
|
-
), x = D([
|
|
37
|
-
"cl-editable-text",
|
|
38
|
-
k,
|
|
39
|
-
{
|
|
40
|
-
"cl-editable-text_edit-mode": i,
|
|
41
|
-
"cl-editable-text_read-only": t,
|
|
42
|
-
"cl-editable-text_empty": !l
|
|
43
|
-
}
|
|
44
|
-
]);
|
|
45
|
-
return i && !t ? /* @__PURE__ */ E(
|
|
46
|
-
R,
|
|
47
|
-
{
|
|
48
|
-
multiline: a,
|
|
49
|
-
value: l,
|
|
50
|
-
placeholder: d,
|
|
51
|
-
onChange: w,
|
|
52
|
-
onBlur: s,
|
|
53
|
-
onKeyDown: y,
|
|
54
|
-
className: x,
|
|
55
|
-
inputRef: u,
|
|
56
|
-
...m
|
|
57
|
-
}
|
|
58
|
-
) : /* @__PURE__ */ E(
|
|
59
|
-
_,
|
|
60
|
-
{
|
|
61
|
-
value: l,
|
|
62
|
-
placeholder: d,
|
|
63
|
-
onClick: h,
|
|
64
|
-
className: x,
|
|
65
|
-
...m
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
G as default
|
|
71
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as l } from "../../../utils/get-class-name.js";
|
|
3
|
-
import './ErrorMessage.css';/* empty css */
|
|
4
|
-
const n = ({
|
|
5
|
-
errorId: e,
|
|
6
|
-
testId: s,
|
|
7
|
-
message: a = "Error!",
|
|
8
|
-
visible: r = !1,
|
|
9
|
-
className: o
|
|
10
|
-
}) => {
|
|
11
|
-
const t = l([
|
|
12
|
-
"cl-error-message",
|
|
13
|
-
o,
|
|
14
|
-
{ "cl-error-message_visible": r }
|
|
15
|
-
]);
|
|
16
|
-
return /* @__PURE__ */ i(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
id: e,
|
|
20
|
-
className: t,
|
|
21
|
-
"data-testid": s,
|
|
22
|
-
"aria-hidden": !r,
|
|
23
|
-
"aria-live": "polite",
|
|
24
|
-
children: a
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
n as default
|
|
30
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as t } from "../../../utils/get-class-name.js";
|
|
3
|
-
import './Header.css';/* empty css */
|
|
4
|
-
const n = ({ as: e = "h1", icon: h, children: r, className: a, ..._ }) => {
|
|
5
|
-
const c = e, d = t([
|
|
6
|
-
a,
|
|
7
|
-
"cl-header",
|
|
8
|
-
h,
|
|
9
|
-
{
|
|
10
|
-
"cl-header__h1": e === "h1",
|
|
11
|
-
"cl-header__h2": e === "h2",
|
|
12
|
-
"cl-header__h3": e === "h3",
|
|
13
|
-
"cl-header__h4": e === "h4",
|
|
14
|
-
"cl-header__h5": e === "h5",
|
|
15
|
-
"cl-header__h6": e === "h6"
|
|
16
|
-
}
|
|
17
|
-
]);
|
|
18
|
-
return /* @__PURE__ */ l(c, { className: d, ..._, children: r });
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
n as default
|
|
22
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as i } from "../../../utils/get-class-name.js";
|
|
3
|
-
import './Icon.css';/* empty css */
|
|
4
|
-
import { ElementSize as a } from "../../../enums/element-size.js";
|
|
5
|
-
const u = ({
|
|
6
|
-
name: r,
|
|
7
|
-
testId: t,
|
|
8
|
-
className: c,
|
|
9
|
-
hidden: o,
|
|
10
|
-
size: l = a.Medium,
|
|
11
|
-
...m
|
|
12
|
-
}) => {
|
|
13
|
-
if (!r) return null;
|
|
14
|
-
const e = i([
|
|
15
|
-
c,
|
|
16
|
-
"cl-icon",
|
|
17
|
-
r,
|
|
18
|
-
{
|
|
19
|
-
"cl-icon_extra-small": l === a.ExtraSmall,
|
|
20
|
-
"cl-icon_small": l === a.Small,
|
|
21
|
-
"cl-icon_medium": l === a.Medium,
|
|
22
|
-
"cl-icon_large": l === a.Large,
|
|
23
|
-
"cl-icon_xlarge": l === a.ExtraLarge,
|
|
24
|
-
"cl-icon_2xlarge": l === a.ExtraExtraLarge
|
|
25
|
-
}
|
|
26
|
-
]);
|
|
27
|
-
return /* @__PURE__ */ n("span", { "data-testid": t, className: e, "aria-hidden": o, ...m });
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
u as default
|
|
31
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName as u } from "../../../utils/get-class-name.js";
|
|
3
|
-
import { useState as h } from "react";
|
|
4
|
-
import { BasicImage as E } from "./BasicImage.js";
|
|
5
|
-
import { FallbackImage as d } from "./FallBackImage.js";
|
|
6
|
-
import './Image.css';/* empty css */
|
|
7
|
-
import { ResponsivePicture as C } from "./ResponsivePicture.js";
|
|
8
|
-
import { withFigureCaption as I } from "../../hocs/with-figure-caption/with-figure-caption.js";
|
|
9
|
-
const v = ({
|
|
10
|
-
alt: s,
|
|
11
|
-
sources: o = [],
|
|
12
|
-
className: m,
|
|
13
|
-
decorative: i = !1,
|
|
14
|
-
onError: n,
|
|
15
|
-
...t
|
|
16
|
-
}) => {
|
|
17
|
-
const [l, p] = h(!1), c = u(["cl-image", m]), f = o.length > 0, a = i ? "" : s, e = (g) => {
|
|
18
|
-
p(!0), n?.(g);
|
|
19
|
-
};
|
|
20
|
-
return l ? /* @__PURE__ */ r(d, {}) : f ? /* @__PURE__ */ r(C, { alt: a, sources: o, onError: e, ...t }) : /* @__PURE__ */ r("div", { className: c, children: /* @__PURE__ */ r(E, { alt: a, onError: e, ...t }) });
|
|
21
|
-
}, k = I(v);
|
|
22
|
-
export {
|
|
23
|
-
k as default
|
|
24
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as i } from "react";
|
|
3
|
-
import './Input.css';/* empty css */
|
|
4
|
-
const n = ({ children: r, ...t }, p) => /* @__PURE__ */ s("div", { className: "cl-input__wrapper", children: [
|
|
5
|
-
/* @__PURE__ */ e("input", { ...t, className: "cl-input__field", ref: p }),
|
|
6
|
-
r
|
|
7
|
-
] }), l = i(n);
|
|
8
|
-
export {
|
|
9
|
-
l as default
|
|
10
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import './Label.css';/* empty css */
|
|
3
|
-
import { getClassName as x } from "../../../utils/get-class-name.js";
|
|
4
|
-
import { ElementSize as _ } from "../../../enums/element-size.js";
|
|
5
|
-
import u from "../icon/Icon.js";
|
|
6
|
-
const q = ({
|
|
7
|
-
label: r,
|
|
8
|
-
required: i,
|
|
9
|
-
inputId: m,
|
|
10
|
-
icon: e,
|
|
11
|
-
iconPosition: l,
|
|
12
|
-
isTextHidden: c = !1,
|
|
13
|
-
iconSize: o = _.ExtraSmall,
|
|
14
|
-
disabled: n = !1,
|
|
15
|
-
className: b,
|
|
16
|
-
testId: d
|
|
17
|
-
}) => {
|
|
18
|
-
const f = !!e && l === "left", p = !!e && l === "right", a = /* @__PURE__ */ t(u, { name: e, size: o }), h = x(["cl-label", b, { "cl-label_disabled": n }]);
|
|
19
|
-
return /* @__PURE__ */ s("label", { className: h, htmlFor: m, "data-testid": d, children: [
|
|
20
|
-
f && a,
|
|
21
|
-
!c && /* @__PURE__ */ s("span", { className: "cl-label__text", children: [
|
|
22
|
-
r,
|
|
23
|
-
i && /* @__PURE__ */ t("abbr", { className: "cl-label__required", title: "required", children: "*" })
|
|
24
|
-
] }),
|
|
25
|
-
p && a
|
|
26
|
-
] });
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
q as default
|
|
30
|
-
};
|