chop-logic-components 4.0.1 → 4.0.3
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 +5 -0
- 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 +29 -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-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.es.js +55 -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 +15 -17
- 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/README.md
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
Welcome to **Chop Logic Components**, a React components library packed with a variety of **styled
|
|
19
19
|
components** and **custom hooks** that are easy to integrate into any React project.
|
|
20
20
|
|
|
21
|
+
## 📚 About This Library
|
|
22
|
+
|
|
23
|
+
Chop Logic Components follows **Atomic Design** principles with **Fully Typed TypeScript** components. All styling uses **pure CSS with CSS variables** (BEM naming convention with `cl-` prefix) for consistent theming across light and dark modes. Built for developer productivity with comprehensive Storybook documentation and accessibility-first approach.
|
|
24
|
+
|
|
21
25
|
## ✨ Features
|
|
22
26
|
|
|
23
27
|
Chop Logic is designed to speed up development by providing reusable, accessible, and highly customizable components.
|
|
@@ -61,6 +65,7 @@ yarn add chop-logic-components
|
|
|
61
65
|
| `test` | Runs unit tests using Vitest in watch mode (interactive). |
|
|
62
66
|
| `test:ci` | Runs tests once in CI mode and allows empty test sets. |
|
|
63
67
|
| `coverage` | Runs tests and generates a coverage report using Vitest. |
|
|
68
|
+
| `test:mutation` | Runs mutation testing using Stryker to verify test quality. |
|
|
64
69
|
| `release:version` | Bumps the version (`patch`, `minor`, or `major`), commits the change, creates a Git tag, and pushes to `main`. Usage: `npm run release:version patch` |
|
|
65
70
|
|
|
66
71
|
## 🛠 Contributing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-button{font-size:var(--cl-typography-base-mobile);padding:var(--cl-m-gap);
|
|
1
|
+
.cl-button{font-size:var(--cl-typography-base-mobile);padding:var(--cl-m-gap);justify-content:center;align-items:center;width:fit-content;display:flex}.cl-button:focus-visible{outline:var(--cl-outline-border);outline-offset:var(--cl-s-gap)}.cl-button[disabled]{pointer-events:none;opacity:.5}.cl-button_extended{width:100%}@media (width>=640px){.cl-button{font-size:var(--cl-typography-base-tablet);padding:var(--cl-m-gap) var(--cl-l-gap)}}@media (width>=1024px){.cl-button{font-size:var(--cl-typography-base-desktop)}}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../utils/get-class-name.js";
|
|
2
|
+
import { withTooltip as t } from "../../hocs/with-tooltip/with-tooltip.js";
|
|
3
|
+
import './Button.css';/* empty css */
|
|
4
|
+
import { ButtonView as n } from "../../../enums/button-view.js";
|
|
5
|
+
import { IconButton as r } from "./icon-button/IconButton2.js";
|
|
6
|
+
import { InnerButton as i } from "./inner-button/InnerButton2.js";
|
|
7
|
+
import { PrimaryButton as a } from "./primary-button/PrimaryButton2.js";
|
|
8
|
+
import { SecondaryButton as o } from "./secondary-button/SecondaryButton2.js";
|
|
9
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
10
|
+
var c = t(({ text: t, icon: c, tooltip: l, extended: u = !1, view: d = n.Primary, label: f, className: p, iconSize: m, ...h }) => {
|
|
11
|
+
let g = e([
|
|
12
|
+
p,
|
|
13
|
+
"cl-button",
|
|
14
|
+
{ "cl-button_extended": u }
|
|
15
|
+
]);
|
|
16
|
+
switch (d) {
|
|
17
|
+
case n.Primary: return /* @__PURE__ */ s(a, {
|
|
18
|
+
className: g,
|
|
19
|
+
icon: c,
|
|
20
|
+
text: t,
|
|
21
|
+
"aria-label": f,
|
|
22
|
+
iconSize: m,
|
|
23
|
+
...h
|
|
24
|
+
});
|
|
25
|
+
case n.Secondary: return /* @__PURE__ */ s(o, {
|
|
26
|
+
className: g,
|
|
27
|
+
icon: c,
|
|
28
|
+
text: t,
|
|
29
|
+
"aria-label": f,
|
|
30
|
+
iconSize: m,
|
|
31
|
+
...h
|
|
32
|
+
});
|
|
33
|
+
case n.Icon: return /* @__PURE__ */ s(r, {
|
|
34
|
+
label: f,
|
|
35
|
+
icon: c,
|
|
36
|
+
iconSize: m,
|
|
37
|
+
...h,
|
|
38
|
+
className: p
|
|
39
|
+
});
|
|
40
|
+
case n.Inner: return /* @__PURE__ */ s(i, {
|
|
41
|
+
label: f,
|
|
42
|
+
icon: c,
|
|
43
|
+
iconSize: m,
|
|
44
|
+
...h,
|
|
45
|
+
className: p
|
|
46
|
+
});
|
|
47
|
+
default: return null;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { c as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-icon-button{
|
|
1
|
+
.cl-icon-button{cursor:pointer;padding:var(--cl-m-gap);background:0 0;border:none;border-radius:50%;width:fit-content;transition:all .15s}.cl-icon-button__icon:before{color:var(--cl-base-font-color)}.cl-icon-button:hover{filter:drop-shadow(0 2px 4px #00000026);transform:scale(1.1)}.cl-icon-button:hover .cl-icon-button__icon:before{color:var(--cl-accent-a0)}.cl-icon-button:active{transform:scale(.95)}.cl-icon-button[disabled]{pointer-events:none;opacity:.5}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import { ElementSize as t } from "../../../../enums/element-size.js";
|
|
3
|
+
import './IconButton.css';/* empty css */
|
|
4
|
+
import n from "../../icon/Icon2.js";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/atoms/button/icon-button/IconButton.tsx
|
|
7
|
+
var i = ({ icon: i, className: a, label: o, iconSize: s = t.Medium, ...c }) => /* @__PURE__ */ r("button", {
|
|
8
|
+
...c,
|
|
9
|
+
"aria-label": o,
|
|
10
|
+
className: e(["cl-icon-button", a]),
|
|
11
|
+
children: i && /* @__PURE__ */ r(n, {
|
|
12
|
+
name: i,
|
|
13
|
+
className: "cl-icon-button__icon",
|
|
14
|
+
size: s
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as IconButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-inner-button{
|
|
1
|
+
.cl-inner-button{cursor:pointer;height:var(--cl-icon-size);width:var(--cl-icon-size);background:0 0;border:none;padding:0;transition:all .15s}.cl-inner-button:focus-visible{outline:var(--cl-outline-border);outline-offset:-1px}.cl-inner-button:hover{filter:var(--cl-drop-shadow);transform:scale(1.15)}.cl-inner-button:hover .cl-inner-button__icon:before{color:var(--cl-accent-a10)}.cl-inner-button:active{transform:scale(.95)}.cl-inner-button[disabled]{pointer-events:none;opacity:.5}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import { ElementSize as t } from "../../../../enums/element-size.js";
|
|
3
|
+
import './InnerButton.css';/* empty css */
|
|
4
|
+
import n from "../../icon/Icon2.js";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/atoms/button/inner-button/InnerButton.tsx
|
|
7
|
+
var i = ({ onClick: i, label: a, icon: o, disabled: s, className: c, iconSize: l = t.Small, ...u }) => /* @__PURE__ */ r("button", {
|
|
8
|
+
className: e(["cl-inner-button", c]),
|
|
9
|
+
onClick: i,
|
|
10
|
+
"aria-label": a,
|
|
11
|
+
type: "button",
|
|
12
|
+
disabled: s,
|
|
13
|
+
...u,
|
|
14
|
+
children: /* @__PURE__ */ r(n, {
|
|
15
|
+
name: o,
|
|
16
|
+
size: l,
|
|
17
|
+
className: "cl-inner-button__icon"
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as InnerButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-primary-button{
|
|
1
|
+
.cl-primary-button{cursor:pointer;border-radius:var(--cl-border-radius);background:var(--cl-accent-gradient);box-shadow:var(--cl-box-shadow);gap:var(--cl-s-gap);border:none;transition:all .15s}.cl-primary-button:hover{filter:brightness(1.1);box-shadow:var(--cl-box-shadow-extended)}.cl-primary-button:active{box-shadow:var(--cl-box-shadow);transform:scale(.98)}.cl-primary-button__text{font-family:var(--cl-core-font);font-size:inherit;color:var(--cl-base-background-color);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}.cl-primary-button__icon:before{color:var(--cl-base-background-color)}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import { ElementSize as t } from "../../../../enums/element-size.js";
|
|
3
|
+
import './PrimaryButton.css';/* empty css */
|
|
4
|
+
import n from "../../icon/Icon2.js";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/atoms/button/primary-button/PrimaryButton.tsx
|
|
7
|
+
var a = ({ icon: a, text: o, className: s, iconSize: c = t.Small, ...l }) => /* @__PURE__ */ i("button", {
|
|
8
|
+
...l,
|
|
9
|
+
className: e(["cl-primary-button", s]),
|
|
10
|
+
children: [a && /* @__PURE__ */ r(n, {
|
|
11
|
+
name: a,
|
|
12
|
+
className: "cl-primary-button__icon",
|
|
13
|
+
size: c
|
|
14
|
+
}), /* @__PURE__ */ r("span", {
|
|
15
|
+
className: "cl-primary-button__text",
|
|
16
|
+
children: o
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as PrimaryButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-secondary-button{background:var(--cl-surface-a10);cursor:pointer;border-radius:var(--cl-border-radius);
|
|
1
|
+
.cl-secondary-button{background:var(--cl-surface-a10);cursor:pointer;border-radius:var(--cl-border-radius);gap:var(--cl-s-gap);box-shadow:var(--cl-box-shadow);border:none;transition:all .15s}.cl-secondary-button:hover{box-shadow:var(--cl-box-shadow-extended)}.cl-secondary-button:active{box-shadow:var(--cl-box-shadow);transform:scale(.98)}.cl-secondary-button__text{font-family:var(--cl-core-font);font-size:inherit;color:var(--cl-base-font-color);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}.cl-secondary-button__icon:before{color:var(--cl-base-font-color);margin-right:var(--cl-s-gap)}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../../utils/get-class-name.js";
|
|
2
|
+
import { ElementSize as t } from "../../../../enums/element-size.js";
|
|
3
|
+
import './SecondaryButton.css';/* empty css */
|
|
4
|
+
import n from "../../icon/Icon2.js";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/atoms/button/secondary-button/SecondaryButton.tsx
|
|
7
|
+
var a = ({ icon: a, text: o, className: s, iconSize: c = t.Small, ...l }) => /* @__PURE__ */ i("button", {
|
|
8
|
+
...l,
|
|
9
|
+
className: e(["cl-secondary-button", s]),
|
|
10
|
+
children: [a && /* @__PURE__ */ r(n, {
|
|
11
|
+
name: a,
|
|
12
|
+
className: "cl-secondary-button__icon",
|
|
13
|
+
size: c
|
|
14
|
+
}), /* @__PURE__ */ r("span", {
|
|
15
|
+
className: "cl-secondary-button__text",
|
|
16
|
+
children: o
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as SecondaryButton };
|
|
@@ -1,37 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
return /* @__PURE__ */ d(
|
|
21
|
-
i,
|
|
22
|
-
{
|
|
23
|
-
ref: s,
|
|
24
|
-
value: e,
|
|
25
|
-
onChange: m,
|
|
26
|
-
onBlur: n,
|
|
27
|
-
onKeyDown: a,
|
|
28
|
-
placeholder: r,
|
|
29
|
-
className: p,
|
|
30
|
-
rows: t ? 3 : void 0,
|
|
31
|
-
...c
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
g as EditView
|
|
37
|
-
};
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
//#region src/components/atoms/editable-text/EditView.tsx
|
|
4
|
+
var n = ({ multiline: n, value: r, placeholder: i, onChange: a, onBlur: o, onKeyDown: s, className: c, inputRef: l, ...u }) => /* @__PURE__ */ e(n ? "textarea" : "input", {
|
|
5
|
+
ref: l,
|
|
6
|
+
value: r,
|
|
7
|
+
onChange: t((e) => {
|
|
8
|
+
a(e.target.value);
|
|
9
|
+
}, [a]),
|
|
10
|
+
onBlur: o,
|
|
11
|
+
onKeyDown: s,
|
|
12
|
+
placeholder: i,
|
|
13
|
+
className: c,
|
|
14
|
+
rows: n ? 3 : void 0,
|
|
15
|
+
...u
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as EditView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-editable-text{color:var(--cl-base-font-color);border-radius:var(--cl-border-radius);
|
|
1
|
+
.cl-editable-text{color:var(--cl-base-font-color);border-radius:var(--cl-border-radius);font-family:var(--cl-core-font);font-size:var(--cl-typography-base-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5;display:inline-block}.cl-editable-text:hover,.cl-editable-text:focus{outline:var(--cl-accent-border);outline-offset:var(--cl-xs-gap)}.cl-editable-text_edit-mode{outline:var(--cl-accent-border);outline-offset:var(--cl-xs-gap);min-width:var(--cl-l-gap);background:0 0;border:none}.cl-editable-text_read-only:hover,.cl-editable-text_read-only:focus{outline:none}.cl-editable-text_empty{min-width:var(--cl-l-gap);outline:var(--cl-accent-border);outline-offset:var(--cl-xs-gap);min-height:24px}@media (width>=640px){.cl-editable-text{font-size:var(--cl-typography-base-tablet)}}@media (width>=1024px){.cl-editable-text{font-size:var(--cl-typography-base-desktop)}}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../utils/get-class-name.js";
|
|
2
|
+
import './EditableText.css';/* empty css */
|
|
3
|
+
import { EditView as t } from "./EditView.js";
|
|
4
|
+
import { ReadView as n } from "./ReadView.js";
|
|
5
|
+
import { useEditModeState as r } from "./useEditModeState.js";
|
|
6
|
+
import { useInputFocus as i } from "./useInputFocus.js";
|
|
7
|
+
import { useValueState as a } from "./useValueState.js";
|
|
8
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
9
|
+
import { useCallback as s, useRef as c } from "react";
|
|
10
|
+
//#region src/components/atoms/editable-text/EditableText.tsx
|
|
11
|
+
var l = ({ value: l, isEditMode: u, onChange: d, onClick: f, className: p, autoSelectTextOnEditMode: m = !1, multiline: h = !1, placeholder: g = "Click to edit...", readOnly: _ = !1, ...v }) => {
|
|
12
|
+
let y = c(null), { editMode: b, enterEditMode: x, exitEditMode: S } = r(u, _), { internalValue: C, updateValue: w, commitValue: T, resetValue: E } = a(l, d);
|
|
13
|
+
i(y, b, m, _);
|
|
14
|
+
let D = s((e) => {
|
|
15
|
+
f?.(e), x();
|
|
16
|
+
}, [f, x]), O = s(() => {
|
|
17
|
+
S(), T();
|
|
18
|
+
}, [S, T]), k = s((e) => {
|
|
19
|
+
e.key === "Enter" && !h && (e.preventDefault(), O()), e.key === "Escape" && (E(), S());
|
|
20
|
+
}, [
|
|
21
|
+
h,
|
|
22
|
+
O,
|
|
23
|
+
E,
|
|
24
|
+
S
|
|
25
|
+
]), A = e([
|
|
26
|
+
"cl-editable-text",
|
|
27
|
+
p,
|
|
28
|
+
{
|
|
29
|
+
"cl-editable-text_edit-mode": b,
|
|
30
|
+
"cl-editable-text_read-only": _,
|
|
31
|
+
"cl-editable-text_empty": !C
|
|
32
|
+
}
|
|
33
|
+
]);
|
|
34
|
+
return b && !_ ? /* @__PURE__ */ o(t, {
|
|
35
|
+
multiline: h,
|
|
36
|
+
value: C,
|
|
37
|
+
placeholder: g,
|
|
38
|
+
onChange: w,
|
|
39
|
+
onBlur: O,
|
|
40
|
+
onKeyDown: k,
|
|
41
|
+
className: A,
|
|
42
|
+
inputRef: y,
|
|
43
|
+
...v
|
|
44
|
+
}) : /* @__PURE__ */ o(n, {
|
|
45
|
+
value: C,
|
|
46
|
+
placeholder: g,
|
|
47
|
+
onClick: D,
|
|
48
|
+
className: A,
|
|
49
|
+
...v
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { l as default };
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
"aria-label": "Editable text",
|
|
19
|
-
...r,
|
|
20
|
-
children: t || a
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
export {
|
|
24
|
-
y as ReadView
|
|
25
|
-
};
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/atoms/editable-text/ReadView.tsx
|
|
3
|
+
var t = ({ value: t, placeholder: n, onClick: r, className: i, ...a }) => /* @__PURE__ */ e("span", {
|
|
4
|
+
onClick: r,
|
|
5
|
+
className: i,
|
|
6
|
+
role: "button",
|
|
7
|
+
tabIndex: 0,
|
|
8
|
+
onKeyDown: (e) => {
|
|
9
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r(e));
|
|
10
|
+
},
|
|
11
|
+
"aria-label": "Editable text",
|
|
12
|
+
...a,
|
|
13
|
+
children: t || n
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as ReadView };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
c as useEditModeState
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
//#region src/components/atoms/editable-text/useEditModeState.ts
|
|
3
|
+
var t = (t, n) => {
|
|
4
|
+
let [r, i] = e(!1), [a] = e(t !== void 0);
|
|
5
|
+
return {
|
|
6
|
+
editMode: a ? !!t : r,
|
|
7
|
+
enterEditMode: () => {
|
|
8
|
+
!a && !n && i(!0);
|
|
9
|
+
},
|
|
10
|
+
exitEditMode: () => {
|
|
11
|
+
a || i(!1);
|
|
12
|
+
},
|
|
13
|
+
isControlled: a
|
|
14
|
+
};
|
|
17
15
|
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { t as useEditModeState };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useEffect as e } from "react";
|
|
2
|
+
//#region src/components/atoms/editable-text/useInputFocus.ts
|
|
3
|
+
var t = (t, n, r, i) => {
|
|
4
|
+
e(() => {
|
|
5
|
+
n && t.current && !i && (t.current.focus(), r && t.current.select());
|
|
6
|
+
}, [
|
|
7
|
+
n,
|
|
8
|
+
r,
|
|
9
|
+
i,
|
|
10
|
+
t
|
|
11
|
+
]);
|
|
9
12
|
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as useInputFocus };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
m as useValueState
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/components/atoms/editable-text/useValueState.ts
|
|
3
|
+
var n = (n, r) => {
|
|
4
|
+
let [i, a] = t(n);
|
|
5
|
+
return e(() => {
|
|
6
|
+
a(n);
|
|
7
|
+
}, [n]), {
|
|
8
|
+
internalValue: i,
|
|
9
|
+
updateValue: (e) => {
|
|
10
|
+
a(e);
|
|
11
|
+
},
|
|
12
|
+
commitValue: () => {
|
|
13
|
+
i !== n && r?.(i);
|
|
14
|
+
},
|
|
15
|
+
resetValue: () => {
|
|
16
|
+
a(n);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
21
19
|
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { n as useValueState };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-error-message{
|
|
1
|
+
.cl-error-message{max-width:100%;z-index:var(--cl-z-index-popup);background-color:var(--cl-surface-a10);color:var(--cl-base-font-color);padding:var(--cl-s-gap) var(--cl-m-gap);border-radius:var(--cl-border-radius);border:var(--cl-danger-border);box-shadow:var(--cl-box-shadow);pointer-events:none;font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5;animation:.4s cl-fade-in;display:none}@media (width>=640px){.cl-error-message{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-error-message{font-size:var(--cl-typography-small-desktop)}}.cl-error-message_visible{display:block}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../utils/get-class-name.js";
|
|
2
|
+
import './ErrorMessage.css';/* empty css */
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/atoms/error-message/ErrorMessage.tsx
|
|
5
|
+
var n = ({ errorId: n, testId: r, message: i = "Error!", visible: a = !1, className: o }) => /* @__PURE__ */ t("span", {
|
|
6
|
+
id: n,
|
|
7
|
+
className: e([
|
|
8
|
+
"cl-error-message",
|
|
9
|
+
o,
|
|
10
|
+
{ "cl-error-message_visible": a }
|
|
11
|
+
]),
|
|
12
|
+
"data-testid": r,
|
|
13
|
+
"aria-hidden": !a,
|
|
14
|
+
"aria-live": "polite",
|
|
15
|
+
children: i
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-header{
|
|
1
|
+
.cl-header{color:var(--cl-base-font-color);margin:0}.cl-header:before{padding-right:var(--cl-m-gap)}.cl-header__h1{border-bottom:var(--cl-light-border);font-family:var(--cl-fancy-font);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;line-height:1.5;font-size:var(--cl-typography-h1-mobile)}@media (width>=640px){.cl-header__h1{font-size:var(--cl-typography-h1-tablet)}}@media (width>=1024px){.cl-header__h1{font-size:var(--cl-typography-h1-desktop)}}.cl-header__h2{border-bottom:var(--cl-light-border);font-family:var(--cl-fancy-font);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;line-height:1.5;font-size:var(--cl-typography-h2-mobile)}@media (width>=640px){.cl-header__h2{font-size:var(--cl-typography-h2-tablet)}}@media (width>=1024px){.cl-header__h2{font-size:var(--cl-typography-h2-desktop)}}.cl-header__h3{border-bottom:var(--cl-light-border);font-family:var(--cl-fancy-font);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;line-height:1.5;font-size:var(--cl-typography-h3-mobile)}@media (width>=640px){.cl-header__h3{font-size:var(--cl-typography-h3-tablet)}}@media (width>=1024px){.cl-header__h3{font-size:var(--cl-typography-h3-desktop)}}.cl-header__h4{font-family:var(--cl-fancy-font);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;line-height:1.5;font-size:var(--cl-typography-h4-mobile)}@media (width>=640px){.cl-header__h4{font-size:var(--cl-typography-h4-tablet)}}@media (width>=1024px){.cl-header__h4{font-size:var(--cl-typography-h4-desktop)}}.cl-header__h5{font-family:var(--cl-fancy-font);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;line-height:1.5;font-size:var(--cl-typography-h5-mobile)}@media (width>=640px){.cl-header__h5{font-size:var(--cl-typography-h5-tablet)}}@media (width>=1024px){.cl-header__h5{font-size:var(--cl-typography-h5-desktop)}}.cl-header__h6{font-family:var(--cl-fancy-font);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:700;line-height:1.5;font-size:var(--cl-typography-h6-mobile)}@media (width>=640px){.cl-header__h6{font-size:var(--cl-typography-h6-tablet)}}@media (width>=1024px){.cl-header__h6{font-size:var(--cl-typography-h6-desktop)}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../utils/get-class-name.js";
|
|
2
|
+
import './Header.css';/* empty css */
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/atoms/header/Header.tsx
|
|
5
|
+
var n = ({ as: n = "h1", icon: r, children: i, className: a, ...o }) => /* @__PURE__ */ t(n, {
|
|
6
|
+
className: e([
|
|
7
|
+
a,
|
|
8
|
+
"cl-header",
|
|
9
|
+
r,
|
|
10
|
+
{
|
|
11
|
+
"cl-header__h1": n === "h1",
|
|
12
|
+
"cl-header__h2": n === "h2",
|
|
13
|
+
"cl-header__h3": n === "h3",
|
|
14
|
+
"cl-header__h4": n === "h4",
|
|
15
|
+
"cl-header__h5": n === "h5",
|
|
16
|
+
"cl-header__h6": n === "h6"
|
|
17
|
+
}
|
|
18
|
+
]),
|
|
19
|
+
...o,
|
|
20
|
+
children: i
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-icon{color:var(--cl-base-font-color);
|
|
1
|
+
.cl-icon{color:var(--cl-base-font-color);width:var(--cl-icon-size);height:var(--cl-icon-size);justify-content:center;align-items:center;display:inline-flex}.cl-icon_extra-small{font-size:var(--cl-typography-small-mobile)}.cl-icon_small{font-size:var(--cl-typography-base-mobile)}.cl-icon_medium{font-size:var(--cl-typography-h5-mobile)}.cl-icon_large{font-size:var(--cl-typography-h4-mobile)}.cl-icon_xlarge{font-size:var(--cl-typography-h3-mobile)}.cl-icon_2xlarge{font-size:var(--cl-typography-h2-mobile)}@media (width>=640px){.cl-icon_extra-small{font-size:var(--cl-typography-small-tablet)}.cl-icon_small{font-size:var(--cl-typography-base-tablet)}.cl-icon_medium{font-size:var(--cl-typography-h5-tablet)}.cl-icon_large{font-size:var(--cl-typography-h4-tablet)}.cl-icon_xlarge{font-size:var(--cl-typography-h3-tablet)}.cl-icon_2xlarge{font-size:var(--cl-typography-h2-tablet)}}@media (width>=1024px){.cl-icon_extra-small{font-size:var(--cl-typography-small-desktop)}.cl-icon_small{font-size:var(--cl-typography-base-desktop)}.cl-icon_medium{font-size:var(--cl-typography-h5-desktop)}.cl-icon_large{font-size:var(--cl-typography-h4-desktop)}.cl-icon_xlarge{font-size:var(--cl-typography-h3-desktop)}.cl-icon_2xlarge{font-size:var(--cl-typography-h2-desktop)}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getClassName as e } from "../../../utils/get-class-name.js";
|
|
2
|
+
import { ElementSize as t } from "../../../enums/element-size.js";
|
|
3
|
+
import './Icon.css';/* empty css */
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/atoms/icon/Icon.tsx
|
|
6
|
+
var r = ({ name: r, testId: i, className: a, hidden: o, size: s = t.Medium, ...c }) => {
|
|
7
|
+
if (!r) return null;
|
|
8
|
+
let l = e([
|
|
9
|
+
a,
|
|
10
|
+
"cl-icon",
|
|
11
|
+
r,
|
|
12
|
+
{
|
|
13
|
+
"cl-icon_extra-small": s === t.ExtraSmall,
|
|
14
|
+
"cl-icon_small": s === t.Small,
|
|
15
|
+
"cl-icon_medium": s === t.Medium,
|
|
16
|
+
"cl-icon_large": s === t.Large,
|
|
17
|
+
"cl-icon_xlarge": s === t.ExtraLarge,
|
|
18
|
+
"cl-icon_2xlarge": s === t.ExtraExtraLarge
|
|
19
|
+
}
|
|
20
|
+
]);
|
|
21
|
+
return /* @__PURE__ */ n("span", {
|
|
22
|
+
"data-testid": i,
|
|
23
|
+
className: l,
|
|
24
|
+
"aria-hidden": o,
|
|
25
|
+
...c
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { r as default };
|
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
width: s,
|
|
17
|
-
height: c,
|
|
18
|
-
loading: i,
|
|
19
|
-
decoding: r,
|
|
20
|
-
sizes: e,
|
|
21
|
-
className: "cl-image__img",
|
|
22
|
-
onError: g
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
export {
|
|
26
|
-
l as BasicImage
|
|
27
|
-
};
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/atoms/image/BasicImage.tsx
|
|
3
|
+
var t = ({ src: t, alt: n, width: r, height: i, sizes: a, loading: o = "lazy", decoding: s = "async", onError: c }) => /* @__PURE__ */ e("img", {
|
|
4
|
+
src: t,
|
|
5
|
+
alt: n,
|
|
6
|
+
width: r,
|
|
7
|
+
height: i,
|
|
8
|
+
loading: o,
|
|
9
|
+
decoding: s,
|
|
10
|
+
sizes: a,
|
|
11
|
+
className: "cl-image__img",
|
|
12
|
+
onError: c
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { t as BasicImage };
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import { IconName as e } from "../../../enums/icon-name.js";
|
|
2
|
+
import t from "../icon/Icon2.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/atoms/image/FallBackImage.tsx
|
|
5
|
+
var i = () => /* @__PURE__ */ r("div", {
|
|
6
|
+
className: "cl-image__fallback",
|
|
7
|
+
children: [/* @__PURE__ */ n(t, {
|
|
8
|
+
name: e.Image,
|
|
9
|
+
className: "cl-image__fallback-icon"
|
|
10
|
+
}), /* @__PURE__ */ n("span", {
|
|
11
|
+
className: "cl-image__fallback-text",
|
|
12
|
+
children: "Image not available"
|
|
13
|
+
})]
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { i as FallbackImage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.cl-image{object-fit:cover;border-radius:var(--cl-border-radius)}.cl-image__img{
|
|
1
|
+
.cl-image{object-fit:cover;border-radius:var(--cl-border-radius)}.cl-image__img{border-radius:var(--cl-border-radius);max-width:100%;height:auto}.cl-image__picture{object-fit:cover;border-radius:var(--cl-border-radius);display:block}.cl-image__fallback{flex-direction:column;justify-content:space-between;align-items:center;display:flex}.cl-image__fallback-icon{width:148px;height:148px}.cl-image__fallback-icon:before{font-size:6rem}.cl-image__fallback-text{text-align:center;padding-top:var(--cl-s-gap);color:var(--cl-base-font-color);font-family:var(--cl-core-font);font-size:var(--cl-typography-small-mobile);letter-spacing:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-weight:400;line-height:1.5}@media (width>=640px){.cl-image__fallback-text{font-size:var(--cl-typography-small-tablet)}}@media (width>=1024px){.cl-image__fallback-text{font-size:var(--cl-typography-small-desktop)}}
|