@unoff/ui 1.21.0 → 1.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Card.css +1 -1
- package/dist/assets/FormItem.css +1 -1
- package/dist/assets/Layout.css +1 -1
- package/dist/assets/MultipleSlider.css +1 -1
- package/dist/assets/Popin.css +1 -1
- package/dist/assets/SimpleSlider.css +1 -1
- package/dist/assets/styles/icons/icons.css +1 -1
- package/dist/assets/styles/icons/styles/figma.css +1 -1
- package/dist/assets/styles/icons/styles/framer.css +1 -1
- package/dist/assets/styles/icons/styles/penpot.css +1 -1
- package/dist/assets/styles/icons/styles/sketch.css +1 -1
- package/dist/components/actions/accordion/Accordion.d.ts +0 -1
- package/dist/components/actions/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/actions/accordion/Accordion.js +6 -6
- package/dist/components/actions/accordion/Accordion.js.map +1 -1
- package/dist/components/actions/button/Button.d.ts +2 -3
- package/dist/components/actions/button/Button.d.ts.map +1 -1
- package/dist/components/actions/button/Button.figma.js +1 -1
- package/dist/components/actions/button/Button.js +87 -88
- package/dist/components/actions/button/Button.js.map +1 -1
- package/dist/components/actions/card/Card.d.ts +0 -1
- package/dist/components/actions/card/Card.d.ts.map +1 -1
- package/dist/components/actions/card/Card.js +1 -1
- package/dist/components/actions/card/Card.js.map +1 -1
- package/dist/components/actions/knob/Knob.d.ts +2 -3
- package/dist/components/actions/knob/Knob.d.ts.map +1 -1
- package/dist/components/actions/knob/Knob.js +1 -1
- package/dist/components/actions/knob/Knob.js.map +1 -1
- package/dist/components/actions/menu/Menu.d.ts +2 -3
- package/dist/components/actions/menu/Menu.d.ts.map +1 -1
- package/dist/components/actions/menu/Menu.js +4 -4
- package/dist/components/actions/menu/Menu.js.map +1 -1
- package/dist/components/assets/avatar/Avatar.d.ts +0 -1
- package/dist/components/assets/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/assets/avatar/Avatar.js +6 -6
- package/dist/components/assets/avatar/Avatar.js.map +1 -1
- package/dist/components/assets/icon/Icon.d.ts +0 -1
- package/dist/components/assets/icon/Icon.d.ts.map +1 -1
- package/dist/components/assets/icon/Icon.figma.js +1 -1
- package/dist/components/assets/icon/Icon.js +6 -6
- package/dist/components/assets/icon/Icon.js.map +1 -1
- package/dist/components/assets/section-title/SectionTitle.d.ts +0 -1
- package/dist/components/assets/section-title/SectionTitle.d.ts.map +1 -1
- package/dist/components/assets/section-title/SectionTitle.js +1 -1
- package/dist/components/assets/section-title/SectionTitle.js.map +1 -1
- package/dist/components/assets/text/Text.d.ts +0 -1
- package/dist/components/assets/text/Text.d.ts.map +1 -1
- package/dist/components/assets/text/Text.js +1 -1
- package/dist/components/assets/text/Text.js.map +1 -1
- package/dist/components/assets/thumbnail/Thumbnail.d.ts +0 -1
- package/dist/components/assets/thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/components/dialogs/consent/Consent.d.ts +2 -3
- package/dist/components/dialogs/consent/Consent.d.ts.map +1 -1
- package/dist/components/dialogs/consent/Consent.js +1 -1
- package/dist/components/dialogs/consent/Consent.js.map +1 -1
- package/dist/components/dialogs/dialog/Dialog.d.ts +0 -1
- package/dist/components/dialogs/dialog/Dialog.d.ts.map +1 -1
- package/dist/components/dialogs/dialog/Dialog.js +4 -4
- package/dist/components/dialogs/dialog/Dialog.js.map +1 -1
- package/dist/components/dialogs/message/Message.d.ts +0 -1
- package/dist/components/dialogs/message/Message.js +1 -1
- package/dist/components/dialogs/message/Message.js.map +1 -1
- package/dist/components/dialogs/notification/Notification.d.ts +0 -1
- package/dist/components/dialogs/notification/Notification.d.ts.map +1 -1
- package/dist/components/dialogs/notification/Notification.js +4 -4
- package/dist/components/dialogs/notification/Notification.js.map +1 -1
- package/dist/components/dialogs/semantic-message/SemanticMessage.d.ts +2 -3
- package/dist/components/dialogs/semantic-message/SemanticMessage.d.ts.map +1 -1
- package/dist/components/dialogs/semantic-message/SemanticMessage.js +1 -1
- package/dist/components/dialogs/semantic-message/SemanticMessage.js.map +1 -1
- package/dist/components/inputs/dropdown/Dropdown.d.ts +2 -3
- package/dist/components/inputs/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/Dropdown.figma.js +1 -1
- package/dist/components/inputs/dropdown/Dropdown.js +1 -1
- package/dist/components/inputs/dropdown/Dropdown.js.map +1 -1
- package/dist/components/inputs/dropzone/Dropzone.d.ts +2 -3
- package/dist/components/inputs/dropzone/Dropzone.d.ts.map +1 -1
- package/dist/components/inputs/dropzone/Dropzone.js +4 -4
- package/dist/components/inputs/dropzone/Dropzone.js.map +1 -1
- package/dist/components/inputs/input/Input.d.ts +2 -3
- package/dist/components/inputs/input/Input.d.ts.map +1 -1
- package/dist/components/inputs/input/Input.figma.js +1 -1
- package/dist/components/inputs/input/Input.js +1 -1
- package/dist/components/inputs/input/Input.js.map +1 -1
- package/dist/components/inputs/inputs-bar/InputsBar.d.ts +0 -1
- package/dist/components/inputs/inputs-bar/InputsBar.d.ts.map +1 -1
- package/dist/components/inputs/inputs-bar/InputsBar.js +4 -4
- package/dist/components/inputs/inputs-bar/InputsBar.js.map +1 -1
- package/dist/components/inputs/multiple-slider/MultipleSlider.d.ts +19 -12
- package/dist/components/inputs/multiple-slider/MultipleSlider.d.ts.map +1 -1
- package/dist/components/inputs/multiple-slider/MultipleSlider.js +283 -235
- package/dist/components/inputs/multiple-slider/MultipleSlider.js.map +1 -1
- package/dist/components/inputs/multiple-slider/actions/addStop.d.ts.map +1 -1
- package/dist/components/inputs/multiple-slider/actions/deleteStop.d.ts.map +1 -1
- package/dist/components/inputs/multiple-slider/actions/shiftLeftStop.d.ts +1 -1
- package/dist/components/inputs/multiple-slider/actions/shiftLeftStop.d.ts.map +1 -1
- package/dist/components/inputs/multiple-slider/actions/shiftRightStop.d.ts +1 -1
- package/dist/components/inputs/multiple-slider/actions/shiftRightStop.d.ts.map +1 -1
- package/dist/components/inputs/select/Select.d.ts +3 -4
- package/dist/components/inputs/select/Select.d.ts.map +1 -1
- package/dist/components/inputs/select/Select.js +1 -1
- package/dist/components/inputs/select/Select.js.map +1 -1
- package/dist/components/inputs/simple-slider/SimpleSlider.d.ts +15 -5
- package/dist/components/inputs/simple-slider/SimpleSlider.d.ts.map +1 -1
- package/dist/components/inputs/simple-slider/SimpleSlider.js +116 -87
- package/dist/components/inputs/simple-slider/SimpleSlider.js.map +1 -1
- package/dist/components/lists/actions-item/ActionsItem.d.ts +0 -1
- package/dist/components/lists/actions-item/ActionsItem.js +1 -1
- package/dist/components/lists/actions-item/ActionsItem.js.map +1 -1
- package/dist/components/lists/actions-list/ActionsList.d.ts +4 -5
- package/dist/components/lists/actions-list/ActionsList.d.ts.map +1 -1
- package/dist/components/lists/actions-list/ActionsList.js +1 -1
- package/dist/components/lists/actions-list/ActionsList.js.map +1 -1
- package/dist/components/lists/color-item/ColorItem.d.ts +0 -1
- package/dist/components/lists/color-item/ColorItem.d.ts.map +1 -1
- package/dist/components/lists/color-item/ColorItem.js +1 -1
- package/dist/components/lists/color-item/ColorItem.js.map +1 -1
- package/dist/components/lists/draggable-item/DraggableItem.d.ts +2 -3
- package/dist/components/lists/draggable-item/DraggableItem.d.ts.map +1 -1
- package/dist/components/lists/draggable-item/DraggableItem.js +6 -6
- package/dist/components/lists/draggable-item/DraggableItem.js.map +1 -1
- package/dist/components/lists/keyboard-shortcut-item/KeyboardShortcutItem.d.ts +0 -1
- package/dist/components/lists/keyboard-shortcut-item/KeyboardShortcutItem.d.ts.map +1 -1
- package/dist/components/lists/keyboard-shortcut-item/KeyboardShortcutItem.js +1 -1
- package/dist/components/lists/keyboard-shortcut-item/KeyboardShortcutItem.js.map +1 -1
- package/dist/components/lists/members-list/MembersList.d.ts +0 -1
- package/dist/components/lists/sortable-list/SortableList.d.ts +2 -3
- package/dist/components/lists/sortable-list/SortableList.d.ts.map +1 -1
- package/dist/components/lists/sortable-list/SortableList.js.map +1 -1
- package/dist/components/lists/tabs/Tabs.d.ts +0 -1
- package/dist/components/lists/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/lists/tabs/Tabs.figma.js +1 -1
- package/dist/components/lists/tabs/Tabs.js +1 -1
- package/dist/components/lists/tabs/Tabs.js.map +1 -1
- package/dist/components/slots/bar/Bar.d.ts +1 -2
- package/dist/components/slots/bar/Bar.d.ts.map +1 -1
- package/dist/components/slots/bar/Bar.js.map +1 -1
- package/dist/components/slots/draggable-window/DraggableWindow.d.ts +0 -1
- package/dist/components/slots/draggable-window/DraggableWindow.d.ts.map +1 -1
- package/dist/components/slots/draggable-window/DraggableWindow.js +6 -6
- package/dist/components/slots/draggable-window/DraggableWindow.js.map +1 -1
- package/dist/components/slots/drawer/Drawer.d.ts +1 -2
- package/dist/components/slots/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/slots/drawer/Drawer.js.map +1 -1
- package/dist/components/slots/form-item/FormItem.d.ts +0 -1
- package/dist/components/slots/form-item/FormItem.d.ts.map +1 -1
- package/dist/components/slots/form-item/FormItem.js +1 -1
- package/dist/components/slots/form-item/FormItem.js.map +1 -1
- package/dist/components/slots/layout/Layout.d.ts +0 -1
- package/dist/components/slots/layout/Layout.d.ts.map +1 -1
- package/dist/components/slots/layout/Layout.js.map +1 -1
- package/dist/components/slots/list/List.d.ts +0 -1
- package/dist/components/slots/list/List.d.ts.map +1 -1
- package/dist/components/slots/list/List.js +4 -4
- package/dist/components/slots/list/List.js.map +1 -1
- package/dist/components/slots/popin/Popin.d.ts +0 -1
- package/dist/components/slots/popin/Popin.d.ts.map +1 -1
- package/dist/components/slots/popin/Popin.js +1 -1
- package/dist/components/slots/popin/Popin.js.map +1 -1
- package/dist/components/slots/section/Section.d.ts +1 -2
- package/dist/components/slots/section/Section.d.ts.map +1 -1
- package/dist/components/slots/section/Section.js.map +1 -1
- package/dist/components/slots/simple-item/SimpleItem.d.ts +0 -1
- package/dist/components/slots/simple-item/SimpleItem.js.map +1 -1
- package/dist/components/tags/chip/Chip.d.ts +0 -1
- package/dist/components/tags/chip/Chip.d.ts.map +1 -1
- package/dist/components/tags/chip/Chip.figma.js +1 -1
- package/dist/components/tags/chip/Chip.js +6 -6
- package/dist/components/tags/chip/Chip.js.map +1 -1
- package/dist/components/tags/color-chip/ColorChip.d.ts +2 -3
- package/dist/components/tags/color-chip/ColorChip.d.ts.map +1 -1
- package/dist/components/tags/color-chip/ColorChip.js.map +1 -1
- package/dist/components/tags/icon-chip/IconChip.d.ts +2 -3
- package/dist/components/tags/icon-chip/IconChip.d.ts.map +1 -1
- package/dist/components/tags/icon-chip/IconChip.js +4 -4
- package/dist/components/tags/icon-chip/IconChip.js.map +1 -1
- package/dist/components/tags/tooltip/Tooltip.d.ts +0 -1
- package/dist/components/tags/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tags/tooltip/Tooltip.js +1 -1
- package/dist/components/tags/tooltip/Tooltip.js.map +1 -1
- package/dist/do-classnames-DSDFCvzy.js.map +1 -1
- package/dist/do-map-2nhWP1KI.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/index_react-BkjUklDQ.js +18392 -0
- package/dist/index_react-BkjUklDQ.js.map +1 -0
- package/dist/styles/icons/icons.module.js +114 -110
- package/dist/styles/icons/icons.module.js.map +1 -1
- package/dist/tests/setup.d.ts +0 -1
- package/dist/types/consent.types.d.ts +0 -1
- package/dist/types/consent.types.d.ts.map +1 -1
- package/dist/types/icon.types.d.ts +2 -1
- package/dist/types/icon.types.d.ts.map +1 -1
- package/dist/types/icon.types.js +114 -1
- package/dist/types/icon.types.js.map +1 -1
- package/dist/types/list.types.d.ts +0 -1
- package/package.json +15 -12
- package/dist/index_react-CmuCVQet.js +0 -13799
- package/dist/index_react-CmuCVQet.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/accordion/Accordion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/accordion/Accordion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAI1C,OAAO,kBAAkB,CAAA;AAEzB,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,qCAAqC;QACrC,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,uCAAuC;QACvC,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,KAC5D,IAAI,CAAA;IACT;;OAEG;IACH,OAAO,EAAE,CACP,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,KAC5D,IAAI,CAAA;CACV;AAED,QAAA,MAAM,SAAS,GAAI,OAAO,cAAc,4CAwGvC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../../assets/Accordion.css';
|
|
2
2
|
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import w from "
|
|
4
|
-
import N from "../../
|
|
5
|
-
import
|
|
3
|
+
import { t as w } from "../../../do-classnames-DSDFCvzy.js";
|
|
4
|
+
import N from "../../tags/chip/Chip.js";
|
|
5
|
+
import g from "../../assets/section-title/SectionTitle.js";
|
|
6
6
|
import l from "../button/Button.js";
|
|
7
7
|
const E = (s) => {
|
|
8
8
|
const {
|
|
@@ -25,7 +25,7 @@ const E = (s) => {
|
|
|
25
25
|
return /* @__PURE__ */ n(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
|
-
className:
|
|
28
|
+
className: w([
|
|
29
29
|
"accordion",
|
|
30
30
|
c && "accordion--expanded",
|
|
31
31
|
e && "accordion--blocked"
|
|
@@ -41,7 +41,7 @@ const E = (s) => {
|
|
|
41
41
|
className: "accordion__row__left",
|
|
42
42
|
role: "presentation",
|
|
43
43
|
children: /* @__PURE__ */ i(
|
|
44
|
-
|
|
44
|
+
g,
|
|
45
45
|
{
|
|
46
46
|
label: a,
|
|
47
47
|
indicator: p,
|
|
@@ -81,7 +81,7 @@ const E = (s) => {
|
|
|
81
81
|
action: (o) => u(o)
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
|
-
(e || d) && /* @__PURE__ */ i(
|
|
84
|
+
(e || d) && /* @__PURE__ */ i(N, { children: d ? "New" : "Pro" })
|
|
85
85
|
]
|
|
86
86
|
}
|
|
87
87
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../../src/components/actions/accordion/Accordion.tsx"],"sourcesContent":["import { IconList } from '@tps/icon.types'\nimport Chip from '@components/tags/chip/Chip'\nimport SectionTitle from '@components/assets/section-title/SectionTitle'\nimport
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../../src/components/actions/accordion/Accordion.tsx"],"sourcesContent":["import { doClassnames } from '@unoff/utils'\nimport { IconList } from '@tps/icon.types'\nimport Chip from '@components/tags/chip/Chip'\nimport SectionTitle from '@components/assets/section-title/SectionTitle'\nimport Button from '../button/Button'\nimport './accordion.scss'\n\nexport interface AccordionProps {\n /**\n * Title label of the accordion\n */\n label: string\n /**\n * Optional indicator (number or text) displayed next to the label\n */\n indicator?: string | number\n /**\n * Icon to display in the add button\n * @default 'plus'\n */\n icon?: IconList\n /**\n * Helper text displayed near the title\n */\n helper?: string\n /**\n * Helper texts for the action buttons\n */\n helpers?: {\n /** Helper text for the add button */\n add?: string\n /** Helper text for the empty button */\n empty?: string\n }\n /**\n * Whether the accordion is expanded\n */\n isExpanded: boolean\n /**\n * Whether the accordion is blocked (disabled)\n * @default false\n */\n isBlocked?: boolean\n /**\n * Whether to show a \"New\" badge\n * @default false\n */\n isNew?: boolean\n /**\n * Content to display when accordion is expanded\n */\n children?: React.ReactNode\n /**\n * Callback fired when the add button is clicked\n */\n onAdd: (\n event: React.MouseEvent<Element> | React.KeyboardEvent<Element>\n ) => void\n /**\n * Callback fired when the empty button is clicked\n */\n onEmpty: (\n event: React.MouseEvent<Element> | React.KeyboardEvent<Element>\n ) => void\n}\n\nconst Accordion = (props: AccordionProps) => {\n const {\n label,\n indicator,\n icon = 'plus',\n helper,\n helpers,\n isExpanded,\n isBlocked = false,\n isNew = false,\n children,\n onAdd,\n onEmpty,\n } = props\n\n const handleAdd = (\n event: React.MouseEvent<Element> | React.KeyboardEvent<Element>\n ) => {\n event.stopPropagation()\n onAdd(event)\n }\n\n const handleEmpty = (\n event: React.MouseEvent<Element> | React.KeyboardEvent<Element>\n ) => {\n event.stopPropagation()\n onEmpty(event)\n }\n\n return (\n <div\n className={doClassnames([\n 'accordion',\n isExpanded && 'accordion--expanded',\n isBlocked && 'accordion--blocked',\n ])}\n onMouseDown={(e) => {\n if (\n (e.target as HTMLElement).dataset.feature === undefined &&\n !isExpanded &&\n !isBlocked\n )\n onAdd(e as React.MouseEvent<HTMLDivElement, MouseEvent>)\n }}\n >\n <div className=\"accordion__row\">\n <div\n className=\"accordion__row__left\"\n role=\"presentation\"\n >\n <SectionTitle\n label={label}\n indicator={indicator}\n helper={helper}\n />\n </div>\n <div\n className=\"accordion__row__right\"\n role=\"group\"\n >\n {isExpanded ? (\n <Button\n type=\"icon\"\n icon=\"minus\"\n iconClassName=\"accordion__row__icon\"\n helper={\n helpers?.empty !== undefined\n ? {\n label: helpers.empty,\n }\n : undefined\n }\n action={(e) => handleEmpty(e)}\n />\n ) : (\n <Button\n type=\"icon\"\n icon={icon}\n iconClassName=\"accordion__row__icon\"\n helper={\n helpers?.add !== undefined\n ? {\n label: helpers.add,\n }\n : undefined\n }\n isDisabled={isBlocked}\n isBlocked={isBlocked}\n action={(e) => handleAdd(e)}\n />\n )}\n {(isBlocked || isNew) && <Chip>{isNew ? 'New' : 'Pro'}</Chip>}\n </div>\n </div>\n {isExpanded && (\n <div\n id={`accordion-content-${label}`}\n role=\"region\"\n >\n {children}\n </div>\n )}\n </div>\n )\n}\n\nexport default Accordion\n"],"names":["Accordion","props","label","indicator","icon","helper","helpers","isExpanded","isBlocked","isNew","children","onAdd","onEmpty","handleAdd","event","handleEmpty","jsxs","doClassnames","e","jsx","SectionTitle","Button","Chip"],"mappings":";;;;;AAkEA,MAAMA,IAAY,CAACC,MAA0B;AAC3C,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,OAAAC,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,EAAA,IACEX,GAEEY,IAAY,CAChBC,MACG;AACH,IAAAA,EAAM,gBAAA,GACNH,EAAMG,CAAK;AAAA,EACb,GAEMC,IAAc,CAClBD,MACG;AACH,IAAAA,EAAM,gBAAA,GACNF,EAAQE,CAAK;AAAA,EACf;AAEA,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAa;AAAA,QACtB;AAAA,QACAV,KAAc;AAAA,Q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A;AAAA,UAAA;AAAA,QACxD,GACF;AAAA,QACCF,KACC,gBAAAY;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,qBAAqBjB,CAAK;AAAA,YAC9B,MAAK;AAAA,YAEJ,UAAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IconList } from '../../../types/icon.types';
|
|
3
|
-
|
|
4
3
|
export interface ButtonProps {
|
|
5
4
|
/**
|
|
6
5
|
* Visual style of the button
|
|
@@ -127,11 +126,11 @@ export interface ButtonProps {
|
|
|
127
126
|
*/
|
|
128
127
|
onUnblock?: React.MouseEventHandler & React.KeyboardEventHandler;
|
|
129
128
|
}
|
|
130
|
-
interface
|
|
129
|
+
interface ButtonState {
|
|
131
130
|
isTooltipVisible: boolean;
|
|
132
131
|
documentWidth: number;
|
|
133
132
|
}
|
|
134
|
-
export default class Button extends React.Component<ButtonProps,
|
|
133
|
+
export default class Button extends React.Component<ButtonProps, ButtonState> {
|
|
135
134
|
buttonRef: React.RefObject<HTMLButtonElement>;
|
|
136
135
|
static defaultProps: Partial<ButtonProps>;
|
|
137
136
|
constructor(props: ButtonProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,eAAe,CAAA;AAEtB,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EACA,SAAS,GACT,WAAW,GACX,UAAU,GACV,aAAa,GACb,aAAa,GACb,MAAM,CAAA;IACV;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;IACpC;;O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H,YAAY,CAAC,EAAE;QACb,gCAAgC;QAChC,SAAS,EAAE,OAAO,CAAA;QAClB,iCAAiC;QACjC,IAAI,EAAE,QAAQ,CAAA;KACf,CAAA;IACD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,oBAAoB,CAAA;IAC7D;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,oBAAoB,CAAA;CACjE;AAED,UAAU,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,eAAe,CAAA;AAEtB,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EACA,SAAS,GACT,WAAW,GACX,UAAU,GACV,aAAa,GACb,aAAa,GACb,MAAM,CAAA;IACV;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;IACpC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;IAC9B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAC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,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,oBAAoB,CAAA;IAC7D;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,oBAAoB,CAAA;CACjE;AAED,UAAU,WAAW;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC;IAC3E,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAoB;IAEjE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,WAAW,CAAC,CAWxC;gBAEW,KAAK,EAAE,WAAW;IAS9B,iBAAiB,aAShB;IAED,oBAAoB,aAEnB;IAGD,YAAY,aAEX;IAGD,MAAM,4DA0BL;IAED,MAAM,gDAyHL;IAED,UAAU,gDA2BT;IAED,IAAI,gDA6FH;IAGD,MAAM;CAMP"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import '../../../assets/Button.css';
|
|
2
|
-
import { jsxs as m, jsx as
|
|
2
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import I from "react";
|
|
4
|
+
import { t as w } from "../../../do-classnames-DSDFCvzy.js";
|
|
4
5
|
import g from "../../../styles/layouts.module.js";
|
|
5
6
|
import E from "../../tags/tooltip/Tooltip.js";
|
|
6
7
|
import _ from "../../tags/icon-chip/IconChip.js";
|
|
7
8
|
import S from "../../tags/chip/Chip.js";
|
|
8
9
|
import { Icon as N } from "../../assets/icon/Icon.js";
|
|
9
|
-
import { t as w } from "../../../do-classnames-DSDFCvzy.js";
|
|
10
10
|
class P extends I.Component {
|
|
11
11
|
buttonRef = I.createRef();
|
|
12
12
|
static defaultProps = {
|
|
@@ -21,16 +21,16 @@ class P extends I.Component {
|
|
|
21
21
|
isDisabled: !1,
|
|
22
22
|
isNew: !1
|
|
23
23
|
};
|
|
24
|
-
constructor(
|
|
25
|
-
super(
|
|
24
|
+
constructor(t) {
|
|
25
|
+
super(t), this.state = {
|
|
26
26
|
isTooltipVisible: !1,
|
|
27
27
|
documentWidth: document.documentElement.clientWidth
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
// Lifecycle
|
|
31
31
|
componentDidMount = () => {
|
|
32
|
-
const { isAutofocus:
|
|
33
|
-
|
|
32
|
+
const { isAutofocus: t } = this.props;
|
|
33
|
+
t && setTimeout(() => {
|
|
34
34
|
this.buttonRef.current && this.buttonRef.current.focus();
|
|
35
35
|
}, 1), window.addEventListener("resize", this.handleResize);
|
|
36
36
|
};
|
|
@@ -43,45 +43,45 @@ class P extends I.Component {
|
|
|
43
43
|
};
|
|
44
44
|
// Templates
|
|
45
45
|
Status = () => {
|
|
46
|
-
const {
|
|
47
|
-
if (
|
|
46
|
+
const { warning: t, preview: n, isBlocked: a, isNew: e, onUnblock: c } = this.props;
|
|
47
|
+
if (t || a || e)
|
|
48
48
|
return /* @__PURE__ */ m("div", { className: "button__status", children: [
|
|
49
|
-
|
|
49
|
+
t !== void 0 && /* @__PURE__ */ i(
|
|
50
50
|
_,
|
|
51
51
|
{
|
|
52
52
|
iconType: "PICTO",
|
|
53
53
|
iconName: "warning",
|
|
54
|
-
text:
|
|
55
|
-
pin:
|
|
56
|
-
type:
|
|
54
|
+
text: t.label,
|
|
55
|
+
pin: t.pin,
|
|
56
|
+
type: t.type
|
|
57
57
|
}
|
|
58
58
|
),
|
|
59
|
-
(
|
|
59
|
+
(a || e) && /* @__PURE__ */ i(
|
|
60
60
|
S,
|
|
61
61
|
{
|
|
62
|
-
preview:
|
|
62
|
+
preview: n,
|
|
63
63
|
isSolo: !0,
|
|
64
|
-
action:
|
|
65
|
-
children:
|
|
64
|
+
action: a ? c : void 0,
|
|
65
|
+
children: e ? "New" : "Pro"
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
] });
|
|
69
69
|
};
|
|
70
70
|
Button = () => {
|
|
71
71
|
const {
|
|
72
|
-
type:
|
|
73
|
-
icon:
|
|
74
|
-
size:
|
|
75
|
-
helper:
|
|
76
|
-
feature:
|
|
77
|
-
hasMultipleActions:
|
|
72
|
+
type: t,
|
|
73
|
+
icon: n,
|
|
74
|
+
size: a,
|
|
75
|
+
helper: e,
|
|
76
|
+
feature: c,
|
|
77
|
+
hasMultipleActions: b,
|
|
78
78
|
isLoading: o,
|
|
79
|
-
isDisabled:
|
|
80
|
-
isBlocked:
|
|
81
|
-
action:
|
|
82
|
-
label:
|
|
83
|
-
shouldReflow:
|
|
84
|
-
} = this.props, { isTooltipVisible:
|
|
79
|
+
isDisabled: l,
|
|
80
|
+
isBlocked: s,
|
|
81
|
+
action: r,
|
|
82
|
+
label: u,
|
|
83
|
+
shouldReflow: p
|
|
84
|
+
} = this.props, { isTooltipVisible: T, documentWidth: d } = this.state, v = p?.isEnabled && d <= 460, y = () => v ? void 0 : u, L = () => v ? u : e?.label, h = () => v ? u !== void 0 : e !== void 0, k = () => v && p?.icon !== void 0 ? p.icon : n;
|
|
85
85
|
return /* @__PURE__ */ m("div", { className: g["snackbar--medium"], children: [
|
|
86
86
|
/* @__PURE__ */ m(
|
|
87
87
|
"button",
|
|
@@ -89,20 +89,20 @@ class P extends I.Component {
|
|
|
89
89
|
role: "button",
|
|
90
90
|
className: w([
|
|
91
91
|
"button",
|
|
92
|
-
`button--${
|
|
93
|
-
`button--${
|
|
92
|
+
`button--${t}`,
|
|
93
|
+
`button--${a}`,
|
|
94
94
|
o && "button--loading",
|
|
95
|
-
|
|
95
|
+
s && "button--blocked"
|
|
96
96
|
]),
|
|
97
|
-
"data-feature":
|
|
98
|
-
disabled:
|
|
99
|
-
"aria-label": typeof (y() ||
|
|
100
|
-
"aria-disabled":
|
|
97
|
+
"data-feature": c,
|
|
98
|
+
disabled: l || s,
|
|
99
|
+
"aria-label": typeof (y() || e?.label) == "string" ? y() || e?.label : void 0,
|
|
100
|
+
"aria-disabled": l || s,
|
|
101
101
|
"aria-busy": o,
|
|
102
102
|
onKeyDown: (f) => {
|
|
103
|
-
(f.key === " " || f.key === "Enter") && (!
|
|
103
|
+
(f.key === " " || f.key === "Enter") && (!l || !s) && r?.(f), f.key === "Escape" && f.target.blur();
|
|
104
104
|
},
|
|
105
|
-
onMouseDown:
|
|
105
|
+
onMouseDown: l || s ? void 0 : r,
|
|
106
106
|
onMouseEnter: () => {
|
|
107
107
|
h() && this.setState({ isTooltipVisible: !0 });
|
|
108
108
|
},
|
|
@@ -118,12 +118,12 @@ class P extends I.Component {
|
|
|
118
118
|
tabIndex: 0,
|
|
119
119
|
ref: this.buttonRef,
|
|
120
120
|
children: [
|
|
121
|
-
k() !== void 0 && /* @__PURE__ */
|
|
121
|
+
k() !== void 0 && /* @__PURE__ */ i(
|
|
122
122
|
"span",
|
|
123
123
|
{
|
|
124
124
|
className: "button__icon",
|
|
125
125
|
"aria-hidden": "true",
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ i(
|
|
127
127
|
N,
|
|
128
128
|
{
|
|
129
129
|
type: "PICTO",
|
|
@@ -132,13 +132,13 @@ class P extends I.Component {
|
|
|
132
132
|
)
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
y() !== void 0 && /* @__PURE__ */
|
|
136
|
-
o && /* @__PURE__ */
|
|
135
|
+
y() !== void 0 && /* @__PURE__ */ i("span", { className: "button__label", children: y() }),
|
|
136
|
+
o && /* @__PURE__ */ i(
|
|
137
137
|
"div",
|
|
138
138
|
{
|
|
139
139
|
className: "button__loader",
|
|
140
140
|
"aria-hidden": "true",
|
|
141
|
-
children: /* @__PURE__ */
|
|
141
|
+
children: /* @__PURE__ */ i(
|
|
142
142
|
N,
|
|
143
143
|
{
|
|
144
144
|
type: "PICTO",
|
|
@@ -148,12 +148,12 @@ class P extends I.Component {
|
|
|
148
148
|
)
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
151
|
+
b && /* @__PURE__ */ i(
|
|
152
152
|
"span",
|
|
153
153
|
{
|
|
154
154
|
className: "button__caret",
|
|
155
155
|
"aria-hidden": "true",
|
|
156
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ i(
|
|
157
157
|
N,
|
|
158
158
|
{
|
|
159
159
|
type: "PICTO",
|
|
@@ -162,11 +162,11 @@ class P extends I.Component {
|
|
|
162
162
|
)
|
|
163
163
|
}
|
|
164
164
|
),
|
|
165
|
-
|
|
165
|
+
T && h() && /* @__PURE__ */ i(
|
|
166
166
|
E,
|
|
167
167
|
{
|
|
168
|
-
pin:
|
|
169
|
-
type:
|
|
168
|
+
pin: e?.pin || "BOTTOM",
|
|
169
|
+
type: e?.type || "SINGLE_LINE",
|
|
170
170
|
children: L()
|
|
171
171
|
}
|
|
172
172
|
)
|
|
@@ -177,29 +177,29 @@ class P extends I.Component {
|
|
|
177
177
|
] });
|
|
178
178
|
};
|
|
179
179
|
LinkButton = () => {
|
|
180
|
-
const { type:
|
|
181
|
-
return /* @__PURE__ */
|
|
180
|
+
const { type: t, size: n, feature: a, label: e, url: c } = this.props;
|
|
181
|
+
return /* @__PURE__ */ i(
|
|
182
182
|
"button",
|
|
183
183
|
{
|
|
184
184
|
role: "link",
|
|
185
185
|
className: w([
|
|
186
186
|
"button",
|
|
187
|
-
`button--${
|
|
188
|
-
`button--${
|
|
187
|
+
`button--${t}`,
|
|
188
|
+
`button--${n}`
|
|
189
189
|
]),
|
|
190
|
-
"data-feature":
|
|
190
|
+
"data-feature": a,
|
|
191
191
|
ref: this.buttonRef,
|
|
192
|
-
"aria-label":
|
|
192
|
+
"aria-label": e,
|
|
193
193
|
tabIndex: 0,
|
|
194
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ i(
|
|
195
195
|
"a",
|
|
196
196
|
{
|
|
197
|
-
href:
|
|
197
|
+
href: c,
|
|
198
198
|
target: "_blank",
|
|
199
199
|
rel: "noreferrer",
|
|
200
200
|
className: "button__label",
|
|
201
|
-
"aria-label":
|
|
202
|
-
children:
|
|
201
|
+
"aria-label": e,
|
|
202
|
+
children: e
|
|
203
203
|
}
|
|
204
204
|
)
|
|
205
205
|
}
|
|
@@ -207,42 +207,41 @@ class P extends I.Component {
|
|
|
207
207
|
};
|
|
208
208
|
Icon = () => {
|
|
209
209
|
const {
|
|
210
|
-
size:
|
|
211
|
-
icon:
|
|
212
|
-
iconClassName:
|
|
213
|
-
customIcon:
|
|
214
|
-
feature:
|
|
215
|
-
state:
|
|
210
|
+
size: t,
|
|
211
|
+
icon: n,
|
|
212
|
+
iconClassName: a,
|
|
213
|
+
customIcon: e,
|
|
214
|
+
feature: c,
|
|
215
|
+
state: b,
|
|
216
216
|
helper: o,
|
|
217
|
-
warning: p,
|
|
218
217
|
isLoading: l,
|
|
219
|
-
isDisabled:
|
|
218
|
+
isDisabled: s,
|
|
220
219
|
isBlocked: r,
|
|
221
|
-
isNew:
|
|
222
|
-
action:
|
|
220
|
+
isNew: u,
|
|
221
|
+
action: p
|
|
223
222
|
} = this.props, { isTooltipVisible: T } = this.state;
|
|
224
223
|
return /* @__PURE__ */ m("div", { className: g["snackbar--medium"], children: [
|
|
225
224
|
/* @__PURE__ */ m(
|
|
226
225
|
"button",
|
|
227
226
|
{
|
|
228
227
|
role: "button",
|
|
229
|
-
"data-feature":
|
|
228
|
+
"data-feature": c,
|
|
230
229
|
className: w([
|
|
231
230
|
"icon-button",
|
|
232
|
-
`icon-button--${
|
|
233
|
-
|
|
234
|
-
|
|
231
|
+
`icon-button--${t}`,
|
|
232
|
+
b === "selected" && "icon-button--selected",
|
|
233
|
+
u && "icon-button--new",
|
|
235
234
|
l && "button--loading"
|
|
236
235
|
]),
|
|
237
|
-
disabled:
|
|
238
|
-
"aria-label": typeof o?.label == "string" ? o.label :
|
|
239
|
-
"aria-disabled":
|
|
240
|
-
"aria-pressed":
|
|
236
|
+
disabled: s || r,
|
|
237
|
+
"aria-label": typeof o?.label == "string" ? o.label : n,
|
|
238
|
+
"aria-disabled": s || r,
|
|
239
|
+
"aria-pressed": b === "selected",
|
|
241
240
|
"aria-busy": l,
|
|
242
|
-
onKeyDown: (
|
|
243
|
-
(
|
|
241
|
+
onKeyDown: (d) => {
|
|
242
|
+
(d.key === " " || d.key === "Enter") && !(s || r) && p?.(d), d.key === "Escape" && d.target.blur();
|
|
244
243
|
},
|
|
245
|
-
onMouseDown:
|
|
244
|
+
onMouseDown: s || r ? void 0 : p,
|
|
246
245
|
onMouseEnter: () => {
|
|
247
246
|
o !== void 0 && this.setState({ isTooltipVisible: !0 });
|
|
248
247
|
},
|
|
@@ -258,18 +257,18 @@ class P extends I.Component {
|
|
|
258
257
|
tabIndex: 0,
|
|
259
258
|
ref: this.buttonRef,
|
|
260
259
|
children: [
|
|
261
|
-
|
|
260
|
+
e === void 0 ? /* @__PURE__ */ i(
|
|
262
261
|
N,
|
|
263
262
|
{
|
|
264
263
|
type: "PICTO",
|
|
265
|
-
iconName: l ? "spinner" :
|
|
266
|
-
customClassName:
|
|
264
|
+
iconName: l ? "spinner" : n,
|
|
265
|
+
customClassName: a !== void 0 ? a : void 0
|
|
267
266
|
}
|
|
268
|
-
) : /* @__PURE__ */
|
|
267
|
+
) : /* @__PURE__ */ i(
|
|
269
268
|
"div",
|
|
270
269
|
{
|
|
271
270
|
style: {
|
|
272
|
-
opacity:
|
|
271
|
+
opacity: s || r ? 0.5 : 1,
|
|
273
272
|
pointerEvents: "none",
|
|
274
273
|
width: "100%",
|
|
275
274
|
height: "100%",
|
|
@@ -277,10 +276,10 @@ class P extends I.Component {
|
|
|
277
276
|
alignItems: "center",
|
|
278
277
|
justifyContent: "center"
|
|
279
278
|
},
|
|
280
|
-
children:
|
|
279
|
+
children: e
|
|
281
280
|
}
|
|
282
281
|
),
|
|
283
|
-
T && o !== void 0 &&
|
|
282
|
+
T && o !== void 0 && b !== "selected" && /* @__PURE__ */ i(
|
|
284
283
|
E,
|
|
285
284
|
{
|
|
286
285
|
pin: o?.pin || "BOTTOM",
|
|
@@ -291,13 +290,13 @@ class P extends I.Component {
|
|
|
291
290
|
]
|
|
292
291
|
}
|
|
293
292
|
),
|
|
294
|
-
|
|
293
|
+
!u && this.Status()
|
|
295
294
|
] });
|
|
296
295
|
};
|
|
297
296
|
// Render
|
|
298
297
|
render() {
|
|
299
|
-
const { type:
|
|
300
|
-
return
|
|
298
|
+
const { type: t, isLink: n } = this.props;
|
|
299
|
+
return t !== "icon" ? n ? this.LinkButton() : this.Button() : this.Icon();
|
|
301
300
|
}
|
|
302
301
|
}
|
|
303
302
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../src/components/actions/button/Button.tsx"],"sourcesContent":["import React from 'react'\nimport layouts from '@styles/layouts.module.scss'\nimport Tooltip from '@components/tags/tooltip/Tooltip'\nimport IconChip from '@components/tags/icon-chip/IconChip'\nimport Chip from '@components/tags/chip/Chip'\nimport Icon from '@components/assets/icon/Icon'\nimport { doClassnames } from '@a_ng_d/figmug-utils'\nimport type { IconList } from '@tps/icon.types'\nimport './button.scss'\n\nexport interface ButtonProps {\n /**\n * Visual style of the button\n */\n type:\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'destructive'\n | 'alternative'\n | 'icon'\n /**\n * Size of the button\n * @default 'default'\n */\n size?: 'small' | 'default' | 'large'\n /**\n * Icon name to display in the button\n */\n icon?: IconList\n /**\n * Custom CSS class for the icon\n */\n iconClassName?: string\n /**\n * Custom icon element to replace the default icon\n */\n customIcon?: React.ReactElement\n /**\n * Text label of the button\n */\n label?: string\n /**\n * Visual state of the button\n * @default 'default'\n */\n state?: 'default' | 'selected'\n /**\n * URL for link buttons\n */\n url?: string\n /**\n * Helper tooltip configuration\n */\n helper?: {\n /** Tooltip content */\n label: string | React.ReactNode\n /** Tooltip position */\n pin?: 'TOP' | 'BOTTOM'\n /** Tooltip display type */\n type?: 'MULTI_LINE' | 'SINGLE_LINE'\n }\n /**\n * Preview tooltip configuration with image\n */\n preview?: {\n /** Preview image URL */\n image: string\n /** Preview text */\n text: string | React.ReactNode\n /** Preview position */\n pin?: 'TOP' | 'BOTTOM'\n }\n /**\n * Warning tooltip configuration\n */\n warning?: {\n /** Warning message */\n label: string | React.ReactNode\n /** Warning position */\n pin?: 'TOP' | 'BOTTOM'\n /** Warning display type */\n type?: 'MULTI_LINE' | 'SINGLE_LINE'\n }\n /**\n * Feature identifier for tracking\n */\n feature?: string\n /**\n * Whether the button has multiple actions\n * @default false\n */\n hasMultipleActions?: boolean\n /**\n * Whether the button should render as a link\n * @default false\n */\n isLink?: boolean\n /**\n * Whether the button should auto-focus on mount\n * @default false\n */\n isAutofocus?: boolean\n /**\n * Reflow configuration for responsive behavior\n * @default { isEnabled: false, icon: 'adjust' }\n */\n shouldReflow?: {\n /** Whether reflow is enabled */\n isEnabled: boolean\n /** Icon to show when reflowed */\n icon: IconList\n }\n /**\n * Whether the button is in loading state\n * @default false\n */\n isLoading?: boolean\n /**\n * Whether the button is blocked (shows unblock action)\n * @default false\n */\n isBlocked?: boolean\n /**\n * Whether the button is disabled\n * @default false\n */\n isDisabled?: boolean\n /**\n * Whether to show a \"New\" badge\n * @default false\n */\n isNew?: boolean\n /**\n * Click handler for the button\n */\n action?: React.MouseEventHandler & React.KeyboardEventHandler\n /**\n * Handler called when unblock is clicked\n */\n onUnblock?: React.MouseEventHandler & React.KeyboardEventHandler\n}\n\ninterface ButtonStates {\n isTooltipVisible: boolean\n documentWidth: number\n}\n\nexport default class Button extends React.Component<ButtonProps, ButtonStates> {\n buttonRef: React.RefObject<HTMLButtonElement> = React.createRef()\n\n static defaultProps: Partial<ButtonProps> = {\n size: 'default',\n state: 'default',\n hasMultipleActions: false,\n isLink: false,\n shouldReflow: { isEnabled: false, icon: 'adjust' },\n isAutofocus: false,\n isLoading: false,\n isBlocked: false,\n isDisabled: false,\n isNew: false,\n }\n\n constructor(props: ButtonProps) {\n super(props)\n this.state = {\n isTooltipVisible: false,\n documentWidth: document.documentElement.clientWidth,\n }\n }\n\n // Lifecycle\n componentDidMount = () => {\n const { isAutofocus } = this.props\n\n if (isAutofocus)\n setTimeout(() => {\n if (this.buttonRef.current) this.buttonRef.current.focus()\n }, 1)\n\n window.addEventListener('resize', this.handleResize)\n }\n\n componentWillUnmount = () => {\n window.removeEventListener('resize', this.handleResize)\n }\n\n // Handlers\n handleResize = () => {\n this.setState({ documentWidth: document.documentElement.clientWidth })\n }\n\n // Templates\n Status = () => {\n const { type, warning, preview, isBlocked, isNew, onUnblock } = this.props\n\n if (warning || isBlocked || isNew)\n return (\n <div className=\"button__status\">\n {warning !== undefined && (\n <IconChip\n iconType=\"PICTO\"\n iconName=\"warning\"\n text={warning.label}\n pin={warning.pin}\n type={warning.type}\n />\n )}\n {(isBlocked || isNew) && type !== 'icon' && (\n <Chip\n preview={preview}\n isSolo\n action={isBlocked ? onUnblock : undefined}\n >\n {isNew ? 'New' : 'Pro'}\n </Chip>\n )}\n </div>\n )\n }\n\n Button = () => {\n const {\n type,\n icon,\n size,\n helper,\n feature,\n hasMultipleActions,\n isLoading,\n isDisabled,\n isBlocked,\n action,\n label,\n shouldReflow,\n } = this.props\n const { isTooltipVisible, documentWidth } = this.state\n\n const isReflowActive = shouldReflow?.isEnabled && documentWidth <= 460\n\n const getButtonLabel = () => (isReflowActive ? undefined : label)\n const getTooltipLabel = () => (isReflowActive ? label : helper?.label)\n const hasTooltipContent = () =>\n isReflowActive ? label !== undefined : helper !== undefined\n const getIconName = () =>\n isReflowActive && shouldReflow?.icon !== undefined\n ? shouldReflow.icon\n : icon\n\n return (\n <div className={layouts['snackbar--medium']}>\n <button\n role=\"button\"\n className={doClassnames([\n 'button',\n `button--${type}`,\n `button--${size}`,\n isLoading && 'button--loading',\n isBlocked && 'button--blocked',\n ])}\n data-feature={feature}\n disabled={isDisabled || isBlocked}\n aria-label={\n typeof (getButtonLabel() || helper?.label) === 'string'\n ? ((getButtonLabel() || helper?.label) as string)\n : undefined\n }\n aria-disabled={isDisabled || isBlocked}\n aria-busy={isLoading}\n onKeyDown={(e) => {\n if (\n (e.key === ' ' || e.key === 'Enter') &&\n (!isDisabled || !isBlocked)\n )\n action?.(e)\n if (e.key === 'Escape') (e.target as HTMLElement).blur()\n }}\n onMouseDown={!(isDisabled || isBlocked) ? action : undefined}\n onMouseEnter={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: true })\n }}\n onMouseLeave={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: false })\n }}\n onFocus={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: true })\n }}\n onBlur={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: false })\n }}\n tabIndex={0}\n ref={this.buttonRef}\n >\n {getIconName() !== undefined && (\n <span\n className=\"button__icon\"\n aria-hidden=\"true\"\n >\n <Icon\n type=\"PICTO\"\n iconName={getIconName()}\n />\n </span>\n )}\n {getButtonLabel() !== undefined && (\n <span className=\"button__label\">{getButtonLabel()}</span>\n )}\n {isLoading && (\n <div\n className=\"button__loader\"\n aria-hidden=\"true\"\n >\n <Icon\n type=\"PICTO\"\n iconName=\"spinner\"\n customClassName=\"button__spinner\"\n />\n </div>\n )}\n {hasMultipleActions && (\n <span\n className=\"button__caret\"\n aria-hidden=\"true\"\n >\n <Icon\n type=\"PICTO\"\n iconName=\"chevron-down\"\n />\n </span>\n )}\n {isTooltipVisible && hasTooltipContent() && (\n <Tooltip\n pin={helper?.pin || 'BOTTOM'}\n type={helper?.type || 'SINGLE_LINE'}\n >\n {getTooltipLabel()}\n </Tooltip>\n )}\n </button>\n {this.Status()}\n </div>\n )\n }\n\n LinkButton = () => {\n const { type, size, feature, label, url } = this.props\n\n return (\n <button\n role=\"link\"\n className={doClassnames([\n 'button',\n `button--${type}`,\n `button--${size}`,\n ])}\n data-feature={feature}\n ref={this.buttonRef}\n aria-label={label}\n tabIndex={0}\n >\n <a\n href={url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"button__label\"\n aria-label={label}\n >\n {label}\n </a>\n </button>\n )\n }\n\n Icon = () => {\n const {\n size,\n icon,\n iconClassName,\n customIcon,\n feature,\n state,\n helper,\n warning,\n isLoading,\n isDisabled,\n isBlocked,\n isNew,\n action,\n } = this.props\n const { isTooltipVisible } = this.state\n\n return (\n <div className={layouts['snackbar--medium']}>\n <button\n role=\"button\"\n data-feature={feature}\n className={doClassnames([\n 'icon-button',\n `icon-button--${size}`,\n state === 'selected' && 'icon-button--selected',\n isNew && 'icon-button--new',\n isLoading && 'button--loading',\n ])}\n disabled={isDisabled || isBlocked}\n aria-label={typeof helper?.label === 'string' ? helper.label : icon}\n aria-disabled={isDisabled || isBlocked}\n aria-pressed={state === 'selected'}\n aria-busy={isLoading}\n onKeyDown={(e) => {\n if (\n (e.key === ' ' || e.key === 'Enter') &&\n !(isDisabled || isBlocked)\n )\n action?.(e)\n if (e.key === 'Escape') (e.target as HTMLElement).blur()\n }}\n onMouseDown={!(isDisabled || isBlocked) ? action : undefined}\n onMouseEnter={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: true })\n }}\n onMouseLeave={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: false })\n }}\n onFocus={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: true })\n }}\n onBlur={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: false })\n }}\n tabIndex={0}\n ref={this.buttonRef}\n >\n {customIcon === undefined ? (\n <Icon\n type=\"PICTO\"\n iconName={isLoading ? 'spinner' : icon}\n customClassName={\n iconClassName !== undefined ? iconClassName : undefined\n }\n />\n ) : (\n <div\n style={{\n opacity: isDisabled || isBlocked ? 0.5 : 1,\n pointerEvents: 'none',\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n {customIcon}\n </div>\n )}\n {isTooltipVisible && helper !== undefined && state !== 'selected' && (\n <Tooltip\n pin={helper?.pin || 'BOTTOM'}\n type={helper?.type || 'SINGLE_LINE'}\n >\n {helper?.label}\n </Tooltip>\n )}\n </button>\n {warning !== undefined && this.Status()}\n </div>\n )\n }\n\n // Render\n render() {\n const { type, isLink } = this.props\n\n if (type !== 'icon') return isLink ? this.LinkButton() : this.Button()\n return this.Icon()\n }\n}\n"],"names":["Button","React","props","isAutofocus","type","warning","preview","isBlocked","isNew","onUnblock","jsxs","jsx","IconChip","Chip","icon","size","helper","feature","hasMultipleActions","isLoading","isDisabled","action","label","shouldReflow","isTooltipVisible","documentWidth","isReflowActive","getButtonLabel","getTooltipLabel","hasTooltipContent","getIconName","layouts","doClassnames","e","Icon","Tooltip","url","iconClassName","customIcon","state","isLink"],"mappings":";;;;;;;;AAoJA,MAAqBA,UAAeC,EAAM,UAAqC;AAAA,EAC7E,YAAgDA,EAAM,UAAA;AAAA,EAEtD,OAAO,eAAqC;AAAA,IAC1C,MAAM;AAAA,IACN,OAAO;AAAA,IACP,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,cAAc,EAAE,WAAW,IAAO,MAAM,SAAA;AAAA,IACxC,aAAa;AAAA,IACb,WAAW;AAAA,IACX,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA;AAAA,EAGT,YAAYC,GAAoB;AAC9B,UAAMA,CAAK,GACX,KAAK,QAAQ;AAAA,MACX,kBAAkB;AAAA,MAClB,eAAe,SAAS,gBAAgB;AAAA,IAAA;AAAA,EAE5C;AAAA;AAAA,EAGA,oBAAoB,MAAM;AACxB,UAAM,EAAE,aAAAC,MAAgB,KAAK;AAE7B,IAAIA,KACF,WAAW,MAAM;AACf,MAAI,KAAK,UAAU,WAAS,KAAK,UAAU,QAAQ,MAAA;AAAA,IACrD,GAAG,CAAC,GAEN,OAAO,iBAAiB,UAAU,KAAK,YAAY;AAAA,EACrD;AAAA,EAEA,uBAAuB,MAAM;AAC3B,WAAO,oBAAoB,UAAU,KAAK,YAAY;AAAA,EACxD;AAAA;AAAA,EAGA,eAAe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UAAa,KAAK,OAAA;AAAA,IAAO,GACxC;AAAA,EAEJ;AAAA;AAAA,EAGA,SAAS;AACP,UAAM,EAAE,MAAAD,GAAM,QAAAoC,EAAA,IAAW,KAAK;AAE9B,WAAIpC,MAAS,SAAeoC,IAAS,KAAK,WAAA,IAAe,KAAK,OAAA,IACvD,KAAK,KAAA;AAAA,EACd;AACF;"}
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../src/components/actions/button/Button.tsx"],"sourcesContent":["import React from 'react'\nimport { doClassnames } from '@unoff/utils'\nimport layouts from '@styles/layouts.module.scss'\nimport Tooltip from '@components/tags/tooltip/Tooltip'\nimport IconChip from '@components/tags/icon-chip/IconChip'\nimport Chip from '@components/tags/chip/Chip'\nimport Icon from '@components/assets/icon/Icon'\nimport type { IconList } from '@tps/icon.types'\nimport './button.scss'\n\nexport interface ButtonProps {\n /**\n * Visual style of the button\n */\n type:\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'destructive'\n | 'alternative'\n | 'icon'\n /**\n * Size of the button\n * @default 'default'\n */\n size?: 'small' | 'default' | 'large'\n /**\n * Icon name to display in the button\n */\n icon?: IconList\n /**\n * Custom CSS class for the icon\n */\n iconClassName?: string\n /**\n * Custom icon element to replace the default icon\n */\n customIcon?: React.ReactElement\n /**\n * Text label of the button\n */\n label?: string\n /**\n * Visual state of the button\n * @default 'default'\n */\n state?: 'default' | 'selected'\n /**\n * URL for link buttons\n */\n url?: string\n /**\n * Helper tooltip configuration\n */\n helper?: {\n /** Tooltip content */\n label: string | React.ReactNode\n /** Tooltip position */\n pin?: 'TOP' | 'BOTTOM'\n /** Tooltip display type */\n type?: 'MULTI_LINE' | 'SINGLE_LINE'\n }\n /**\n * Preview tooltip configuration with image\n */\n preview?: {\n /** Preview image URL */\n image: string\n /** Preview text */\n text: string | React.ReactNode\n /** Preview position */\n pin?: 'TOP' | 'BOTTOM'\n }\n /**\n * Warning tooltip configuration\n */\n warning?: {\n /** Warning message */\n label: string | React.ReactNode\n /** Warning position */\n pin?: 'TOP' | 'BOTTOM'\n /** Warning display type */\n type?: 'MULTI_LINE' | 'SINGLE_LINE'\n }\n /**\n * Feature identifier for tracking\n */\n feature?: string\n /**\n * Whether the button has multiple actions\n * @default false\n */\n hasMultipleActions?: boolean\n /**\n * Whether the button should render as a link\n * @default false\n */\n isLink?: boolean\n /**\n * Whether the button should auto-focus on mount\n * @default false\n */\n isAutofocus?: boolean\n /**\n * Reflow configuration for responsive behavior\n * @default { isEnabled: false, icon: 'adjust' }\n */\n shouldReflow?: {\n /** Whether reflow is enabled */\n isEnabled: boolean\n /** Icon to show when reflowed */\n icon: IconList\n }\n /**\n * Whether the button is in loading state\n * @default false\n */\n isLoading?: boolean\n /**\n * Whether the button is blocked (shows unblock action)\n * @default false\n */\n isBlocked?: boolean\n /**\n * Whether the button is disabled\n * @default false\n */\n isDisabled?: boolean\n /**\n * Whether to show a \"New\" badge\n * @default false\n */\n isNew?: boolean\n /**\n * Click handler for the button\n */\n action?: React.MouseEventHandler & React.KeyboardEventHandler\n /**\n * Handler called when unblock is clicked\n */\n onUnblock?: React.MouseEventHandler & React.KeyboardEventHandler\n}\n\ninterface ButtonState {\n isTooltipVisible: boolean\n documentWidth: number\n}\n\nexport default class Button extends React.Component<ButtonProps, ButtonState> {\n buttonRef: React.RefObject<HTMLButtonElement> = React.createRef()\n\n static defaultProps: Partial<ButtonProps> = {\n size: 'default',\n state: 'default',\n hasMultipleActions: false,\n isLink: false,\n shouldReflow: { isEnabled: false, icon: 'adjust' },\n isAutofocus: false,\n isLoading: false,\n isBlocked: false,\n isDisabled: false,\n isNew: false,\n }\n\n constructor(props: ButtonProps) {\n super(props)\n this.state = {\n isTooltipVisible: false,\n documentWidth: document.documentElement.clientWidth,\n }\n }\n\n // Lifecycle\n componentDidMount = () => {\n const { isAutofocus } = this.props\n\n if (isAutofocus)\n setTimeout(() => {\n if (this.buttonRef.current) this.buttonRef.current.focus()\n }, 1)\n\n window.addEventListener('resize', this.handleResize)\n }\n\n componentWillUnmount = () => {\n window.removeEventListener('resize', this.handleResize)\n }\n\n // Handlers\n handleResize = () => {\n this.setState({ documentWidth: document.documentElement.clientWidth })\n }\n\n // Templates\n Status = () => {\n const { warning, preview, isBlocked, isNew, onUnblock } = this.props\n\n if (warning || isBlocked || isNew)\n return (\n <div className=\"button__status\">\n {warning !== undefined && (\n <IconChip\n iconType=\"PICTO\"\n iconName=\"warning\"\n text={warning.label}\n pin={warning.pin}\n type={warning.type}\n />\n )}\n {(isBlocked || isNew) && (\n <Chip\n preview={preview}\n isSolo\n action={isBlocked ? onUnblock : undefined}\n >\n {isNew ? 'New' : 'Pro'}\n </Chip>\n )}\n </div>\n )\n }\n\n Button = () => {\n const {\n type,\n icon,\n size,\n helper,\n feature,\n hasMultipleActions,\n isLoading,\n isDisabled,\n isBlocked,\n action,\n label,\n shouldReflow,\n } = this.props\n const { isTooltipVisible, documentWidth } = this.state\n\n const isReflowActive = shouldReflow?.isEnabled && documentWidth <= 460\n\n const getButtonLabel = () => (isReflowActive ? undefined : label)\n const getTooltipLabel = () => (isReflowActive ? label : helper?.label)\n const hasTooltipContent = () =>\n isReflowActive ? label !== undefined : helper !== undefined\n const getIconName = () =>\n isReflowActive && shouldReflow?.icon !== undefined\n ? shouldReflow.icon\n : icon\n\n return (\n <div className={layouts['snackbar--medium']}>\n <button\n role=\"button\"\n className={doClassnames([\n 'button',\n `button--${type}`,\n `button--${size}`,\n isLoading && 'button--loading',\n isBlocked && 'button--blocked',\n ])}\n data-feature={feature}\n disabled={isDisabled || isBlocked}\n aria-label={\n typeof (getButtonLabel() || helper?.label) === 'string'\n ? ((getButtonLabel() || helper?.label) as string)\n : undefined\n }\n aria-disabled={isDisabled || isBlocked}\n aria-busy={isLoading}\n onKeyDown={(e) => {\n if (\n (e.key === ' ' || e.key === 'Enter') &&\n (!isDisabled || !isBlocked)\n )\n action?.(e)\n if (e.key === 'Escape') (e.target as HTMLElement).blur()\n }}\n onMouseDown={!(isDisabled || isBlocked) ? action : undefined}\n onMouseEnter={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: true })\n }}\n onMouseLeave={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: false })\n }}\n onFocus={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: true })\n }}\n onBlur={() => {\n if (hasTooltipContent()) this.setState({ isTooltipVisible: false })\n }}\n tabIndex={0}\n ref={this.buttonRef}\n >\n {getIconName() !== undefined && (\n <span\n className=\"button__icon\"\n aria-hidden=\"true\"\n >\n <Icon\n type=\"PICTO\"\n iconName={getIconName()}\n />\n </span>\n )}\n {getButtonLabel() !== undefined && (\n <span className=\"button__label\">{getButtonLabel()}</span>\n )}\n {isLoading && (\n <div\n className=\"button__loader\"\n aria-hidden=\"true\"\n >\n <Icon\n type=\"PICTO\"\n iconName=\"spinner\"\n customClassName=\"button__spinner\"\n />\n </div>\n )}\n {hasMultipleActions && (\n <span\n className=\"button__caret\"\n aria-hidden=\"true\"\n >\n <Icon\n type=\"PICTO\"\n iconName=\"chevron-down\"\n />\n </span>\n )}\n {isTooltipVisible && hasTooltipContent() && (\n <Tooltip\n pin={helper?.pin || 'BOTTOM'}\n type={helper?.type || 'SINGLE_LINE'}\n >\n {getTooltipLabel()}\n </Tooltip>\n )}\n </button>\n {this.Status()}\n </div>\n )\n }\n\n LinkButton = () => {\n const { type, size, feature, label, url } = this.props\n\n return (\n <button\n role=\"link\"\n className={doClassnames([\n 'button',\n `button--${type}`,\n `button--${size}`,\n ])}\n data-feature={feature}\n ref={this.buttonRef}\n aria-label={label}\n tabIndex={0}\n >\n <a\n href={url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"button__label\"\n aria-label={label}\n >\n {label}\n </a>\n </button>\n )\n }\n\n Icon = () => {\n const {\n size,\n icon,\n iconClassName,\n customIcon,\n feature,\n state,\n helper,\n isLoading,\n isDisabled,\n isBlocked,\n isNew,\n action,\n } = this.props\n const { isTooltipVisible } = this.state\n\n return (\n <div className={layouts['snackbar--medium']}>\n <button\n role=\"button\"\n data-feature={feature}\n className={doClassnames([\n 'icon-button',\n `icon-button--${size}`,\n state === 'selected' && 'icon-button--selected',\n isNew && 'icon-button--new',\n isLoading && 'button--loading',\n ])}\n disabled={isDisabled || isBlocked}\n aria-label={typeof helper?.label === 'string' ? helper.label : icon}\n aria-disabled={isDisabled || isBlocked}\n aria-pressed={state === 'selected'}\n aria-busy={isLoading}\n onKeyDown={(e) => {\n if (\n (e.key === ' ' || e.key === 'Enter') &&\n !(isDisabled || isBlocked)\n )\n action?.(e)\n if (e.key === 'Escape') (e.target as HTMLElement).blur()\n }}\n onMouseDown={!(isDisabled || isBlocked) ? action : undefined}\n onMouseEnter={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: true })\n }}\n onMouseLeave={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: false })\n }}\n onFocus={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: true })\n }}\n onBlur={() => {\n if (helper !== undefined) this.setState({ isTooltipVisible: false })\n }}\n tabIndex={0}\n ref={this.buttonRef}\n >\n {customIcon === undefined ? (\n <Icon\n type=\"PICTO\"\n iconName={isLoading ? 'spinner' : icon}\n customClassName={\n iconClassName !== undefined ? iconClassName : undefined\n }\n />\n ) : (\n <div\n style={{\n opacity: isDisabled || isBlocked ? 0.5 : 1,\n pointerEvents: 'none',\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n {customIcon}\n </div>\n )}\n {isTooltipVisible && helper !== undefined && state !== 'selected' && (\n <Tooltip\n pin={helper?.pin || 'BOTTOM'}\n type={helper?.type || 'SINGLE_LINE'}\n >\n {helper?.label}\n </Tooltip>\n )}\n </button>\n {!isNew && this.Status()}\n </div>\n )\n }\n\n // Render\n render() {\n const { type, isLink } = this.props\n\n if (type !== 'icon') return isLink ? this.LinkButton() : this.Button()\n return this.Icon()\n }\n}\n"],"names":["Button","React","props","isAutofocus","warning","preview","isBlocked","isNew","onUnblock","jsxs","jsx","IconChip","Chip","type","icon","size","helper","feature","hasMultipleActions","isLoading","isDisabled","action","label","shouldReflow","isTooltipVisible","documentWidth","isReflowActive","getButtonLabel","getTooltipLabel","hasTooltipContent","getIconName","layouts","doClassnames","e","Icon","Tooltip","url","iconClassName","customIcon","state","isLink"],"mappings":";;;;;;;;AAoJA,MAAqBA,UAAeC,EAAM,UAAoC;AAAA,EAC5E,YAAgDA,EAAM,UAAA;AAAA,EAEtD,OAAO,eAAqC;AAAA,IAC1C,MAAM;AAAA,IACN,OAAO;AAAA,IACP,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,cAAc,EAAE,WAAW,IAAO,MAAM,SAAA;AAAA,IACxC,aAAa;AAAA,IACb,WAAW;AAAA,IACX,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA;AAAA,EAGT,YAAYC,GAAoB;AAC9B,UAAMA,CAAK,GACX,KAAK,QAAQ;AAAA,MACX,kBAAkB;AAAA,MAClB,eAAe,SAAS,gBAAgB;AAAA,IAAA;AAAA,EAE5C;AAAA;AAAA,EAGA,oBAAoB,MAAM;AACxB,UAAM,EAAE,aAAAC,MAAgB,KAAK;AAE7B,IAAIA,KACF,WAAW,MAAM;AACf,MAAI,KAAK,UAAU,WAAS,KAAK,UAAU,QAAQ,MAAA;AAAA,IACrD,GAAG,CAAC,GAEN,OAAO,iBAAiB,UAAU,KAAK,YAAY;AAAA,EACrD;AAAA,EAEA,uBAAuB,MAAM;AAC3B,WAAO,oBAAoB,UAAU,KAAK,YAAY;AAAA,EACxD;AAAA;AAAA,EAGA,eAAe,MAAM;AACnB,SAAK,SAAS,EAAE,eAAe,SAAS,gBAAgB,aAAa;AAAA,EACvE;AAAA;AAAA,EAGA,SAAS,MAAM;AACb,UAAM,EAAE,SAAAC,GAAS,SAAAC,GAAS,WAAAC,GAAW,OAAAC,GAAO,WAAAC,EAAA,IAAc,KAAK;AAE/D,QAAIJ,KAAWE,KAAaC;AA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":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/card/Card.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/card/Card.tsx"],"names":[],"mappings":"AAKA,OAAO,aAAa,CAAA;AAEpB,UAAU,SAAS;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,MAAM,EAAE,CACN,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,KAC5D,IAAI,CAAA;CACV;AAED,QAAA,MAAM,IAAI,GAAI,OAAO,SAAS,4CAmF7B,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import '../../../assets/Card.css';
|
|
2
2
|
import { jsxs as a, jsx as e, Fragment as g } from "react/jsx-runtime";
|
|
3
3
|
import { useState as y } from "react";
|
|
4
|
+
import { t as s } from "../../../do-classnames-DSDFCvzy.js";
|
|
4
5
|
import o from "../../../styles/texts/texts.module.js";
|
|
5
6
|
import v from "../../tags/chip/Chip.js";
|
|
6
7
|
import x from "../../assets/thumbnail/Thumbnail.js";
|
|
7
|
-
import { t as s } from "../../../do-classnames-DSDFCvzy.js";
|
|
8
8
|
const M = (f) => {
|
|
9
9
|
const [i, t] = y(!1), {
|
|
10
10
|
src: l,
|