@jobber/components 4.85.4-CJS-to-ESM.2 → 4.85.4
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/.eslintrc.js +10 -0
- package/AnimatedPresence.d.ts +1 -0
- package/AnimatedPresence.js +17 -0
- package/AnimatedSwitcher.d.ts +1 -0
- package/AnimatedSwitcher.js +17 -0
- package/Autocomplete.d.ts +1 -0
- package/Autocomplete.js +17 -0
- package/Avatar.d.ts +1 -0
- package/Avatar.js +17 -0
- package/Banner.d.ts +1 -0
- package/Banner.js +17 -0
- package/Button.d.ts +1 -0
- package/Button.js +17 -0
- package/ButtonDismiss.d.ts +1 -0
- package/ButtonDismiss.js +17 -0
- package/Card.d.ts +1 -0
- package/Card.js +17 -0
- package/Checkbox.d.ts +1 -0
- package/Checkbox.js +17 -0
- package/Chip.d.ts +1 -0
- package/Chip.js +17 -0
- package/Chips.d.ts +1 -0
- package/Chips.js +17 -0
- package/Combobox.d.ts +1 -0
- package/Combobox.js +17 -0
- package/ConfirmationModal.d.ts +1 -0
- package/ConfirmationModal.js +17 -0
- package/Content.d.ts +1 -0
- package/Content.js +17 -0
- package/Countdown.d.ts +1 -0
- package/Countdown.js +17 -0
- package/DataDump.d.ts +1 -0
- package/DataDump.js +17 -0
- package/DataList.d.ts +1 -0
- package/DataList.js +17 -0
- package/DataTable.d.ts +1 -0
- package/DataTable.js +17 -0
- package/DatePicker.d.ts +1 -0
- package/DatePicker.js +17 -0
- package/DescriptionList.d.ts +1 -0
- package/DescriptionList.js +17 -0
- package/Disclosure.d.ts +1 -0
- package/Disclosure.js +17 -0
- package/Divider.d.ts +1 -0
- package/Divider.js +17 -0
- package/Drawer.d.ts +1 -0
- package/Drawer.js +17 -0
- package/Emphasis.d.ts +1 -0
- package/Emphasis.js +17 -0
- package/FeatureSwitch.d.ts +1 -0
- package/FeatureSwitch.js +17 -0
- package/Flex.d.ts +1 -0
- package/Flex.js +17 -0
- package/Form.d.ts +1 -0
- package/Form.js +17 -0
- package/FormField.d.ts +1 -0
- package/FormField.js +17 -0
- package/FormatDate.d.ts +1 -0
- package/FormatDate.js +17 -0
- package/FormatEmail.d.ts +1 -0
- package/FormatEmail.js +17 -0
- package/FormatFile.d.ts +1 -0
- package/FormatFile.js +17 -0
- package/FormatRelativeDateTime.d.ts +1 -0
- package/FormatRelativeDateTime.js +17 -0
- package/FormatTime.d.ts +1 -0
- package/FormatTime.js +17 -0
- package/Gallery.d.ts +1 -0
- package/Gallery.js +17 -0
- package/Glimmer.d.ts +1 -0
- package/Glimmer.js +17 -0
- package/Grid.d.ts +1 -0
- package/Grid.js +17 -0
- package/Heading.d.ts +1 -0
- package/Heading.js +17 -0
- package/Icon.d.ts +1 -0
- package/Icon.js +17 -0
- package/InlineLabel.d.ts +1 -0
- package/InlineLabel.js +17 -0
- package/InputAvatar.d.ts +1 -0
- package/InputAvatar.js +17 -0
- package/InputDate.d.ts +1 -0
- package/InputDate.js +17 -0
- package/InputEmail.d.ts +1 -0
- package/InputEmail.js +17 -0
- package/InputFile.d.ts +1 -0
- package/InputFile.js +17 -0
- package/InputGroup.d.ts +1 -0
- package/InputGroup.js +17 -0
- package/InputNumber.d.ts +1 -0
- package/InputNumber.js +17 -0
- package/InputPassword.d.ts +1 -0
- package/InputPassword.js +17 -0
- package/InputPhoneNumber.d.ts +1 -0
- package/InputPhoneNumber.js +17 -0
- package/InputText.d.ts +1 -0
- package/InputText.js +17 -0
- package/InputTime.d.ts +1 -0
- package/InputTime.js +17 -0
- package/InputValidation.d.ts +1 -0
- package/InputValidation.js +17 -0
- package/LightBox.d.ts +1 -0
- package/LightBox.js +17 -0
- package/Link.d.ts +1 -0
- package/Link.js +17 -0
- package/List.d.ts +1 -0
- package/List.js +17 -0
- package/Markdown.d.ts +1 -0
- package/Markdown.js +17 -0
- package/Menu.d.ts +1 -0
- package/Menu.js +17 -0
- package/Modal.d.ts +1 -0
- package/Modal.js +17 -0
- package/MultiSelect.d.ts +1 -0
- package/MultiSelect.js +17 -0
- package/Page.d.ts +1 -0
- package/Page.js +17 -0
- package/Popover.d.ts +1 -0
- package/Popover.js +17 -0
- package/ProgressBar.d.ts +1 -0
- package/ProgressBar.js +17 -0
- package/RadioGroup.d.ts +1 -0
- package/RadioGroup.js +17 -0
- package/RecurringSelect.d.ts +1 -0
- package/RecurringSelect.js +17 -0
- package/Select.d.ts +1 -0
- package/Select.js +17 -0
- package/Spinner.d.ts +1 -0
- package/Spinner.js +17 -0
- package/StatusIndicator.d.ts +1 -0
- package/StatusIndicator.js +17 -0
- package/StatusLabel.d.ts +1 -0
- package/StatusLabel.js +17 -0
- package/Switch.d.ts +1 -0
- package/Switch.js +17 -0
- package/Table.d.ts +1 -0
- package/Table.js +17 -0
- package/Tabs.d.ts +1 -0
- package/Tabs.js +17 -0
- package/Text.d.ts +1 -0
- package/Text.js +17 -0
- package/Toast.d.ts +1 -0
- package/Toast.js +17 -0
- package/Tooltip.d.ts +1 -0
- package/Tooltip.js +17 -0
- package/Typography.d.ts +1 -0
- package/Typography.js +17 -0
- package/dist/{AnimatedPresence.cjs → AnimatedPresence/index.js} +1 -1
- package/dist/{AnimatedSwitcher.cjs → AnimatedSwitcher/index.js} +2 -2
- package/dist/{Autocomplete-b35c7ff5.js → Autocomplete/index.js} +20 -7
- package/dist/{Avatar.cjs → Avatar/index.js} +3 -3
- package/dist/{Avatar-cccf72b9.js → Avatar-76a799fa.js} +1 -1
- package/dist/Banner/index.js +110 -0
- package/dist/{Button.cjs → Button/index.js} +4 -4
- package/dist/Button-b73a5e01.js +57 -0
- package/dist/{ButtonDismiss.cjs → ButtonDismiss/index.js} +5 -5
- package/dist/{ButtonDismiss-d7417429.js → ButtonDismiss-350af163.js} +1 -1
- package/dist/Card/colors.css.d.ts +89 -0
- package/dist/{Card.cjs → Card/index.js} +8 -8
- package/dist/{Card-27375ded.js → Card-e3144022.js} +4 -4
- package/dist/Checkbox/index.js +18 -0
- package/dist/{Checkbox-b6e46d80.js → Checkbox-787e2e47.js} +2 -2
- package/dist/{ChipDismissible-a8ecc894.js → Chip/index.js} +18 -3
- package/dist/Chip-3d1bfddc.js +89 -0
- package/dist/{Chips-a8f4c9f2.js → Chips/index.js} +31 -12
- package/dist/{Combobox.cjs → Combobox/index.js} +15 -15
- package/dist/{Combobox-d8d28b1e.js → Combobox-a24c8241.js} +15 -15
- package/dist/ConfirmationModal/index.js +31 -0
- package/dist/{ConfirmationModal-09ec5d02.js → ConfirmationModal-52e16873.js} +3 -3
- package/dist/Content/Spacing.css.d.ts +13 -0
- package/dist/{Content.cjs → Content/index.js} +2 -2
- package/dist/{Content-60a3452a.js → Content-e3f7b6fc.js} +1 -1
- package/dist/{Countdown-961d8a6e.js → Countdown/index.js} +2 -0
- package/dist/{DataDump-f427abfe.js → DataDump/index.js} +19 -3
- package/dist/{DataList-4b0f9e5d.js → DataList/index.js} +48 -33
- package/dist/{DataTable-aab7f6b9.js → DataTable/index.js} +59 -10
- package/dist/{DatePicker.cjs → DatePicker/index.js} +5 -5
- package/dist/{DatePicker-c091c0d2.js → DatePicker-64c5ab1a.js} +3 -3
- package/dist/{DescriptionList-74db99a5.js → DescriptionList/index.js} +6 -3
- package/dist/Disclosure/index.js +46 -0
- package/dist/{Divider-1e6ac1ec.js → Divider/index.js} +4 -2
- package/dist/Drawer/index.js +49 -0
- package/dist/{Emphasis.cjs → Emphasis/index.js} +3 -3
- package/dist/{Emphasis-84de1f3f.js → Emphasis-bda56d3b.js} +1 -1
- package/dist/{FeatureSwitch-ddaebf27.js → FeatureSwitch/index.js} +17 -9
- package/dist/{Flex.cjs → Flex/index.js} +2 -2
- package/dist/{Flex-ddf28839.js → Flex-d490c4db.js} +1 -1
- package/dist/{Form-927647ef.js → Form/index.js} +3 -1
- package/dist/FormField/index.js +24 -0
- package/dist/{FormField-fc30bb1a.js → FormField-6ff183f8.js} +6 -6
- package/dist/{FormatDate.cjs → FormatDate/index.js} +1 -1
- package/dist/{FormatEmail-298393bb.js → FormatEmail/index.js} +3 -1
- package/dist/FormatFile/index.js +36 -0
- package/dist/{FormatFile-d57b8dfa.js → FormatFile-f036902d.js} +8 -8
- package/dist/{FormatRelativeDateTime-6336002d.js → FormatRelativeDateTime/index.js} +2 -0
- package/dist/{FormatTime-20538519.js → FormatTime/index.js} +2 -0
- package/dist/Gallery/Gallery.css.d.ts +9 -0
- package/dist/{Gallery-8d4d79a2.js → Gallery/index.js} +31 -5
- package/dist/{Glimmer.cjs → Glimmer/index.js} +4 -4
- package/dist/Glimmer/style/Shape.css.d.ts +9 -0
- package/dist/Glimmer/style/Sizes.css.d.ts +10 -0
- package/dist/Glimmer/style/Timing.css.d.ts +6 -0
- package/dist/{Glimmer-3fcdae65.js → Glimmer-84dee1ed.js} +4 -4
- package/dist/Grid/GridAlign.css.d.ts +8 -0
- package/dist/{Grid-cce44c9d.js → Grid/index.js} +5 -3
- package/dist/Heading/index.js +14 -0
- package/dist/{Heading-a8a24775.js → Heading-1e8e4bd3.js} +1 -1
- package/dist/{Icon.cjs → Icon/index.js} +1 -1
- package/dist/{InlineLabel.cjs → InlineLabel/index.js} +3 -3
- package/dist/InlineLabel-a6557829.js +28 -0
- package/dist/{InputAvatar-95c98620.js → InputAvatar/index.js} +21 -7
- package/dist/{InputDate-c5f19423.js → InputDate/index.js} +20 -2
- package/dist/{InputEmail-4efba03d.js → InputEmail/index.js} +17 -1
- package/dist/InputFile/index.js +25 -0
- package/dist/{InputFile-921c050e.js → InputFile-bb945071.js} +5 -5
- package/dist/{InputGroup.cjs → InputGroup/index.js} +2 -2
- package/dist/InputNumber/index.js +25 -0
- package/dist/{InputNumber-df9cb825.js → InputNumber-d451b52e.js} +1 -1
- package/dist/{InputPassword-08d2dfa1.js → InputPassword/index.js} +17 -1
- package/dist/{InputPhoneNumber-cbb2ca7d.js → InputPhoneNumber/index.js} +17 -4
- package/dist/InputText/index.js +26 -0
- package/dist/{InputText-125769fd.js → InputText-55b6cb65.js} +1 -1
- package/dist/{InputTime-3c4bdff0.js → InputTime/index.js} +17 -2
- package/dist/{InputValidation.cjs → InputValidation/index.js} +5 -5
- package/dist/{InputValidation-4a61254d.js → InputValidation-05e839fa.js} +2 -2
- package/dist/{LightBox.cjs → LightBox/index.js} +6 -6
- package/dist/{LightBox-3d6e74ba.js → LightBox-a89d8863.js} +3 -3
- package/dist/{Link-fd7301ec.js → Link/index.js} +2 -0
- package/dist/{List-821f249d.js → List/index.js} +16 -10
- package/dist/Markdown/index.js +19 -0
- package/dist/{Markdown-36854bd5.js → Markdown-f7c55304.js} +4 -4
- package/dist/{Menu.cjs → Menu/index.js} +5 -5
- package/dist/{Menu-5ce3cf41.js → Menu-083fc4c4.js} +3 -3
- package/dist/Modal/Sizes.css.d.ts +6 -0
- package/dist/{Modal.cjs → Modal/index.js} +8 -8
- package/dist/{Modal-cda55f02.js → Modal-c336cac6.js} +5 -5
- package/dist/{MultiSelect-707000e1.js → MultiSelect/index.js} +12 -6
- package/dist/{Option-73515eec.js → Option-3c4d377e.js} +1 -1
- package/dist/{Page-fdb087db.js → Page/index.js} +21 -9
- package/dist/Popover/index.js +61 -0
- package/dist/ProgressBar/Sizes.css.d.ts +7 -0
- package/dist/{ProgressBar.cjs → ProgressBar/index.js} +2 -2
- package/dist/{ProgressBar-4ee648b7.js → ProgressBar-b68edc8f.js} +1 -1
- package/dist/{RadioGroup.cjs → RadioGroup/index.js} +4 -4
- package/dist/{RadioGroup-68edd1e3.js → RadioGroup-17b67ade.js} +2 -2
- package/dist/{RecurringSelect-e391af31.js → RecurringSelect/index.js} +27 -14
- package/dist/Select/index.js +26 -0
- package/dist/{Spinner.cjs → Spinner/index.js} +2 -2
- package/dist/Spinner-9d8fc7ff.js +24 -0
- package/dist/{StatusIndicator.cjs → StatusIndicator/index.js} +2 -2
- package/dist/{StatusIndicator-0c680acb.js → StatusIndicator-b179d06e.js} +1 -1
- package/dist/{StatusLabel-5bf96fdb.js → StatusLabel/index.js} +7 -4
- package/dist/{Switch.cjs → Switch/index.js} +3 -3
- package/dist/Switch-7d4aa7c3.js +56 -0
- package/dist/{Body-22878526.js → Table/index.js} +5 -3
- package/dist/{Tabs-d6c8b965.js → Tabs/index.js} +5 -3
- package/dist/{Text.cjs → Text/index.js} +3 -3
- package/dist/{Text-714f7d14.js → Text-259af966.js} +1 -1
- package/dist/{showToast-63be1cf0.js → Toast/index.js} +10 -5
- package/dist/{Tooltip.cjs → Tooltip/index.js} +2 -2
- package/dist/{Tooltip-2e477150.js → Tooltip-ef3d6ef4.js} +1 -1
- package/dist/Typography/css/Emphasis.css.d.ts +6 -0
- package/dist/Typography/css/FontFamilies.css.d.ts +6 -0
- package/dist/Typography/css/FontSizes.css.d.ts +12 -0
- package/dist/Typography/css/FontWeights.css.d.ts +10 -0
- package/dist/Typography/css/TextAlignment.css.d.ts +7 -0
- package/dist/Typography/css/TextCases.css.d.ts +7 -0
- package/dist/Typography/css/TextColors.css.d.ts +22 -0
- package/dist/Typography/css/Truncate.css.d.ts +5 -0
- package/dist/Typography/css/Typography.css.d.ts +5 -0
- package/dist/{Typography.cjs → Typography/index.js} +2 -2
- package/dist/Typography-c45bf216.js +62 -0
- package/package.json +7 -15
- package/rollup.config.js +131 -0
- package/dist/AnimatedPresence-bbccdaf7.js +0 -98
- package/dist/AnimatedPresence.js +0 -4
- package/dist/AnimatedSwitcher-3aff3d12.js +0 -90
- package/dist/AnimatedSwitcher.js +0 -5
- package/dist/Autocomplete-dc7a4b9e.js +0 -188
- package/dist/Autocomplete.cjs +0 -33
- package/dist/Autocomplete.js +0 -25
- package/dist/Avatar-229083ec.js +0 -70
- package/dist/Avatar.js +0 -7
- package/dist/Banner-18d94700.js +0 -105
- package/dist/Banner-5475a9ea.js +0 -98
- package/dist/Banner.cjs +0 -20
- package/dist/Banner.js +0 -12
- package/dist/Body-4fbe21ac.js +0 -50
- package/dist/Button-30154871.js +0 -50
- package/dist/Button-ec64869e.js +0 -57
- package/dist/Button.js +0 -8
- package/dist/ButtonDismiss-a11eef74.js +0 -8
- package/dist/ButtonDismiss.js +0 -9
- package/dist/Card-35bd61ce.js +0 -86
- package/dist/Card.js +0 -16
- package/dist/Checkbox-a91b14f7.js +0 -56
- package/dist/Checkbox.cjs +0 -18
- package/dist/Checkbox.js +0 -10
- package/dist/Chip-01343f8b.js +0 -81
- package/dist/Chip-24613c57.js +0 -89
- package/dist/Chip.cjs +0 -27
- package/dist/Chip.js +0 -17
- package/dist/ChipDismissible-1f2754bd.js +0 -19
- package/dist/Chips-7c44a2f9.js +0 -494
- package/dist/Chips.cjs +0 -46
- package/dist/Chips.js +0 -37
- package/dist/Combobox-44f0ec2a.js +0 -468
- package/dist/Combobox.js +0 -31
- package/dist/ConfirmationModal-64f82a31.js +0 -94
- package/dist/ConfirmationModal.cjs +0 -31
- package/dist/ConfirmationModal.js +0 -23
- package/dist/Content-c96e9299.js +0 -18
- package/dist/Content.js +0 -4
- package/dist/Countdown-ac081ced.js +0 -63
- package/dist/Countdown.cjs +0 -12
- package/dist/Countdown.js +0 -4
- package/dist/DataDump-6fae2727.js +0 -15
- package/dist/DataDump.cjs +0 -27
- package/dist/DataDump.js +0 -19
- package/dist/DataList-18f2d692.js +0 -1310
- package/dist/DataList.cjs +0 -52
- package/dist/DataList.js +0 -44
- package/dist/DataTable-0f6649e0.js +0 -245
- package/dist/DataTable.cjs +0 -65
- package/dist/DataTable.js +0 -36
- package/dist/DatePicker-5d0c0353.js +0 -125
- package/dist/DatePicker.js +0 -12
- package/dist/DescriptionList-2cb975a9.js +0 -15
- package/dist/DescriptionList.cjs +0 -13
- package/dist/DescriptionList.js +0 -5
- package/dist/Disclosure-00a9459b.js +0 -36
- package/dist/Disclosure-56309ff3.js +0 -42
- package/dist/Disclosure.cjs +0 -16
- package/dist/Disclosure.js +0 -8
- package/dist/Divider-589745c1.js +0 -20
- package/dist/Divider.cjs +0 -12
- package/dist/Divider.js +0 -4
- package/dist/Drawer.cjs +0 -21
- package/dist/Drawer.js +0 -12
- package/dist/DrawerGrid-0861e529.js +0 -33
- package/dist/DrawerGrid-b233d837.js +0 -41
- package/dist/Emphasis-2a640962.js +0 -13
- package/dist/Emphasis.js +0 -5
- package/dist/FeatureSwitch-e33e30a9.js +0 -55
- package/dist/FeatureSwitch.cjs +0 -26
- package/dist/FeatureSwitch.js +0 -18
- package/dist/Flex-041db5c8.js +0 -31
- package/dist/Flex.js +0 -4
- package/dist/Form-6a161b07.js +0 -48
- package/dist/Form.cjs +0 -12
- package/dist/Form.js +0 -4
- package/dist/FormField-f1f405d2.js +0 -246
- package/dist/FormField.cjs +0 -24
- package/dist/FormField.js +0 -16
- package/dist/FormatDate-720b39cf.js +0 -27
- package/dist/FormatDate.js +0 -2
- package/dist/FormatEmail-04ee4085.js +0 -14
- package/dist/FormatEmail.cjs +0 -12
- package/dist/FormatEmail.js +0 -4
- package/dist/FormatFile-648aea3e.js +0 -154
- package/dist/FormatFile.cjs +0 -36
- package/dist/FormatFile.js +0 -28
- package/dist/FormatRelativeDateTime-529dc36b.js +0 -64
- package/dist/FormatRelativeDateTime.cjs +0 -10
- package/dist/FormatRelativeDateTime.js +0 -2
- package/dist/FormatTime-764fd3c8.js +0 -28
- package/dist/FormatTime.cjs +0 -10
- package/dist/FormatTime.js +0 -2
- package/dist/Gallery-7760f21f.js +0 -66
- package/dist/Gallery.cjs +0 -39
- package/dist/Gallery.js +0 -31
- package/dist/Glimmer-6bf75ae0.js +0 -69
- package/dist/Glimmer.js +0 -6
- package/dist/Grid-c28e226d.js +0 -66
- package/dist/Grid.cjs +0 -14
- package/dist/Grid.js +0 -5
- package/dist/Heading-dfd4f1cf.js +0 -49
- package/dist/Heading.cjs +0 -14
- package/dist/Heading.js +0 -6
- package/dist/Icon-22723fe6.js +0 -34
- package/dist/Icon.js +0 -3
- package/dist/InlineLabel-20f9095e.js +0 -21
- package/dist/InlineLabel-5144fa06.js +0 -28
- package/dist/InlineLabel.js +0 -5
- package/dist/InputAvatar-3a10bdb1.js +0 -50
- package/dist/InputAvatar.cjs +0 -28
- package/dist/InputAvatar.js +0 -20
- package/dist/InputDate-c258f5cb.js +0 -32
- package/dist/InputDate.cjs +0 -29
- package/dist/InputDate.js +0 -21
- package/dist/InputEmail-812bdffe.js +0 -20
- package/dist/InputEmail.cjs +0 -26
- package/dist/InputEmail.js +0 -17
- package/dist/InputFile-d089b486.js +0 -181
- package/dist/InputFile.cjs +0 -25
- package/dist/InputFile.js +0 -16
- package/dist/InputGroup-436859cf.js +0 -26
- package/dist/InputGroup.js +0 -4
- package/dist/InputNumber-4bd38b8e.js +0 -56
- package/dist/InputNumber.cjs +0 -25
- package/dist/InputNumber.js +0 -17
- package/dist/InputPassword-6b937a91.js +0 -19
- package/dist/InputPassword.cjs +0 -25
- package/dist/InputPassword.js +0 -17
- package/dist/InputPhoneNumber-947bdb49.js +0 -97
- package/dist/InputPhoneNumber.cjs +0 -25
- package/dist/InputPhoneNumber.js +0 -17
- package/dist/InputText-2fd8f942.js +0 -96
- package/dist/InputText.cjs +0 -26
- package/dist/InputText.js +0 -18
- package/dist/InputTime-ef8af2d9.js +0 -187
- package/dist/InputTime.cjs +0 -27
- package/dist/InputTime.js +0 -19
- package/dist/InputValidation-fe42fc3f.js +0 -23
- package/dist/InputValidation.js +0 -9
- package/dist/LightBox-8cc72953.js +0 -109
- package/dist/LightBox.js +0 -16
- package/dist/Link-b41bc1d3.js +0 -7
- package/dist/Link.cjs +0 -10
- package/dist/Link.js +0 -2
- package/dist/List-4fe52f57.js +0 -77
- package/dist/List.cjs +0 -25
- package/dist/List.js +0 -16
- package/dist/Markdown-7b84fcdb.js +0 -55
- package/dist/Markdown.cjs +0 -19
- package/dist/Markdown.js +0 -11
- package/dist/Menu-fb0b2e9b.js +0 -132
- package/dist/Menu.js +0 -13
- package/dist/Modal-eeb52d66.js +0 -63
- package/dist/Modal.js +0 -17
- package/dist/MultiSelect-0af9c956.js +0 -169
- package/dist/MultiSelect.cjs +0 -19
- package/dist/MultiSelect.js +0 -11
- package/dist/Option-58d7cab6.js +0 -12
- package/dist/Page-0b334096.js +0 -59
- package/dist/Page.cjs +0 -30
- package/dist/Page.js +0 -22
- package/dist/Popover-798f548e.js +0 -47
- package/dist/Popover-968c63b2.js +0 -53
- package/dist/Popover.cjs +0 -20
- package/dist/Popover.js +0 -12
- package/dist/ProgressBar-022ef3f6.js +0 -36
- package/dist/ProgressBar.js +0 -4
- package/dist/RadioGroup-a089f132.js +0 -39
- package/dist/RadioGroup.js +0 -6
- package/dist/RecurringSelect-2de4014c.js +0 -208
- package/dist/RecurringSelect.cjs +0 -38
- package/dist/RecurringSelect.js +0 -22
- package/dist/Select.cjs +0 -26
- package/dist/Select.js +0 -17
- package/dist/Spinner-3480bc34.js +0 -24
- package/dist/Spinner-90081e20.js +0 -17
- package/dist/Spinner.js +0 -4
- package/dist/StatusIndicator-d6f9aefa.js +0 -12
- package/dist/StatusIndicator.js +0 -3
- package/dist/StatusLabel-66214fc7.js +0 -19
- package/dist/StatusLabel.cjs +0 -15
- package/dist/StatusLabel.js +0 -7
- package/dist/Switch-6c6c727b.js +0 -56
- package/dist/Switch-87706cde.js +0 -49
- package/dist/Switch.js +0 -5
- package/dist/Table.cjs +0 -20
- package/dist/Table.js +0 -5
- package/dist/Tabs-109f1f10.js +0 -70
- package/dist/Tabs.cjs +0 -14
- package/dist/Tabs.js +0 -5
- package/dist/Text-c92ddeb3.js +0 -25
- package/dist/Text.js +0 -5
- package/dist/Toast.cjs +0 -19
- package/dist/Toast.js +0 -11
- package/dist/Tooltip-a40fffbd.js +0 -104
- package/dist/Tooltip.js +0 -8
- package/dist/Typography-52ed1386.js +0 -55
- package/dist/Typography-fd88fcce.js +0 -62
- package/dist/Typography.js +0 -4
- package/dist/getAtlantisConfig-5b50057c.js +0 -11
- package/dist/index.cjs +0 -224
- package/dist/index.d.ts +0 -73
- package/dist/index.js +0 -112
- package/dist/showToast-ff666be8.js +0 -100
- package/dist/style-inject.es-a0e1a0ba.js +0 -28
- package/dist/tslib.es6-c563c1dd.js +0 -43
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
|
-
import { I as Icon } from './Icon-22723fe6.js';
|
|
4
|
-
|
|
5
|
-
const DURATION_SIMPLE = 0.1;
|
|
6
|
-
const DURATION_AVERAGE = 0.2;
|
|
7
|
-
const FADE = {
|
|
8
|
-
visible: { opacity: 1 },
|
|
9
|
-
hidden: { opacity: 0 },
|
|
10
|
-
};
|
|
11
|
-
const SLIDE_IN_UP = {
|
|
12
|
-
visible: { y: 0, opacity: 1 },
|
|
13
|
-
hidden: { y: "10%", opacity: 0 },
|
|
14
|
-
};
|
|
15
|
-
const SLIDE_IN_DOWN = {
|
|
16
|
-
visible: { y: 0, opacity: 1 },
|
|
17
|
-
hidden: { y: "-10%", opacity: 0 },
|
|
18
|
-
};
|
|
19
|
-
const SPIN_COUNTER_CLOCK_WISE = {
|
|
20
|
-
visible: {
|
|
21
|
-
rotate: 0,
|
|
22
|
-
scale: 1,
|
|
23
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
24
|
-
},
|
|
25
|
-
hidden: {
|
|
26
|
-
rotate: 180,
|
|
27
|
-
scale: 0.6,
|
|
28
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
const SPIN_CLOCK_WISE = {
|
|
32
|
-
visible: {
|
|
33
|
-
rotate: 0,
|
|
34
|
-
scale: 1,
|
|
35
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeOut" },
|
|
36
|
-
},
|
|
37
|
-
hidden: {
|
|
38
|
-
rotate: -180,
|
|
39
|
-
scale: 0.6,
|
|
40
|
-
transition: { duration: DURATION_AVERAGE, ease: "easeIn" },
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function AnimatedSwitcher({ initialChild, switched, switchTo, type = "slideFromBottom", }) {
|
|
45
|
-
const [ref, setRef] = useState(null);
|
|
46
|
-
const isSwitchingBetweenIcons = initialChild.type === Icon && switchTo.type === Icon;
|
|
47
|
-
const { key, transition, child, duration } = getChildData();
|
|
48
|
-
return (React.createElement(AnimatePresence, { mode: "wait", initial: false },
|
|
49
|
-
React.createElement(motion.div, { ref: setRef, key: key, variants: transition, initial: "hidden", animate: "visible", exit: "hidden", transition: { duration }, style: { display: getDisplayValue() } }, child)));
|
|
50
|
-
function getDisplayValue() {
|
|
51
|
-
if (ref === null || ref === void 0 ? void 0 : ref.firstElementChild) {
|
|
52
|
-
return window.getComputedStyle(ref.firstElementChild).display;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function getChildData() {
|
|
56
|
-
let data = { key: `${initialChild.type}_1`, child: initialChild };
|
|
57
|
-
if (switched) {
|
|
58
|
-
data = { key: `${switchTo.type}_2`, child: switchTo };
|
|
59
|
-
}
|
|
60
|
-
return Object.assign(Object.assign({}, data), { transition: getTransitionType(), duration: getTransitionDuration() });
|
|
61
|
-
}
|
|
62
|
-
function getTransitionType() {
|
|
63
|
-
if (isSwitchingBetweenIcons) {
|
|
64
|
-
if (switched)
|
|
65
|
-
return SPIN_COUNTER_CLOCK_WISE;
|
|
66
|
-
return SPIN_CLOCK_WISE;
|
|
67
|
-
}
|
|
68
|
-
else if (type === "fade") {
|
|
69
|
-
return FADE;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
if (switched)
|
|
73
|
-
return SLIDE_IN_UP;
|
|
74
|
-
return SLIDE_IN_DOWN;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function getTransitionDuration() {
|
|
78
|
-
switch (type) {
|
|
79
|
-
case "fade":
|
|
80
|
-
return DURATION_AVERAGE;
|
|
81
|
-
default:
|
|
82
|
-
return DURATION_SIMPLE;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
AnimatedSwitcher.Icon = function AnimatedSwitcherIcon({ switchToIcon, switched, initialIcon, }) {
|
|
87
|
-
return (React.createElement(AnimatedSwitcher, { switched: switched, initialChild: React.createElement(Icon, { name: initialIcon }), switchTo: React.createElement(Icon, { name: switchToIcon }) }));
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export { AnimatedSwitcher as A };
|
package/dist/AnimatedSwitcher.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { _ as __rest, a as __awaiter } from './tslib.es6-c563c1dd.js';
|
|
2
|
-
import React, { useState, useEffect, forwardRef, useRef } from 'react';
|
|
3
|
-
import debounce from 'lodash/debounce';
|
|
4
|
-
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
5
|
-
import classnames from 'classnames';
|
|
6
|
-
import { createPortal } from 'react-dom';
|
|
7
|
-
import { usePopper } from 'react-popper';
|
|
8
|
-
import { useOnKeyDown } from '@jobber/hooks/useOnKeyDown';
|
|
9
|
-
import { useSafeLayoutEffect } from '@jobber/hooks/useSafeLayoutEffect';
|
|
10
|
-
import { T as Text } from './Text-c92ddeb3.js';
|
|
11
|
-
import { I as Icon } from './Icon-22723fe6.js';
|
|
12
|
-
import { H as Heading } from './Heading-dfd4f1cf.js';
|
|
13
|
-
import { I as InputText } from './InputText-2fd8f942.js';
|
|
14
|
-
|
|
15
|
-
var css_248z = ".v0Cys9vQ-NE- {\n position: relative;\n width: 100%;\n}\n\n.CX-N-e0e6og- {\n display: none;\n position: absolute;\n z-index: calc(var(--elevation-menu) + var(--elevation-modal));\n width: 100%;\n /* Unfortunately this is how we define our line item picker height in jobber online.\n This is a concession to maintain visual parity. */\n max-height: 300px;\n box-shadow: var(--shadow-base);\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: var(--border-base) solid var(--color-color-border);\n border-radius: var(--radius-base);\n overflow: auto;\n scroll-behavior: smooth;\n background-color: var(--color-surface);\n}\n\n.CX-N-e0e6og- h5 {\n padding: var(--space-small) 0 var(--space-smaller) var(--space-small);\n border-bottom: var(--border-base) solid var(--color-border--section);\n}\n\n.CX-N-e0e6og-._4PlUaegVpkk- {\n display: block;\n}\n\n.CX-N-e0e6og-._4PlUaegVpkk-:empty {\n display: none;\n}\n\n.ucQtG0iwqbo- {\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -ms-flex-line-pack: stretch;\n align-content: stretch;\n -ms-flex-align: center;\n align-items: center;\n padding: var(--space-small);\n border: none;\n text-align: left;\n list-style: none;\n background-color: transparent;\n cursor: pointer;\n transition: all var(--timing-base);\n}\n\n.ucQtG0iwqbo-:hover,\n.ucQtG0iwqbo-:focus,\n.ucQtG0iwqbo-.r8HS-ma79QE- {\n background-color: var(--color-surface--hover);\n outline-color: var(--color-focus);\n}\n\n.ucQtG0iwqbo-.ydwLX44YFZc-:not(:last-child) {\n border-bottom: var(--border-base) solid var(--color-border);\n}\n\n.CX-N-e0e6og-:hover .ucQtG0iwqbo-.r8HS-ma79QE-:not(:hover) {\n background-color: transparent;\n outline-color: transparent;\n}\n\n.v0Cys9vQ-NE- .PvUgNoAUG7A-:not(:first-child) {\n padding-top: var(--space-small);\n}\n\n.ucQtG0iwqbo- .DAOOFUZ1BRM- {\n -ms-flex: 0 1 auto;\n flex: 0 1 auto;\n -ms-flex-item-align: auto;\n align-self: auto;\n width: var(--space-large);\n}\n\n.ucQtG0iwqbo- .cjKJFup6hGY- {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex: 1 100%;\n flex: 1 100%;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n\n.ucQtG0iwqbo- .hG5zNBuI2wA- {\n -ms-flex: 2;\n flex: 2;\n}\n\n.ucQtG0iwqbo- ._3CwjFCbhqi4- {\n -ms-flex: 1;\n flex: 1;\n -ms-flex-item-align: end;\n align-self: flex-end;\n text-align: right;\n}\n";
|
|
16
|
-
var styles = {"autocomplete":"v0Cys9vQ-NE-","options":"CX-N-e0e6og-","visible":"_4PlUaegVpkk-","option":"ucQtG0iwqbo-","active":"r8HS-ma79QE-","separator":"ydwLX44YFZc-","heading":"PvUgNoAUG7A-","icon":"DAOOFUZ1BRM-","text":"cjKJFup6hGY-","label":"hG5zNBuI2wA-","details":"_3CwjFCbhqi4-"};
|
|
17
|
-
styleInject(css_248z);
|
|
18
|
-
|
|
19
|
-
var IndexChange;
|
|
20
|
-
(function (IndexChange) {
|
|
21
|
-
IndexChange[IndexChange["Previous"] = -1] = "Previous";
|
|
22
|
-
IndexChange[IndexChange["Next"] = 1] = "Next";
|
|
23
|
-
})(IndexChange || (IndexChange = {}));
|
|
24
|
-
function Menu({ visible, options, selectedOption, onOptionSelect, attachTo, }) {
|
|
25
|
-
const [highlightedIndex, setHighlightedIndex] = useState(0);
|
|
26
|
-
const { menuRef, setMenuRef, styles: popperStyles, attributes, targetWidth, } = useRepositionMenu(attachTo, visible);
|
|
27
|
-
const detectSeparatorCondition = (option) => option.description || option.details;
|
|
28
|
-
const detectGroups = (option) => option.options;
|
|
29
|
-
const addSeparators = options.some(detectSeparatorCondition);
|
|
30
|
-
const initialHighlight = options.some(detectGroups) ? 1 : 0;
|
|
31
|
-
setupKeyListeners();
|
|
32
|
-
useEffect(() => setHighlightedIndex(initialHighlight), [options]);
|
|
33
|
-
const menu = (React.createElement("div", Object.assign({ className: classnames(styles.options, { [styles.visible]: visible }), ref: setMenuRef, style: Object.assign(Object.assign({}, popperStyles.popper), { width: targetWidth }) }, attributes.popper), options.map((option, index) => {
|
|
34
|
-
const optionClass = classnames(styles.option, {
|
|
35
|
-
[styles.active]: index === highlightedIndex,
|
|
36
|
-
[styles.separator]: addSeparators,
|
|
37
|
-
});
|
|
38
|
-
if (isGroup(option)) {
|
|
39
|
-
return (React.createElement("div", { key: option.label, className: styles.heading },
|
|
40
|
-
React.createElement(Heading, { level: 5 }, option.label)));
|
|
41
|
-
}
|
|
42
|
-
return (React.createElement("button", { className: optionClass, key: option.value, onMouseDown: onOptionSelect.bind(undefined, option) },
|
|
43
|
-
React.createElement("div", { className: styles.icon }, isOptionSelected(selectedOption, option) && (React.createElement(Icon, { name: "checkmark", size: "small" }))),
|
|
44
|
-
React.createElement("div", { className: styles.text },
|
|
45
|
-
React.createElement("div", { className: styles.label },
|
|
46
|
-
React.createElement(Text, null, option.label),
|
|
47
|
-
option.description !== undefined && (React.createElement(Text, { variation: "subdued" }, option.description))),
|
|
48
|
-
option.details !== undefined && (React.createElement("div", { className: styles.details },
|
|
49
|
-
React.createElement(Text, null, option.details))))));
|
|
50
|
-
})));
|
|
51
|
-
return createPortal(menu, document.body);
|
|
52
|
-
function setupKeyListeners() {
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
(_b = (_a = menuRef === null || menuRef === void 0 ? void 0 : menuRef.children[highlightedIndex]) === null || _a === void 0 ? void 0 : _a.scrollIntoView) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
56
|
-
behavior: "smooth",
|
|
57
|
-
block: "nearest",
|
|
58
|
-
inline: "start",
|
|
59
|
-
});
|
|
60
|
-
}, [highlightedIndex]);
|
|
61
|
-
useOnKeyDown((event) => {
|
|
62
|
-
const indexChange = arrowKeyPress(event, IndexChange.Next);
|
|
63
|
-
if (indexChange) {
|
|
64
|
-
setHighlightedIndex(Math.min(options.length - 1, highlightedIndex + indexChange));
|
|
65
|
-
}
|
|
66
|
-
}, "ArrowDown");
|
|
67
|
-
useOnKeyDown((event) => {
|
|
68
|
-
const indexChange = arrowKeyPress(event, IndexChange.Previous);
|
|
69
|
-
if (indexChange) {
|
|
70
|
-
setHighlightedIndex(Math.max(0, highlightedIndex + indexChange));
|
|
71
|
-
}
|
|
72
|
-
}, "ArrowUp");
|
|
73
|
-
useOnKeyDown((event) => {
|
|
74
|
-
if (!visible)
|
|
75
|
-
return;
|
|
76
|
-
if (isGroup(options[highlightedIndex]))
|
|
77
|
-
return;
|
|
78
|
-
event.preventDefault();
|
|
79
|
-
onOptionSelect(options[highlightedIndex]);
|
|
80
|
-
}, "Enter");
|
|
81
|
-
}
|
|
82
|
-
function arrowKeyPress(event, direction) {
|
|
83
|
-
if (!visible)
|
|
84
|
-
return;
|
|
85
|
-
event.preventDefault();
|
|
86
|
-
const requestedIndex = options[highlightedIndex + direction];
|
|
87
|
-
return requestedIndex && isGroup(requestedIndex)
|
|
88
|
-
? direction + direction
|
|
89
|
-
: direction;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function isOptionSelected(selectedOption, option) {
|
|
93
|
-
return selectedOption && selectedOption.value === option.value;
|
|
94
|
-
}
|
|
95
|
-
function isGroup(option) {
|
|
96
|
-
if (option.options)
|
|
97
|
-
return true;
|
|
98
|
-
return false;
|
|
99
|
-
}
|
|
100
|
-
function useRepositionMenu(attachTo, visible = false) {
|
|
101
|
-
var _a;
|
|
102
|
-
const [menuRef, setMenuRef] = useState();
|
|
103
|
-
const popper = usePopper(attachTo.current, menuRef, {
|
|
104
|
-
modifiers: [
|
|
105
|
-
{ name: "offset", options: { offset: [0, 8] } },
|
|
106
|
-
{ name: "flip", options: { fallbackPlacements: ["top"] } },
|
|
107
|
-
],
|
|
108
|
-
});
|
|
109
|
-
useSafeLayoutEffect(() => {
|
|
110
|
-
var _a;
|
|
111
|
-
(_a = popper === null || popper === void 0 ? void 0 : popper.update) === null || _a === void 0 ? void 0 : _a.call(popper);
|
|
112
|
-
}, [visible]);
|
|
113
|
-
const targetWidth = (_a = attachTo.current) === null || _a === void 0 ? void 0 : _a.clientWidth;
|
|
114
|
-
return Object.assign(Object.assign({}, popper), { menuRef, setMenuRef, targetWidth });
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Max statements increased to make room for the debounce functions
|
|
118
|
-
/* eslint max-statements: ["error", 14] */
|
|
119
|
-
function AutocompleteInternal(_a, ref) {
|
|
120
|
-
var _b;
|
|
121
|
-
var { initialOptions = [], value, allowFreeForm = true, size = undefined, debounce: debounceRate = 300, onChange, getOptions, placeholder, onBlur, onFocus, validations } = _a, inputProps = __rest(_a, ["initialOptions", "value", "allowFreeForm", "size", "debounce", "onChange", "getOptions", "placeholder", "onBlur", "onFocus", "validations"]);
|
|
122
|
-
const [options, setOptions] = useState(initialOptions);
|
|
123
|
-
const [menuVisible, setMenuVisible] = useState(false);
|
|
124
|
-
const [inputText, setInputText] = useState((_b = value === null || value === void 0 ? void 0 : value.label) !== null && _b !== void 0 ? _b : "");
|
|
125
|
-
const autocompleteRef = useRef(null);
|
|
126
|
-
const delayedSearch = debounce(updateSearch, debounceRate);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
delayedSearch();
|
|
129
|
-
return delayedSearch.cancel;
|
|
130
|
-
}, [inputText]);
|
|
131
|
-
useEffect(() => {
|
|
132
|
-
var _a;
|
|
133
|
-
updateInput((_a = value === null || value === void 0 ? void 0 : value.label) !== null && _a !== void 0 ? _a : "");
|
|
134
|
-
}, [value]);
|
|
135
|
-
return (React.createElement("div", { className: styles.autocomplete, ref: autocompleteRef },
|
|
136
|
-
React.createElement(InputText, Object.assign({ ref: ref, autocomplete: false, size: size, value: inputText, onChange: handleInputChange, placeholder: placeholder, onFocus: handleInputFocus, onBlur: handleInputBlur, validations: validations }, inputProps)),
|
|
137
|
-
menuVisible && (React.createElement(Menu, { attachTo: autocompleteRef, visible: menuVisible && options.length > 0, options: options, selectedOption: value, onOptionSelect: handleMenuChange }))));
|
|
138
|
-
function updateInput(newText) {
|
|
139
|
-
setInputText(newText);
|
|
140
|
-
if (newText === "") {
|
|
141
|
-
setOptions(mapToOptions(initialOptions));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function updateSearch() {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
const updatedOptions = yield getOptions(inputText);
|
|
147
|
-
const filteredOptions = updatedOptions.filter((option) => "options" in option && option.options ? option.options.length > 0 : true);
|
|
148
|
-
setOptions(mapToOptions(filteredOptions));
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
function handleMenuChange(chosenOption) {
|
|
152
|
-
onChange(chosenOption);
|
|
153
|
-
updateInput(chosenOption.label);
|
|
154
|
-
setMenuVisible(false);
|
|
155
|
-
}
|
|
156
|
-
function handleInputChange(newText) {
|
|
157
|
-
updateInput(newText);
|
|
158
|
-
if (allowFreeForm) {
|
|
159
|
-
onChange({ label: newText });
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function handleInputBlur() {
|
|
163
|
-
setMenuVisible(false);
|
|
164
|
-
if (value == undefined || value.label !== inputText) {
|
|
165
|
-
setInputText("");
|
|
166
|
-
onChange(undefined);
|
|
167
|
-
}
|
|
168
|
-
onBlur && onBlur();
|
|
169
|
-
}
|
|
170
|
-
function handleInputFocus() {
|
|
171
|
-
setMenuVisible(true);
|
|
172
|
-
if (onFocus) {
|
|
173
|
-
onFocus();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function mapToOptions(items) {
|
|
178
|
-
return items.reduce(function (result, item) {
|
|
179
|
-
result = result.concat([item]);
|
|
180
|
-
if (item.options) {
|
|
181
|
-
result = result.concat(item.options);
|
|
182
|
-
}
|
|
183
|
-
return result;
|
|
184
|
-
}, []);
|
|
185
|
-
}
|
|
186
|
-
const Autocomplete = forwardRef(AutocompleteInternal);
|
|
187
|
-
|
|
188
|
-
export { Autocomplete as A };
|
package/dist/Autocomplete.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var Autocomplete = require('./Autocomplete-b35c7ff5.js');
|
|
6
|
-
require('./tslib.es6-754e2961.js');
|
|
7
|
-
require('react');
|
|
8
|
-
require('lodash/debounce');
|
|
9
|
-
require('./style-inject.es-9d2f5f4e.js');
|
|
10
|
-
require('classnames');
|
|
11
|
-
require('react-dom');
|
|
12
|
-
require('react-popper');
|
|
13
|
-
require('@jobber/hooks/useOnKeyDown');
|
|
14
|
-
require('@jobber/hooks/useSafeLayoutEffect');
|
|
15
|
-
require('./Text-714f7d14.js');
|
|
16
|
-
require('./Typography-fd88fcce.js');
|
|
17
|
-
require('./Icon-405a216c.js');
|
|
18
|
-
require('@jobber/design');
|
|
19
|
-
require('./Heading-a8a24775.js');
|
|
20
|
-
require('./getAtlantisConfig-0f3e8af2.js');
|
|
21
|
-
require('./InputText-125769fd.js');
|
|
22
|
-
require('./FormField-fc30bb1a.js');
|
|
23
|
-
require('react-hook-form');
|
|
24
|
-
require('@jobber/hooks/useShowClear');
|
|
25
|
-
require('./Button-ec64869e.js');
|
|
26
|
-
require('react-router-dom');
|
|
27
|
-
require('./InputValidation-4a61254d.js');
|
|
28
|
-
require('framer-motion');
|
|
29
|
-
require('./Spinner-3480bc34.js');
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.Autocomplete = Autocomplete.Autocomplete;
|
package/dist/Autocomplete.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export { A as Autocomplete } from './Autocomplete-dc7a4b9e.js';
|
|
2
|
-
import './tslib.es6-c563c1dd.js';
|
|
3
|
-
import 'react';
|
|
4
|
-
import 'lodash/debounce';
|
|
5
|
-
import './style-inject.es-a0e1a0ba.js';
|
|
6
|
-
import 'classnames';
|
|
7
|
-
import 'react-dom';
|
|
8
|
-
import 'react-popper';
|
|
9
|
-
import '@jobber/hooks/useOnKeyDown';
|
|
10
|
-
import '@jobber/hooks/useSafeLayoutEffect';
|
|
11
|
-
import './Text-c92ddeb3.js';
|
|
12
|
-
import './Typography-52ed1386.js';
|
|
13
|
-
import './Icon-22723fe6.js';
|
|
14
|
-
import '@jobber/design';
|
|
15
|
-
import './Heading-dfd4f1cf.js';
|
|
16
|
-
import './getAtlantisConfig-5b50057c.js';
|
|
17
|
-
import './InputText-2fd8f942.js';
|
|
18
|
-
import './FormField-f1f405d2.js';
|
|
19
|
-
import 'react-hook-form';
|
|
20
|
-
import '@jobber/hooks/useShowClear';
|
|
21
|
-
import './Button-30154871.js';
|
|
22
|
-
import 'react-router-dom';
|
|
23
|
-
import './InputValidation-fe42fc3f.js';
|
|
24
|
-
import 'framer-motion';
|
|
25
|
-
import './Spinner-90081e20.js';
|
package/dist/Avatar-229083ec.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
4
|
-
import Color from 'color';
|
|
5
|
-
import { I as Icon } from './Icon-22723fe6.js';
|
|
6
|
-
|
|
7
|
-
var css_248z = ":root {\n --avatar-size: calc(var(--base-unit) * 2);\n --avatar-border-size: var(--border-base);\n}\n\n.WniTNadEyPk- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n width: calc(var(--base-unit) * 2);\n width: var(--avatar-size);\n height: calc(var(--base-unit) * 2);\n height: var(--avatar-size);\n min-width: calc(var(--base-unit) * 2);\n min-width: var(--avatar-size);\n min-height: calc(var(--base-unit) * 2);\n min-height: var(--avatar-size);\n border-radius: var(--radius-circle);\n color: var(--color-heading);\n font-size: calc(var(--base-unit) * 2);\n font-size: var(--avatar-size);\n -webkit-font-smoothing: antialiased;\n background: no-repeat center center var(--color-greyBlue);\n background-size: cover;\n}\n\n.WniTNadEyPk-:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n\n._8Pqn2uZpaZg- {\n --avatar-size: calc(var(--base-unit) * 4.5);\n --avatar-border-size: var(--border-thick);\n}\n\n.S-edTXYA-7E- {\n --avatar-size: calc(var(--base-unit) * 1.5);\n}\n\n.S1iBGElfOUA- {\n color: var(--color-text--reverse);\n}\n\n.ErPhpHHpiBQ- {\n font-size: calc((var(--base-unit) * 2) / 2);\n font-size: calc(calc(var(--base-unit) * 2) / 2);\n font-size: calc(var(--avatar-size) / 2);\n text-transform: uppercase;\n}\n\n.aC-d-mngrIc- {\n font-size: calc((var(--base-unit) * 2) / 2.25);\n font-size: calc(calc(var(--base-unit) * 2) / 2.25);\n font-size: calc(var(--avatar-size) / 2.25);\n}\n\n.nR0S-GzjDnQ- {\n width: calc((var(--base-unit) * 2) - (var(--border-base) * 2));\n width: calc(calc(var(--base-unit) * 2) - (var(--border-base) * 2));\n width: calc(var(--avatar-size) - (var(--avatar-border-size) * 2));\n height: calc((var(--base-unit) * 2) - (var(--border-base) * 2));\n height: calc(calc(var(--base-unit) * 2) - (var(--border-base) * 2));\n height: calc(var(--avatar-size) - (var(--avatar-border-size) * 2));\n box-shadow: 0 0 0 var(--border-thick) var(--color-white) inset;\n border-style: solid;\n border-width: var(--border-base);\n border-width: var(--avatar-border-size);\n}\n";
|
|
8
|
-
var styles = {"avatar":"WniTNadEyPk-","large":"_8Pqn2uZpaZg-","small":"S-edTXYA-7E-","isDark":"S1iBGElfOUA-","initials":"ErPhpHHpiBQ-","smallInitials":"aC-d-mngrIc-","hasBorder":"nR0S-GzjDnQ-"};
|
|
9
|
-
styleInject(css_248z);
|
|
10
|
-
|
|
11
|
-
function isDark(colorToCheck) {
|
|
12
|
-
if (colorToCheck == undefined) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
if (colorToCheck) {
|
|
16
|
-
try {
|
|
17
|
-
return Color(deconstructCssCustomProperty(colorToCheck)).isDark();
|
|
18
|
-
}
|
|
19
|
-
catch (err) {
|
|
20
|
-
console.log(err);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
function deconstructCssCustomProperty(color) {
|
|
26
|
-
if (!color) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
if (!color.toLowerCase().startsWith("var(")) {
|
|
30
|
-
return color;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Rips apart the `var(--custom-property)` into just `--custom-property`.
|
|
34
|
-
*/
|
|
35
|
-
const customProperty = color
|
|
36
|
-
.replace("var(", "")
|
|
37
|
-
.slice(0, -1)
|
|
38
|
-
.split(" ")
|
|
39
|
-
.join("");
|
|
40
|
-
return getComputedStyle(document.documentElement)
|
|
41
|
-
.getPropertyValue(customProperty)
|
|
42
|
-
.trim();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function Avatar({ imageUrl, name, initials, size = "base", color, }) {
|
|
46
|
-
const style = {
|
|
47
|
-
backgroundColor: color,
|
|
48
|
-
borderColor: color,
|
|
49
|
-
};
|
|
50
|
-
if (imageUrl) {
|
|
51
|
-
style.backgroundImage = `url(${imageUrl})`;
|
|
52
|
-
}
|
|
53
|
-
const shouldBeDark = color == undefined || isDark(color);
|
|
54
|
-
const className = classnames(styles.avatar, size !== "base" && styles[size], {
|
|
55
|
-
[styles.hasBorder]: imageUrl && color,
|
|
56
|
-
[styles.isDark]: shouldBeDark,
|
|
57
|
-
});
|
|
58
|
-
return (React.createElement("div", { className: className, style: style, role: imageUrl && "img", "aria-label": name }, !imageUrl && (React.createElement(Initials, { initials: initials, dark: shouldBeDark, iconSize: size }))));
|
|
59
|
-
}
|
|
60
|
-
function Initials({ initials, dark = false, iconSize = "base", }) {
|
|
61
|
-
if (!initials) {
|
|
62
|
-
return (React.createElement(Icon, { name: "person", color: dark ? "white" : "blue", size: iconSize }));
|
|
63
|
-
}
|
|
64
|
-
const className = classnames(styles.initials, {
|
|
65
|
-
[styles.smallInitials]: initials.length > 2,
|
|
66
|
-
});
|
|
67
|
-
return React.createElement("span", { className: className }, initials.substr(0, 3));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export { Avatar as A };
|
package/dist/Avatar.js
DELETED
package/dist/Banner-18d94700.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var classnames = require('classnames');
|
|
5
|
-
var jobberHooks = require('@jobber/hooks/useResizeObserver');
|
|
6
|
-
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
7
|
-
var getAtlantisConfig = require('./getAtlantisConfig-0f3e8af2.js');
|
|
8
|
-
var Icon = require('./Icon-405a216c.js');
|
|
9
|
-
var Text = require('./Text-714f7d14.js');
|
|
10
|
-
var Button = require('./Button-ec64869e.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
-
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
16
|
-
|
|
17
|
-
var css_248z$2 = ".meuT8gYQPJU- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n box-shadow: var(--shadow-base);\n padding: var(--space-base);\n color: var(--color-text);\n background-color: var(--color-surface--background);\n gap: var(--space-small);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.jobber-retheme .meuT8gYQPJU- {\n padding: calc(var(--space-base) - var(--space-smaller)) var(--space-base);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-base);\n background-color: var(--color-surface);\n}\n\n.y4BapyZr-fo- > a {\n color: var(--color-text);\n}\n\n.y4BapyZr-fo- > a:hover {\n color: var(--color-blue);\n}\n\n._6v1woNSLEvc- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n gap: var(--space-small);\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n@media (--small-screens-and-below) {\n\n._6v1woNSLEvc- {\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n }\n\n.y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n -ms-flex-item-align: center;\n align-self: center;\n}\n\n._6v1woNSLEvc- > *:last-child {\n margin-bottom: 0;\n}\n\n.bocgLmEhcTU- .y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n}\n\n.rtNjEzmABX4- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n\n@media (--small-screens-and-below) {\n\n.rtNjEzmABX4- {\n width: 100%;\n margin-top: var(--space-small);\n}\n }\n\n.lunQ5SOfyLg- {\n margin: calc(var(--space-smallest) * -1) 0;\n padding: var(--space-smallest);\n border: none;\n background-color: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n -ms-flex: 0;\n flex: 0;\n -ms-flex-item-align: start;\n align-self: flex-start;\n}\n\n.lunQ5SOfyLg-:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n\n.lunQ5SOfyLg-:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n background: rgba(0, 0, 0, 0.05);\n}\n\n.SG8xSJADp2k- {\n display: -ms-inline-flexbox;\n display: inline-flex;\n padding: var(--space-smaller);\n border-radius: var(--radius-circle);\n background-color: var(--color-surface--background);\n}\n\n.jobber-retheme .bocgLmEhcTU- .SG8xSJADp2k- {\n -ms-flex-item-align: center;\n align-self: center;\n}\n";
|
|
18
|
-
var styles = {"banner":"meuT8gYQPJU-","bannerChildren":"y4BapyZr-fo-","bannerContent":"_6v1woNSLEvc-","medium":"bocgLmEhcTU-","bannerAction":"rtNjEzmABX4-","closeButton":"lunQ5SOfyLg-","iconWrapper":"SG8xSJADp2k-"};
|
|
19
|
-
styleInject_es.styleInject(css_248z$2);
|
|
20
|
-
|
|
21
|
-
var css_248z$1 = ".wWW-2T7rCV0- {\n background-color: var(--color-informative--surface);\n}\n\n/* Our Banner \"surface\" colors should be lighter than they are so we're leaving the following alone for now */\n\n._7h8FUHIkVjg- {\n background-color: var(--color-green--lighter);\n}\n\n.d5fXcE1L0lc- {\n background-color: var(--color-yellow--lighter);\n}\n\n.oYaw-T3c0IU- {\n background-color: var(--color-red--lighter);\n}\n";
|
|
22
|
-
var types = {"notice":"wWW-2T7rCV0-","success":"_7h8FUHIkVjg-","warning":"d5fXcE1L0lc-","error":"oYaw-T3c0IU-"};
|
|
23
|
-
styleInject_es.styleInject(css_248z$1);
|
|
24
|
-
|
|
25
|
-
var css_248z = "._5-B0X5vn0eA- {\n background-color: var(--color-success);\n}\n\n.r3hqur-vxwI- {\n background-color: var(--color-destructive);\n}\n\n.-c8TbjyV5YU- {\n background-color: var(--color-warning);\n}\n\n.bMc69fYWngM- {\n background-color: var(--color-informative);\n}\n";
|
|
26
|
-
var iconStyles = {"success":"_5-B0X5vn0eA-","error":"r3hqur-vxwI-","warning":"-c8TbjyV5YU-","notice":"bMc69fYWngM-"};
|
|
27
|
-
styleInject_es.styleInject(css_248z);
|
|
28
|
-
|
|
29
|
-
function BannerIcon({ icon, type }) {
|
|
30
|
-
const { JOBBER_RETHEME } = getAtlantisConfig.getAtlantisConfig();
|
|
31
|
-
if (JOBBER_RETHEME) {
|
|
32
|
-
return (React__default["default"].createElement("span", { className: classnames__default["default"](styles.iconWrapper, iconStyles[type]) },
|
|
33
|
-
React__default["default"].createElement(Icon.Icon, { name: icon, color: "white", size: "small" })));
|
|
34
|
-
}
|
|
35
|
-
return React__default["default"].createElement(Icon.Icon, { name: icon, color: "greyBlueDark" });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function Banner({ children, type, primaryAction, dismissible = true, icon, onDismiss, }) {
|
|
39
|
-
const { JOBBER_RETHEME } = getAtlantisConfig.getAtlantisConfig();
|
|
40
|
-
const [showBanner, setShowBanner] = React.useState(true);
|
|
41
|
-
const bannerIcon = icon || getBannerIcon(type);
|
|
42
|
-
const bannerWidths = {
|
|
43
|
-
small: 320,
|
|
44
|
-
medium: 480,
|
|
45
|
-
};
|
|
46
|
-
const [bannerRef, { width: bannerWidth = bannerWidths.small }] = jobberHooks.useResizeObserver({
|
|
47
|
-
widths: bannerWidths,
|
|
48
|
-
});
|
|
49
|
-
const iconColors = {
|
|
50
|
-
notice: "informative",
|
|
51
|
-
success: "success",
|
|
52
|
-
warning: "warning",
|
|
53
|
-
error: "critical",
|
|
54
|
-
};
|
|
55
|
-
if (primaryAction != undefined) {
|
|
56
|
-
primaryAction = Object.assign({
|
|
57
|
-
size: "small",
|
|
58
|
-
type: "tertiary",
|
|
59
|
-
variation: type === "notice" ? "learning" : "work",
|
|
60
|
-
}, primaryAction);
|
|
61
|
-
}
|
|
62
|
-
const bannerClassNames = classnames__default["default"](styles.banner, types[type], {
|
|
63
|
-
[styles.medium]: bannerWidth >= bannerWidths.medium,
|
|
64
|
-
});
|
|
65
|
-
if (!showBanner)
|
|
66
|
-
return null;
|
|
67
|
-
return (React__default["default"].createElement("div", { className: bannerClassNames, ref: bannerRef, role: type === "error" ? "alert" : "status" },
|
|
68
|
-
React__default["default"].createElement("div", { className: styles.bannerContent },
|
|
69
|
-
bannerIcon && React__default["default"].createElement(BannerIcon, { icon: bannerIcon, type: type }),
|
|
70
|
-
React__default["default"].createElement("div", { className: styles.bannerChildren },
|
|
71
|
-
React__default["default"].createElement(BannerChildren, null, children)),
|
|
72
|
-
primaryAction && (React__default["default"].createElement("div", { className: styles.bannerAction },
|
|
73
|
-
React__default["default"].createElement(Button.Button, Object.assign({}, primaryAction))))),
|
|
74
|
-
dismissible && (React__default["default"].createElement("button", { type: "button", className: styles.closeButton, onClick: handleClose, "aria-label": "Close this notification" },
|
|
75
|
-
React__default["default"].createElement(Icon.Icon, { name: "cross", color: JOBBER_RETHEME ? "interactiveSubtle" : iconColors[type] })))));
|
|
76
|
-
function handleClose() {
|
|
77
|
-
setShowBanner(!showBanner);
|
|
78
|
-
onDismiss && onDismiss();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function getBannerIcon(type) {
|
|
82
|
-
const { JOBBER_RETHEME } = getAtlantisConfig.getAtlantisConfig();
|
|
83
|
-
if (!JOBBER_RETHEME)
|
|
84
|
-
return;
|
|
85
|
-
switch (type) {
|
|
86
|
-
case "notice":
|
|
87
|
-
return "starburst";
|
|
88
|
-
case "success":
|
|
89
|
-
return "checkmark";
|
|
90
|
-
case "warning":
|
|
91
|
-
return "help";
|
|
92
|
-
case "error":
|
|
93
|
-
return "alert";
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function BannerChildren({ children, }) {
|
|
97
|
-
if (!children)
|
|
98
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
99
|
-
if (children && typeof children === "string") {
|
|
100
|
-
return React__default["default"].createElement(Text.Text, null, children);
|
|
101
|
-
}
|
|
102
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
exports.Banner = Banner;
|
package/dist/Banner-5475a9ea.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { useResizeObserver } from '@jobber/hooks/useResizeObserver';
|
|
4
|
-
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
5
|
-
import { g as getAtlantisConfig } from './getAtlantisConfig-5b50057c.js';
|
|
6
|
-
import { I as Icon } from './Icon-22723fe6.js';
|
|
7
|
-
import { T as Text } from './Text-c92ddeb3.js';
|
|
8
|
-
import { B as Button } from './Button-30154871.js';
|
|
9
|
-
|
|
10
|
-
var css_248z$2 = ".meuT8gYQPJU- {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n box-shadow: var(--shadow-base);\n padding: var(--space-base);\n color: var(--color-text);\n background-color: var(--color-surface--background);\n gap: var(--space-small);\n -ms-flex-align: center;\n align-items: center;\n}\n\n.jobber-retheme .meuT8gYQPJU- {\n padding: calc(var(--space-base) - var(--space-smaller)) var(--space-base);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-base);\n background-color: var(--color-surface);\n}\n\n.y4BapyZr-fo- > a {\n color: var(--color-text);\n}\n\n.y4BapyZr-fo- > a:hover {\n color: var(--color-blue);\n}\n\n._6v1woNSLEvc- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n gap: var(--space-small);\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n@media (--small-screens-and-below) {\n\n._6v1woNSLEvc- {\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n}\n }\n\n.y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n -ms-flex-item-align: center;\n align-self: center;\n}\n\n._6v1woNSLEvc- > *:last-child {\n margin-bottom: 0;\n}\n\n.bocgLmEhcTU- .y4BapyZr-fo- {\n -ms-flex: 1;\n flex: 1;\n}\n\n.rtNjEzmABX4- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n}\n\n@media (--small-screens-and-below) {\n\n.rtNjEzmABX4- {\n width: 100%;\n margin-top: var(--space-small);\n}\n }\n\n.lunQ5SOfyLg- {\n margin: calc(var(--space-smallest) * -1) 0;\n padding: var(--space-smallest);\n border: none;\n background-color: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n -ms-flex: 0;\n flex: 0;\n -ms-flex-item-align: start;\n align-self: flex-start;\n}\n\n.lunQ5SOfyLg-:hover {\n background: rgba(0, 0, 0, 0.025);\n}\n\n.lunQ5SOfyLg-:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n background: rgba(0, 0, 0, 0.05);\n}\n\n.SG8xSJADp2k- {\n display: -ms-inline-flexbox;\n display: inline-flex;\n padding: var(--space-smaller);\n border-radius: var(--radius-circle);\n background-color: var(--color-surface--background);\n}\n\n.jobber-retheme .bocgLmEhcTU- .SG8xSJADp2k- {\n -ms-flex-item-align: center;\n align-self: center;\n}\n";
|
|
11
|
-
var styles = {"banner":"meuT8gYQPJU-","bannerChildren":"y4BapyZr-fo-","bannerContent":"_6v1woNSLEvc-","medium":"bocgLmEhcTU-","bannerAction":"rtNjEzmABX4-","closeButton":"lunQ5SOfyLg-","iconWrapper":"SG8xSJADp2k-"};
|
|
12
|
-
styleInject(css_248z$2);
|
|
13
|
-
|
|
14
|
-
var css_248z$1 = ".wWW-2T7rCV0- {\n background-color: var(--color-informative--surface);\n}\n\n/* Our Banner \"surface\" colors should be lighter than they are so we're leaving the following alone for now */\n\n._7h8FUHIkVjg- {\n background-color: var(--color-green--lighter);\n}\n\n.d5fXcE1L0lc- {\n background-color: var(--color-yellow--lighter);\n}\n\n.oYaw-T3c0IU- {\n background-color: var(--color-red--lighter);\n}\n";
|
|
15
|
-
var types = {"notice":"wWW-2T7rCV0-","success":"_7h8FUHIkVjg-","warning":"d5fXcE1L0lc-","error":"oYaw-T3c0IU-"};
|
|
16
|
-
styleInject(css_248z$1);
|
|
17
|
-
|
|
18
|
-
var css_248z = "._5-B0X5vn0eA- {\n background-color: var(--color-success);\n}\n\n.r3hqur-vxwI- {\n background-color: var(--color-destructive);\n}\n\n.-c8TbjyV5YU- {\n background-color: var(--color-warning);\n}\n\n.bMc69fYWngM- {\n background-color: var(--color-informative);\n}\n";
|
|
19
|
-
var iconStyles = {"success":"_5-B0X5vn0eA-","error":"r3hqur-vxwI-","warning":"-c8TbjyV5YU-","notice":"bMc69fYWngM-"};
|
|
20
|
-
styleInject(css_248z);
|
|
21
|
-
|
|
22
|
-
function BannerIcon({ icon, type }) {
|
|
23
|
-
const { JOBBER_RETHEME } = getAtlantisConfig();
|
|
24
|
-
if (JOBBER_RETHEME) {
|
|
25
|
-
return (React.createElement("span", { className: classnames(styles.iconWrapper, iconStyles[type]) },
|
|
26
|
-
React.createElement(Icon, { name: icon, color: "white", size: "small" })));
|
|
27
|
-
}
|
|
28
|
-
return React.createElement(Icon, { name: icon, color: "greyBlueDark" });
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function Banner({ children, type, primaryAction, dismissible = true, icon, onDismiss, }) {
|
|
32
|
-
const { JOBBER_RETHEME } = getAtlantisConfig();
|
|
33
|
-
const [showBanner, setShowBanner] = useState(true);
|
|
34
|
-
const bannerIcon = icon || getBannerIcon(type);
|
|
35
|
-
const bannerWidths = {
|
|
36
|
-
small: 320,
|
|
37
|
-
medium: 480,
|
|
38
|
-
};
|
|
39
|
-
const [bannerRef, { width: bannerWidth = bannerWidths.small }] = useResizeObserver({
|
|
40
|
-
widths: bannerWidths,
|
|
41
|
-
});
|
|
42
|
-
const iconColors = {
|
|
43
|
-
notice: "informative",
|
|
44
|
-
success: "success",
|
|
45
|
-
warning: "warning",
|
|
46
|
-
error: "critical",
|
|
47
|
-
};
|
|
48
|
-
if (primaryAction != undefined) {
|
|
49
|
-
primaryAction = Object.assign({
|
|
50
|
-
size: "small",
|
|
51
|
-
type: "tertiary",
|
|
52
|
-
variation: type === "notice" ? "learning" : "work",
|
|
53
|
-
}, primaryAction);
|
|
54
|
-
}
|
|
55
|
-
const bannerClassNames = classnames(styles.banner, types[type], {
|
|
56
|
-
[styles.medium]: bannerWidth >= bannerWidths.medium,
|
|
57
|
-
});
|
|
58
|
-
if (!showBanner)
|
|
59
|
-
return null;
|
|
60
|
-
return (React.createElement("div", { className: bannerClassNames, ref: bannerRef, role: type === "error" ? "alert" : "status" },
|
|
61
|
-
React.createElement("div", { className: styles.bannerContent },
|
|
62
|
-
bannerIcon && React.createElement(BannerIcon, { icon: bannerIcon, type: type }),
|
|
63
|
-
React.createElement("div", { className: styles.bannerChildren },
|
|
64
|
-
React.createElement(BannerChildren, null, children)),
|
|
65
|
-
primaryAction && (React.createElement("div", { className: styles.bannerAction },
|
|
66
|
-
React.createElement(Button, Object.assign({}, primaryAction))))),
|
|
67
|
-
dismissible && (React.createElement("button", { type: "button", className: styles.closeButton, onClick: handleClose, "aria-label": "Close this notification" },
|
|
68
|
-
React.createElement(Icon, { name: "cross", color: JOBBER_RETHEME ? "interactiveSubtle" : iconColors[type] })))));
|
|
69
|
-
function handleClose() {
|
|
70
|
-
setShowBanner(!showBanner);
|
|
71
|
-
onDismiss && onDismiss();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function getBannerIcon(type) {
|
|
75
|
-
const { JOBBER_RETHEME } = getAtlantisConfig();
|
|
76
|
-
if (!JOBBER_RETHEME)
|
|
77
|
-
return;
|
|
78
|
-
switch (type) {
|
|
79
|
-
case "notice":
|
|
80
|
-
return "starburst";
|
|
81
|
-
case "success":
|
|
82
|
-
return "checkmark";
|
|
83
|
-
case "warning":
|
|
84
|
-
return "help";
|
|
85
|
-
case "error":
|
|
86
|
-
return "alert";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function BannerChildren({ children, }) {
|
|
90
|
-
if (!children)
|
|
91
|
-
return React.createElement(React.Fragment, null);
|
|
92
|
-
if (children && typeof children === "string") {
|
|
93
|
-
return React.createElement(Text, null, children);
|
|
94
|
-
}
|
|
95
|
-
return React.createElement(React.Fragment, null, children);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export { Banner as B };
|