@jobber/components 4.85.4-CJS-to-ESM.1 → 4.85.4-CJS-to-ESM.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/AnimatedPresence-20a02aaa.js +104 -0
- package/dist/AnimatedPresence-bbccdaf7.js +98 -0
- package/dist/AnimatedPresence.cjs +12 -0
- package/dist/AnimatedPresence.js +4 -0
- package/dist/AnimatedSwitcher-3aff3d12.js +90 -0
- package/dist/AnimatedSwitcher-3d45ec5d.js +96 -0
- package/dist/AnimatedSwitcher.cjs +13 -0
- package/dist/AnimatedSwitcher.js +5 -0
- package/dist/Autocomplete-b35c7ff5.js +196 -0
- package/dist/Autocomplete-dc7a4b9e.js +188 -0
- package/dist/Autocomplete.cjs +33 -0
- package/dist/Autocomplete.js +25 -0
- package/dist/Avatar-229083ec.js +70 -0
- package/dist/Avatar-cccf72b9.js +78 -0
- package/dist/Avatar.cjs +15 -0
- package/dist/Avatar.js +7 -0
- package/dist/Banner-18d94700.js +105 -0
- package/dist/Banner-5475a9ea.js +98 -0
- package/dist/Banner.cjs +20 -0
- package/dist/Banner.js +12 -0
- package/dist/Body-22878526.js +64 -0
- package/dist/Body-4fbe21ac.js +50 -0
- package/dist/Button-30154871.js +50 -0
- package/dist/Button-ec64869e.js +57 -0
- package/dist/Button.cjs +16 -0
- package/dist/Button.js +8 -0
- package/dist/ButtonDismiss-a11eef74.js +8 -0
- package/dist/ButtonDismiss-d7417429.js +14 -0
- package/dist/ButtonDismiss.cjs +17 -0
- package/dist/ButtonDismiss.js +9 -0
- package/dist/Card-27375ded.js +93 -0
- package/dist/Card-35bd61ce.js +86 -0
- package/dist/Card.cjs +24 -0
- package/dist/Card.js +16 -0
- package/dist/Checkbox-a91b14f7.js +56 -0
- package/dist/Checkbox-b6e46d80.js +63 -0
- package/dist/Checkbox.cjs +18 -0
- package/dist/Checkbox.js +10 -0
- package/dist/Chip-01343f8b.js +81 -0
- package/dist/Chip-24613c57.js +89 -0
- package/dist/Chip.cjs +27 -0
- package/dist/Chip.js +17 -0
- package/dist/ChipDismissible-1f2754bd.js +19 -0
- package/dist/ChipDismissible-a8ecc894.js +26 -0
- package/dist/Chips-7c44a2f9.js +494 -0
- package/dist/Chips-a8f4c9f2.js +505 -0
- package/dist/Chips.cjs +46 -0
- package/dist/Chips.js +37 -0
- package/dist/Combobox-44f0ec2a.js +468 -0
- package/dist/Combobox-d8d28b1e.js +479 -0
- package/dist/Combobox.cjs +40 -0
- package/dist/Combobox.js +31 -0
- package/dist/ConfirmationModal-09ec5d02.js +100 -0
- package/dist/ConfirmationModal-64f82a31.js +94 -0
- package/dist/ConfirmationModal.cjs +31 -0
- package/dist/ConfirmationModal.js +23 -0
- package/dist/Content-60a3452a.js +24 -0
- package/dist/Content-c96e9299.js +18 -0
- package/dist/Content.cjs +12 -0
- package/dist/Content.js +4 -0
- package/dist/Countdown-961d8a6e.js +70 -0
- package/dist/Countdown-ac081ced.js +63 -0
- package/dist/Countdown.cjs +12 -0
- package/dist/Countdown.js +4 -0
- package/dist/DataDump-6fae2727.js +15 -0
- package/dist/DataDump-f427abfe.js +21 -0
- package/dist/DataDump.cjs +27 -0
- package/dist/DataDump.js +19 -0
- package/dist/DataList-18f2d692.js +1310 -0
- package/dist/DataList-4b0f9e5d.js +1320 -0
- package/dist/DataList.cjs +52 -0
- package/dist/DataList.js +44 -0
- package/dist/DataTable-0f6649e0.js +245 -0
- package/dist/DataTable-aab7f6b9.js +252 -0
- package/dist/DataTable.cjs +65 -0
- package/dist/DataTable.js +36 -0
- package/dist/DatePicker-5d0c0353.js +125 -0
- package/dist/DatePicker-c091c0d2.js +134 -0
- package/dist/DatePicker.cjs +20 -0
- package/dist/DatePicker.js +12 -0
- package/dist/DescriptionList-2cb975a9.js +15 -0
- package/dist/DescriptionList-74db99a5.js +21 -0
- package/dist/DescriptionList.cjs +13 -0
- package/dist/DescriptionList.js +5 -0
- package/dist/Disclosure-00a9459b.js +36 -0
- package/dist/Disclosure-56309ff3.js +42 -0
- package/dist/Disclosure.cjs +16 -0
- package/dist/Disclosure.js +8 -0
- package/dist/Divider-1e6ac1ec.js +27 -0
- package/dist/Divider-589745c1.js +20 -0
- package/dist/Divider.cjs +12 -0
- package/dist/Divider.js +4 -0
- package/dist/Drawer.cjs +21 -0
- package/dist/Drawer.js +12 -0
- package/dist/DrawerGrid-0861e529.js +33 -0
- package/dist/DrawerGrid-b233d837.js +41 -0
- package/dist/Emphasis-2a640962.js +13 -0
- package/dist/Emphasis-84de1f3f.js +19 -0
- package/dist/Emphasis.cjs +13 -0
- package/dist/Emphasis.js +5 -0
- package/dist/FeatureSwitch-ddaebf27.js +62 -0
- package/dist/FeatureSwitch-e33e30a9.js +55 -0
- package/dist/FeatureSwitch.cjs +26 -0
- package/dist/FeatureSwitch.js +18 -0
- package/dist/Flex-041db5c8.js +31 -0
- package/dist/Flex-ddf28839.js +38 -0
- package/dist/Flex.cjs +12 -0
- package/dist/Flex.js +4 -0
- package/dist/Form-6a161b07.js +48 -0
- package/dist/Form-927647ef.js +54 -0
- package/dist/Form.cjs +12 -0
- package/dist/Form.js +4 -0
- package/dist/FormField-f1f405d2.js +246 -0
- package/dist/FormField-fc30bb1a.js +253 -0
- package/dist/FormField.cjs +24 -0
- package/dist/FormField.js +16 -0
- package/dist/FormatDate-70ea5b43.js +34 -0
- package/dist/FormatDate-720b39cf.js +27 -0
- package/dist/FormatDate.cjs +11 -0
- package/dist/FormatDate.js +2 -0
- package/dist/FormatEmail-04ee4085.js +14 -0
- package/dist/FormatEmail-298393bb.js +21 -0
- package/dist/FormatEmail.cjs +12 -0
- package/dist/FormatEmail.js +4 -0
- package/dist/FormatFile-648aea3e.js +154 -0
- package/dist/FormatFile-d57b8dfa.js +162 -0
- package/dist/FormatFile.cjs +36 -0
- package/dist/FormatFile.js +28 -0
- package/dist/FormatRelativeDateTime-529dc36b.js +64 -0
- package/dist/FormatRelativeDateTime-6336002d.js +70 -0
- package/dist/FormatRelativeDateTime.cjs +10 -0
- package/dist/FormatRelativeDateTime.js +2 -0
- package/dist/FormatTime-20538519.js +34 -0
- package/dist/FormatTime-764fd3c8.js +28 -0
- package/dist/FormatTime.cjs +10 -0
- package/dist/FormatTime.js +2 -0
- package/dist/Gallery-7760f21f.js +66 -0
- package/dist/Gallery-8d4d79a2.js +73 -0
- package/dist/Gallery.cjs +39 -0
- package/dist/Gallery.js +31 -0
- package/dist/Glimmer-3fcdae65.js +77 -0
- package/dist/Glimmer-6bf75ae0.js +69 -0
- package/dist/Glimmer.cjs +15 -0
- package/dist/Glimmer.js +6 -0
- package/dist/Grid-c28e226d.js +66 -0
- package/dist/Grid-cce44c9d.js +74 -0
- package/dist/Grid.cjs +14 -0
- package/dist/Grid.js +5 -0
- package/dist/Heading-a8a24775.js +55 -0
- package/dist/Heading-dfd4f1cf.js +49 -0
- package/dist/Heading.cjs +14 -0
- package/dist/Heading.js +6 -0
- package/dist/Icon-22723fe6.js +34 -0
- package/dist/Icon-405a216c.js +40 -0
- package/dist/Icon.cjs +11 -0
- package/dist/Icon.js +3 -0
- package/dist/InlineLabel-20f9095e.js +21 -0
- package/dist/InlineLabel-5144fa06.js +28 -0
- package/dist/InlineLabel.cjs +13 -0
- package/dist/InlineLabel.js +5 -0
- package/dist/InputAvatar-3a10bdb1.js +50 -0
- package/dist/InputAvatar-95c98620.js +56 -0
- package/dist/InputAvatar.cjs +28 -0
- package/dist/InputAvatar.js +20 -0
- package/dist/InputDate-c258f5cb.js +32 -0
- package/dist/InputDate-c5f19423.js +39 -0
- package/dist/InputDate.cjs +29 -0
- package/dist/InputDate.js +21 -0
- package/dist/InputEmail-4efba03d.js +27 -0
- package/dist/InputEmail-812bdffe.js +20 -0
- package/dist/InputEmail.cjs +26 -0
- package/dist/InputEmail.js +17 -0
- package/dist/InputFile-921c050e.js +190 -0
- package/dist/InputFile-d089b486.js +181 -0
- package/dist/InputFile.cjs +25 -0
- package/dist/InputFile.js +16 -0
- package/dist/InputGroup-436859cf.js +26 -0
- package/dist/InputGroup-8d4fd4eb.js +33 -0
- package/dist/InputGroup.cjs +12 -0
- package/dist/InputGroup.js +4 -0
- package/dist/InputNumber-4bd38b8e.js +56 -0
- package/dist/InputNumber-df9cb825.js +62 -0
- package/dist/InputNumber.cjs +25 -0
- package/dist/InputNumber.js +17 -0
- package/dist/InputPassword-08d2dfa1.js +25 -0
- package/dist/InputPassword-6b937a91.js +19 -0
- package/dist/InputPassword.cjs +25 -0
- package/dist/InputPassword.js +17 -0
- package/dist/InputPhoneNumber-947bdb49.js +97 -0
- package/dist/InputPhoneNumber-cbb2ca7d.js +103 -0
- package/dist/InputPhoneNumber.cjs +25 -0
- package/dist/InputPhoneNumber.js +17 -0
- package/dist/InputText-125769fd.js +102 -0
- package/dist/InputText-2fd8f942.js +96 -0
- package/dist/InputText.cjs +26 -0
- package/dist/InputText.js +18 -0
- package/dist/InputTime-3c4bdff0.js +194 -0
- package/dist/InputTime-ef8af2d9.js +187 -0
- package/dist/InputTime.cjs +27 -0
- package/dist/InputTime.js +19 -0
- package/dist/InputValidation-4a61254d.js +29 -0
- package/dist/InputValidation-fe42fc3f.js +23 -0
- package/dist/InputValidation.cjs +17 -0
- package/dist/InputValidation.js +9 -0
- package/dist/LightBox-3d6e74ba.js +117 -0
- package/dist/LightBox-8cc72953.js +109 -0
- package/dist/LightBox.cjs +24 -0
- package/dist/LightBox.js +16 -0
- package/dist/Link-b41bc1d3.js +7 -0
- package/dist/Link-fd7301ec.js +13 -0
- package/dist/Link.cjs +10 -0
- package/dist/Link.js +2 -0
- package/dist/List-4fe52f57.js +77 -0
- package/dist/List-821f249d.js +87 -0
- package/dist/List.cjs +25 -0
- package/dist/List.js +16 -0
- package/dist/Markdown-36854bd5.js +62 -0
- package/dist/Markdown-7b84fcdb.js +55 -0
- package/dist/Markdown.cjs +19 -0
- package/dist/Markdown.js +11 -0
- package/dist/Menu-5ce3cf41.js +139 -0
- package/dist/Menu-fb0b2e9b.js +132 -0
- package/dist/Menu.cjs +21 -0
- package/dist/Menu.js +13 -0
- package/dist/Modal-cda55f02.js +71 -0
- package/dist/Modal-eeb52d66.js +63 -0
- package/dist/Modal.cjs +25 -0
- package/dist/Modal.js +17 -0
- package/dist/MultiSelect-0af9c956.js +169 -0
- package/dist/MultiSelect-707000e1.js +176 -0
- package/dist/MultiSelect.cjs +19 -0
- package/dist/MultiSelect.js +11 -0
- package/dist/Option-58d7cab6.js +12 -0
- package/dist/Option-73515eec.js +19 -0
- package/dist/Page-0b334096.js +59 -0
- package/dist/Page-fdb087db.js +66 -0
- package/dist/Page.cjs +30 -0
- package/dist/Page.js +22 -0
- package/dist/Popover-798f548e.js +47 -0
- package/dist/Popover-968c63b2.js +53 -0
- package/dist/Popover.cjs +20 -0
- package/dist/Popover.js +12 -0
- package/dist/ProgressBar-022ef3f6.js +36 -0
- package/dist/ProgressBar-4ee648b7.js +43 -0
- package/dist/ProgressBar.cjs +12 -0
- package/dist/ProgressBar.js +4 -0
- package/dist/RadioGroup-68edd1e3.js +46 -0
- package/dist/RadioGroup-a089f132.js +39 -0
- package/dist/RadioGroup.cjs +15 -0
- package/dist/RadioGroup.js +6 -0
- package/dist/RecurringSelect-2de4014c.js +208 -0
- package/dist/RecurringSelect-e391af31.js +214 -0
- package/dist/RecurringSelect.cjs +38 -0
- package/dist/RecurringSelect.js +22 -0
- package/dist/Select.cjs +26 -0
- package/dist/Select.js +17 -0
- package/dist/Spinner-3480bc34.js +24 -0
- package/dist/Spinner-90081e20.js +17 -0
- package/dist/Spinner.cjs +12 -0
- package/dist/Spinner.js +4 -0
- package/dist/StatusIndicator-0c680acb.js +18 -0
- package/dist/StatusIndicator-d6f9aefa.js +12 -0
- package/dist/StatusIndicator.cjs +11 -0
- package/dist/StatusIndicator.js +3 -0
- package/dist/StatusLabel-5bf96fdb.js +26 -0
- package/dist/StatusLabel-66214fc7.js +19 -0
- package/dist/StatusLabel.cjs +15 -0
- package/dist/StatusLabel.js +7 -0
- package/dist/Switch-6c6c727b.js +56 -0
- package/dist/Switch-87706cde.js +49 -0
- package/dist/Switch.cjs +13 -0
- package/dist/Switch.js +5 -0
- package/dist/Table.cjs +20 -0
- package/dist/Table.js +5 -0
- package/dist/Tabs-109f1f10.js +70 -0
- package/dist/Tabs-d6c8b965.js +78 -0
- package/dist/Tabs.cjs +14 -0
- package/dist/Tabs.js +5 -0
- package/dist/Text-714f7d14.js +31 -0
- package/dist/Text-c92ddeb3.js +25 -0
- package/dist/Text.cjs +13 -0
- package/dist/Text.js +5 -0
- package/dist/Toast.cjs +19 -0
- package/dist/Toast.js +11 -0
- package/dist/Tooltip-2e477150.js +112 -0
- package/dist/Tooltip-a40fffbd.js +104 -0
- package/dist/Tooltip.cjs +16 -0
- package/dist/Tooltip.js +8 -0
- package/dist/Typography-52ed1386.js +55 -0
- package/dist/Typography-fd88fcce.js +62 -0
- package/dist/Typography.cjs +12 -0
- package/dist/Typography.js +4 -0
- package/dist/getAtlantisConfig-0f3e8af2.js +13 -0
- package/dist/getAtlantisConfig-5b50057c.js +11 -0
- package/dist/index.cjs +216 -6713
- package/dist/index.js +112 -0
- package/dist/showToast-63be1cf0.js +106 -0
- package/dist/showToast-ff666be8.js +100 -0
- package/dist/style-inject.es-9d2f5f4e.js +30 -0
- package/dist/style-inject.es-a0e1a0ba.js +28 -0
- package/dist/tslib.es6-754e2961.js +46 -0
- package/dist/tslib.es6-c563c1dd.js +43 -0
- package/package.json +6 -365
- package/AnimatedPresence.d.ts +0 -1
- package/AnimatedPresence.js +0 -17
- package/AnimatedSwitcher.d.ts +0 -1
- package/AnimatedSwitcher.js +0 -17
- package/Autocomplete.d.ts +0 -1
- package/Autocomplete.js +0 -17
- package/Avatar.d.ts +0 -1
- package/Avatar.js +0 -17
- package/Banner.d.ts +0 -1
- package/Banner.js +0 -17
- package/Button.d.ts +0 -1
- package/Button.js +0 -17
- package/ButtonDismiss.d.ts +0 -1
- package/ButtonDismiss.js +0 -17
- package/Card.d.ts +0 -1
- package/Card.js +0 -17
- package/Checkbox.d.ts +0 -1
- package/Checkbox.js +0 -17
- package/Chip.d.ts +0 -1
- package/Chip.js +0 -17
- package/Chips.d.ts +0 -1
- package/Chips.js +0 -17
- package/Combobox.d.ts +0 -1
- package/Combobox.js +0 -17
- package/ConfirmationModal.d.ts +0 -1
- package/ConfirmationModal.js +0 -17
- package/Content.d.ts +0 -1
- package/Content.js +0 -17
- package/Countdown.d.ts +0 -1
- package/Countdown.js +0 -17
- package/DataDump.d.ts +0 -1
- package/DataDump.js +0 -17
- package/DataList.d.ts +0 -1
- package/DataList.js +0 -17
- package/DataTable.d.ts +0 -1
- package/DataTable.js +0 -17
- package/DatePicker.d.ts +0 -1
- package/DatePicker.js +0 -17
- package/DescriptionList.d.ts +0 -1
- package/DescriptionList.js +0 -17
- package/Disclosure.d.ts +0 -1
- package/Disclosure.js +0 -17
- package/Divider.d.ts +0 -1
- package/Divider.js +0 -17
- package/Drawer.d.ts +0 -1
- package/Drawer.js +0 -17
- package/Emphasis.d.ts +0 -1
- package/Emphasis.js +0 -17
- package/FeatureSwitch.d.ts +0 -1
- package/FeatureSwitch.js +0 -17
- package/Flex.d.ts +0 -1
- package/Flex.js +0 -17
- package/Form.d.ts +0 -1
- package/Form.js +0 -17
- package/FormField.d.ts +0 -1
- package/FormField.js +0 -17
- package/FormatDate.d.ts +0 -1
- package/FormatDate.js +0 -17
- package/FormatEmail.d.ts +0 -1
- package/FormatEmail.js +0 -17
- package/FormatFile.d.ts +0 -1
- package/FormatFile.js +0 -17
- package/FormatRelativeDateTime.d.ts +0 -1
- package/FormatRelativeDateTime.js +0 -17
- package/FormatTime.d.ts +0 -1
- package/FormatTime.js +0 -17
- package/Gallery.d.ts +0 -1
- package/Gallery.js +0 -17
- package/Glimmer.d.ts +0 -1
- package/Glimmer.js +0 -17
- package/Grid.d.ts +0 -1
- package/Grid.js +0 -17
- package/Heading.d.ts +0 -1
- package/Heading.js +0 -17
- package/Icon.d.ts +0 -1
- package/Icon.js +0 -17
- package/InlineLabel.d.ts +0 -1
- package/InlineLabel.js +0 -17
- package/InputAvatar.d.ts +0 -1
- package/InputAvatar.js +0 -17
- package/InputDate.d.ts +0 -1
- package/InputDate.js +0 -17
- package/InputEmail.d.ts +0 -1
- package/InputEmail.js +0 -17
- package/InputFile.d.ts +0 -1
- package/InputFile.js +0 -17
- package/InputGroup.d.ts +0 -1
- package/InputGroup.js +0 -17
- package/InputNumber.d.ts +0 -1
- package/InputNumber.js +0 -17
- package/InputPassword.d.ts +0 -1
- package/InputPassword.js +0 -17
- package/InputPhoneNumber.d.ts +0 -1
- package/InputPhoneNumber.js +0 -17
- package/InputText.d.ts +0 -1
- package/InputText.js +0 -17
- package/InputTime.d.ts +0 -1
- package/InputTime.js +0 -17
- package/InputValidation.d.ts +0 -1
- package/InputValidation.js +0 -17
- package/LightBox.d.ts +0 -1
- package/LightBox.js +0 -17
- package/Link.d.ts +0 -1
- package/Link.js +0 -17
- package/List.d.ts +0 -1
- package/List.js +0 -17
- package/Markdown.d.ts +0 -1
- package/Markdown.js +0 -17
- package/Menu.d.ts +0 -1
- package/Menu.js +0 -17
- package/Modal.d.ts +0 -1
- package/Modal.js +0 -17
- package/MultiSelect.d.ts +0 -1
- package/MultiSelect.js +0 -17
- package/Page.d.ts +0 -1
- package/Page.js +0 -17
- package/Popover.d.ts +0 -1
- package/Popover.js +0 -17
- package/ProgressBar.d.ts +0 -1
- package/ProgressBar.js +0 -17
- package/RadioGroup.d.ts +0 -1
- package/RadioGroup.js +0 -17
- package/RecurringSelect.d.ts +0 -1
- package/RecurringSelect.js +0 -17
- package/Select.d.ts +0 -1
- package/Select.js +0 -17
- package/Spinner.d.ts +0 -1
- package/Spinner.js +0 -17
- package/StatusIndicator.d.ts +0 -1
- package/StatusIndicator.js +0 -17
- package/StatusLabel.d.ts +0 -1
- package/StatusLabel.js +0 -17
- package/Switch.d.ts +0 -1
- package/Switch.js +0 -17
- package/Table.d.ts +0 -1
- package/Table.js +0 -17
- package/Tabs.d.ts +0 -1
- package/Tabs.js +0 -17
- package/Text.d.ts +0 -1
- package/Text.js +0 -17
- package/Toast.d.ts +0 -1
- package/Toast.js +0 -17
- package/Tooltip.d.ts +0 -1
- package/Tooltip.js +0 -17
- package/Typography.d.ts +0 -1
- package/Typography.js +0 -17
- package/dist/index.esm.js +0 -6603
- package/rollup.config.js +0 -75
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { usePopper } from 'react-popper';
|
|
3
|
+
import { useRefocusOnActivator } from '@jobber/hooks/useRefocusOnActivator';
|
|
4
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
5
|
+
import { B as ButtonDismiss } from './ButtonDismiss-a11eef74.js';
|
|
6
|
+
|
|
7
|
+
var css_248z = ":root {\n --card--base-padding: var(--space-base);\n --popover--padding: var(--space-base);\n --popover--width: calc(var(--base-unit) * 21.875);\n --dismiss--button-padding: calc(var(--base-unit) / 4);\n}\n\n.oSlK4rLUvzE- {\n display: -ms-flexbox;\n display: flex;\n position: \"relative\";\n padding: var(--space-base);\n padding: var(--popover--padding);\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.XVPpPb-7e30- {\n float: right;\n padding: calc(var(--base-unit) / 4);\n padding: var(--dismiss--button-padding);\n text-align: right;\n}\n\n.TDuYbqXaLW0- {\n z-index: var(--elevation-tooltip);\n width: -webkit-max-content;\n width: max-content;\n max-width: calc(var(--base-unit) * 21.875);\n max-width: var(--popover--width);\n box-shadow: var(--shadow-base);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-base);\n font-size: var(--typography--fontSize-base);\n line-height: normal;\n background: var(--color-surface);\n}\n\n.TDuYbqXaLW0- > * {\n --public-content--padding: var(--card--base-padding);\n}\n\n.LJCpn0zf1e8- {\n visibility: hidden;\n}\n\n.LJCpn0zf1e8-,\n.LJCpn0zf1e8-::before {\n position: absolute;\n width: var(--base-unit);\n height: var(--base-unit);\n background: inherit;\n}\n\n.LJCpn0zf1e8-::before {\n content: \"\";\n visibility: visible;\n border: var(--border-base) solid var(--color-border);\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n -webkit-transform-origin: center;\n transform-origin: center;\n -webkit-clip-path: polygon(-4px -4px, 15.3px 0, 0 15.3px);\n clip-path: polygon(-4px -4px, 15.3px 0, 0 15.3px);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"top\"] > .LJCpn0zf1e8- {\n bottom: -5px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"top\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(-135deg);\n transform: rotate(-135deg);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"bottom\"] > .LJCpn0zf1e8- {\n top: -7px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"left\"] > .LJCpn0zf1e8- {\n right: -5px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"left\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(135deg);\n transform: rotate(135deg);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"right\"] > .LJCpn0zf1e8- {\n left: -7px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"right\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n";
|
|
8
|
+
var classes = {"header":"oSlK4rLUvzE-","dismissButton":"XVPpPb-7e30-","popover":"TDuYbqXaLW0-","arrow":"LJCpn0zf1e8-"};
|
|
9
|
+
styleInject(css_248z);
|
|
10
|
+
|
|
11
|
+
function Popover({ onRequestClose, children, attachTo, open, preferredPlacement = "auto", }) {
|
|
12
|
+
const [popperElement, setPopperElement] = useState();
|
|
13
|
+
const [arrowElement, setArrowElement] = useState();
|
|
14
|
+
const { styles: popperStyles, attributes } = usePopper(attachTo instanceof Element ? attachTo : attachTo.current, popperElement, {
|
|
15
|
+
modifiers: buildModifiers(arrowElement),
|
|
16
|
+
placement: preferredPlacement,
|
|
17
|
+
});
|
|
18
|
+
useRefocusOnActivator(open);
|
|
19
|
+
return (React.createElement(React.Fragment, null, open && (React.createElement("div", Object.assign({ role: "dialog", ref: setPopperElement, style: popperStyles.popper, className: classes.popover }, attributes.popper),
|
|
20
|
+
React.createElement("div", { className: classes.dismissButton },
|
|
21
|
+
React.createElement(ButtonDismiss, { onClick: onRequestClose, ariaLabel: "Close dialog" })),
|
|
22
|
+
children,
|
|
23
|
+
React.createElement("div", { ref: setArrowElement, className: classes.arrow, style: popperStyles.arrow })))));
|
|
24
|
+
}
|
|
25
|
+
function buildModifiers(arrowElement) {
|
|
26
|
+
const modifiers = [
|
|
27
|
+
{
|
|
28
|
+
name: "arrow",
|
|
29
|
+
options: { element: arrowElement, padding: 10 },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "offset",
|
|
33
|
+
options: {
|
|
34
|
+
offset: [0, 10],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "flip",
|
|
39
|
+
options: {
|
|
40
|
+
fallbackPlacements: ["auto"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
return modifiers;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { Popover as P };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactPopper = require('react-popper');
|
|
5
|
+
var useRefocusOnActivator = require('@jobber/hooks/useRefocusOnActivator');
|
|
6
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
7
|
+
var ButtonDismiss = require('./ButtonDismiss-d7417429.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var css_248z = ":root {\n --card--base-padding: var(--space-base);\n --popover--padding: var(--space-base);\n --popover--width: calc(var(--base-unit) * 21.875);\n --dismiss--button-padding: calc(var(--base-unit) / 4);\n}\n\n.oSlK4rLUvzE- {\n display: -ms-flexbox;\n display: flex;\n position: \"relative\";\n padding: var(--space-base);\n padding: var(--popover--padding);\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.XVPpPb-7e30- {\n float: right;\n padding: calc(var(--base-unit) / 4);\n padding: var(--dismiss--button-padding);\n text-align: right;\n}\n\n.TDuYbqXaLW0- {\n z-index: var(--elevation-tooltip);\n width: -webkit-max-content;\n width: max-content;\n max-width: calc(var(--base-unit) * 21.875);\n max-width: var(--popover--width);\n box-shadow: var(--shadow-base);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-base);\n font-size: var(--typography--fontSize-base);\n line-height: normal;\n background: var(--color-surface);\n}\n\n.TDuYbqXaLW0- > * {\n --public-content--padding: var(--card--base-padding);\n}\n\n.LJCpn0zf1e8- {\n visibility: hidden;\n}\n\n.LJCpn0zf1e8-,\n.LJCpn0zf1e8-::before {\n position: absolute;\n width: var(--base-unit);\n height: var(--base-unit);\n background: inherit;\n}\n\n.LJCpn0zf1e8-::before {\n content: \"\";\n visibility: visible;\n border: var(--border-base) solid var(--color-border);\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n -webkit-transform-origin: center;\n transform-origin: center;\n -webkit-clip-path: polygon(-4px -4px, 15.3px 0, 0 15.3px);\n clip-path: polygon(-4px -4px, 15.3px 0, 0 15.3px);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"top\"] > .LJCpn0zf1e8- {\n bottom: -5px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"top\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(-135deg);\n transform: rotate(-135deg);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"bottom\"] > .LJCpn0zf1e8- {\n top: -7px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"left\"] > .LJCpn0zf1e8- {\n right: -5px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"left\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(135deg);\n transform: rotate(135deg);\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"right\"] > .LJCpn0zf1e8- {\n left: -7px;\n}\n\n.TDuYbqXaLW0-[data-popper-placement^=\"right\"] > .LJCpn0zf1e8-::before {\n -webkit-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n";
|
|
14
|
+
var classes = {"header":"oSlK4rLUvzE-","dismissButton":"XVPpPb-7e30-","popover":"TDuYbqXaLW0-","arrow":"LJCpn0zf1e8-"};
|
|
15
|
+
styleInject_es.styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
function Popover({ onRequestClose, children, attachTo, open, preferredPlacement = "auto", }) {
|
|
18
|
+
const [popperElement, setPopperElement] = React.useState();
|
|
19
|
+
const [arrowElement, setArrowElement] = React.useState();
|
|
20
|
+
const { styles: popperStyles, attributes } = reactPopper.usePopper(attachTo instanceof Element ? attachTo : attachTo.current, popperElement, {
|
|
21
|
+
modifiers: buildModifiers(arrowElement),
|
|
22
|
+
placement: preferredPlacement,
|
|
23
|
+
});
|
|
24
|
+
useRefocusOnActivator.useRefocusOnActivator(open);
|
|
25
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, open && (React__default["default"].createElement("div", Object.assign({ role: "dialog", ref: setPopperElement, style: popperStyles.popper, className: classes.popover }, attributes.popper),
|
|
26
|
+
React__default["default"].createElement("div", { className: classes.dismissButton },
|
|
27
|
+
React__default["default"].createElement(ButtonDismiss.ButtonDismiss, { onClick: onRequestClose, ariaLabel: "Close dialog" })),
|
|
28
|
+
children,
|
|
29
|
+
React__default["default"].createElement("div", { ref: setArrowElement, className: classes.arrow, style: popperStyles.arrow })))));
|
|
30
|
+
}
|
|
31
|
+
function buildModifiers(arrowElement) {
|
|
32
|
+
const modifiers = [
|
|
33
|
+
{
|
|
34
|
+
name: "arrow",
|
|
35
|
+
options: { element: arrowElement, padding: 10 },
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: "offset",
|
|
39
|
+
options: {
|
|
40
|
+
offset: [0, 10],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "flip",
|
|
45
|
+
options: {
|
|
46
|
+
fallbackPlacements: ["auto"],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
return modifiers;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
exports.Popover = Popover;
|
package/dist/Popover.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Popover = require('./Popover-968c63b2.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('react-popper');
|
|
8
|
+
require('@jobber/hooks/useRefocusOnActivator');
|
|
9
|
+
require('./style-inject.es-9d2f5f4e.js');
|
|
10
|
+
require('./ButtonDismiss-d7417429.js');
|
|
11
|
+
require('./Button-ec64869e.js');
|
|
12
|
+
require('classnames');
|
|
13
|
+
require('react-router-dom');
|
|
14
|
+
require('./Icon-405a216c.js');
|
|
15
|
+
require('@jobber/design');
|
|
16
|
+
require('./Typography-fd88fcce.js');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.Popover = Popover.Popover;
|
package/dist/Popover.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { P as Popover } from './Popover-798f548e.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'react-popper';
|
|
4
|
+
import '@jobber/hooks/useRefocusOnActivator';
|
|
5
|
+
import './style-inject.es-a0e1a0ba.js';
|
|
6
|
+
import './ButtonDismiss-a11eef74.js';
|
|
7
|
+
import './Button-30154871.js';
|
|
8
|
+
import 'classnames';
|
|
9
|
+
import 'react-router-dom';
|
|
10
|
+
import './Icon-22723fe6.js';
|
|
11
|
+
import '@jobber/design';
|
|
12
|
+
import './Typography-52ed1386.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
4
|
+
|
|
5
|
+
var css_248z$1 = ":root {\n --progress-bar--height: var(--space-base);\n}\n\nprogress.S1cioqW7loo-[value] {\n width: 100%;\n height: var(--space-base);\n height: var(--progress-bar--height);\n border: none;\n vertical-align: baseline;\n -webkit-appearance: none;\n appearance: none;\n}\n\nprogress.S1cioqW7loo-[value],\nprogress.S1cioqW7loo-[value]::-webkit-progress-bar {\n box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.05);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n}\n\nprogress.S1cioqW7loo-[value]::-webkit-progress-bar {\n background-color: var(--color-surface--background);\n}\n\nprogress.S1cioqW7loo-[value]::-webkit-progress-value {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n -webkit-transition: all var(--timing-slow) ease-out;\n transition: all var(--timing-slow) ease-out;\n}\n\nprogress.S1cioqW7loo-[value]::-moz-progress-bar {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n -moz-transition: all var(--timing-slow) ease-out;\n transition: all var(--timing-slow) ease-out;\n}\n\nprogress.nv5fejwjHzo-[value]::-webkit-progress-value {\n -webkit-transition: all var(--timing-quick) ease-out;\n transition: all var(--timing-quick) ease-out;\n}\n\n.dyBDsjWCui4- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n width: 100%;\n gap: var(--space-small);\n}\n";
|
|
6
|
+
var styles = {"ProgressBar":"S1cioqW7loo-","SteppedProgressBar":"nv5fejwjHzo-","wrapper":"dyBDsjWCui4-"};
|
|
7
|
+
styleInject(css_248z$1);
|
|
8
|
+
|
|
9
|
+
var css_248z = ".CzIxUWYkrdo- {\n --progress-bar--height: var(--space-smaller);\n}\n\n.JNSDqHqKVlE- {\n --progress-bar--height: var(--space-small);\n}\n\n.nzFMJ2k4zJ0- {\n --progress-bar--height: var(--space-base);\n}\n";
|
|
10
|
+
var sizes = {"smaller":"CzIxUWYkrdo-","small":"JNSDqHqKVlE-","base":"nzFMJ2k4zJ0-"};
|
|
11
|
+
styleInject(css_248z);
|
|
12
|
+
|
|
13
|
+
function ProgressBarStepped({ currentStep, totalSteps, percentage, size = "base", }) {
|
|
14
|
+
const steppedProgressBarClassName = classnames(styles.ProgressBar, styles.SteppedProgressBar, sizes[size]);
|
|
15
|
+
const ariaLabel = `progress, ${currentStep} out of ${totalSteps}`;
|
|
16
|
+
return (React.createElement("div", { role: "progressbar", className: styles.wrapper, "aria-valuenow": percentage, "aria-valuetext": ariaLabel }, Array.from({ length: totalSteps }).map((_, index) => {
|
|
17
|
+
const step = index + 1;
|
|
18
|
+
const value = step <= currentStep ? 100 : 0;
|
|
19
|
+
return (React.createElement("progress", { key: step, className: steppedProgressBarClassName, value: value, "data-testid": "progress-step" },
|
|
20
|
+
value,
|
|
21
|
+
"%"));
|
|
22
|
+
})));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function ProgressBar({ currentStep, totalSteps, size = "base", variation = "progress", }) {
|
|
26
|
+
const percentage = (currentStep / totalSteps) * 100;
|
|
27
|
+
const progressBarClassName = classnames(styles.ProgressBar, sizes[size]);
|
|
28
|
+
if (variation === "stepped") {
|
|
29
|
+
return (React.createElement(ProgressBarStepped, { currentStep: currentStep, totalSteps: totalSteps, percentage: percentage, size: size }));
|
|
30
|
+
}
|
|
31
|
+
return (React.createElement("progress", { className: progressBarClassName, max: totalSteps, value: currentStep },
|
|
32
|
+
percentage,
|
|
33
|
+
"%"));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { ProgressBar as P };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
11
|
+
|
|
12
|
+
var css_248z$1 = ":root {\n --progress-bar--height: var(--space-base);\n}\n\nprogress.S1cioqW7loo-[value] {\n width: 100%;\n height: var(--space-base);\n height: var(--progress-bar--height);\n border: none;\n vertical-align: baseline;\n -webkit-appearance: none;\n appearance: none;\n}\n\nprogress.S1cioqW7loo-[value],\nprogress.S1cioqW7loo-[value]::-webkit-progress-bar {\n box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.05);\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n}\n\nprogress.S1cioqW7loo-[value]::-webkit-progress-bar {\n background-color: var(--color-surface--background);\n}\n\nprogress.S1cioqW7loo-[value]::-webkit-progress-value {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n -webkit-transition: all var(--timing-slow) ease-out;\n transition: all var(--timing-slow) ease-out;\n}\n\nprogress.S1cioqW7loo-[value]::-moz-progress-bar {\n border-radius: calc(var(--space-base) / 2);\n border-radius: calc(var(--progress-bar--height) / 2);\n background-color: var(--color-interactive);\n -moz-transition: all var(--timing-slow) ease-out;\n transition: all var(--timing-slow) ease-out;\n}\n\nprogress.nv5fejwjHzo-[value]::-webkit-progress-value {\n -webkit-transition: all var(--timing-quick) ease-out;\n transition: all var(--timing-quick) ease-out;\n}\n\n.dyBDsjWCui4- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n width: 100%;\n gap: var(--space-small);\n}\n";
|
|
13
|
+
var styles = {"ProgressBar":"S1cioqW7loo-","SteppedProgressBar":"nv5fejwjHzo-","wrapper":"dyBDsjWCui4-"};
|
|
14
|
+
styleInject_es.styleInject(css_248z$1);
|
|
15
|
+
|
|
16
|
+
var css_248z = ".CzIxUWYkrdo- {\n --progress-bar--height: var(--space-smaller);\n}\n\n.JNSDqHqKVlE- {\n --progress-bar--height: var(--space-small);\n}\n\n.nzFMJ2k4zJ0- {\n --progress-bar--height: var(--space-base);\n}\n";
|
|
17
|
+
var sizes = {"smaller":"CzIxUWYkrdo-","small":"JNSDqHqKVlE-","base":"nzFMJ2k4zJ0-"};
|
|
18
|
+
styleInject_es.styleInject(css_248z);
|
|
19
|
+
|
|
20
|
+
function ProgressBarStepped({ currentStep, totalSteps, percentage, size = "base", }) {
|
|
21
|
+
const steppedProgressBarClassName = classnames__default["default"](styles.ProgressBar, styles.SteppedProgressBar, sizes[size]);
|
|
22
|
+
const ariaLabel = `progress, ${currentStep} out of ${totalSteps}`;
|
|
23
|
+
return (React__default["default"].createElement("div", { role: "progressbar", className: styles.wrapper, "aria-valuenow": percentage, "aria-valuetext": ariaLabel }, Array.from({ length: totalSteps }).map((_, index) => {
|
|
24
|
+
const step = index + 1;
|
|
25
|
+
const value = step <= currentStep ? 100 : 0;
|
|
26
|
+
return (React__default["default"].createElement("progress", { key: step, className: steppedProgressBarClassName, value: value, "data-testid": "progress-step" },
|
|
27
|
+
value,
|
|
28
|
+
"%"));
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function ProgressBar({ currentStep, totalSteps, size = "base", variation = "progress", }) {
|
|
33
|
+
const percentage = (currentStep / totalSteps) * 100;
|
|
34
|
+
const progressBarClassName = classnames__default["default"](styles.ProgressBar, sizes[size]);
|
|
35
|
+
if (variation === "stepped") {
|
|
36
|
+
return (React__default["default"].createElement(ProgressBarStepped, { currentStep: currentStep, totalSteps: totalSteps, percentage: percentage, size: size }));
|
|
37
|
+
}
|
|
38
|
+
return (React__default["default"].createElement("progress", { className: progressBarClassName, max: totalSteps, value: currentStep },
|
|
39
|
+
percentage,
|
|
40
|
+
"%"));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.ProgressBar = ProgressBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ProgressBar = require('./ProgressBar-4ee648b7.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('./style-inject.es-9d2f5f4e.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.ProgressBar = ProgressBar.ProgressBar;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
5
|
+
var Text = require('./Text-714f7d14.js');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
11
|
+
var css_248z = "._5P8wEHDUdKY- {\n --radio--checked-thickness: var(--border-thicker);\n --radio-diameter: var(--space-base);\n --radio--checked-shadow: 0px 0px 0px var(--space-minuscule)\n var(--color-interactive--hover);\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n\n.jobber-retheme ._5P8wEHDUdKY- {\n --radio--checked-thickness: calc(\n var(--border-thicker) + var(--space-smallest)\n );\n --radio-diameter: calc(var(--space-base) + var(--space-smaller));\n --radio--checked-shadow: 0px 0px 0px var(--space-minuscule) transparent;\n}\n\n._08ZPdlE98Ko- {\n /* Hide checkbox on UI but not screen readers and still allow focus state */\n position: absolute;\n left: -999vw;\n}\n\n.-PUoLXltVlQ- {\n display: -ms-inline-flexbox;\n display: inline-flex;\n font-size: var(--typography--fontSize-base);\n cursor: pointer;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n._08ZPdlE98Ko- + .-PUoLXltVlQ-::before {\n content: \"\";\n display: block;\n width: var(--radio-diameter);\n height: var(--radio-diameter);\n box-sizing: border-box;\n margin: var(--space-smallest) var(--space-small) 0 0;\n border: var(--border-thick) solid var(--color-interactive);\n border-radius: 100%;\n background-color: var(--color-surface);\n transition: all var(--timing-quick) ease-out;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n\n.jobber-retheme ._08ZPdlE98Ko- + .-PUoLXltVlQ-::before {\n margin-top: 0;\n border-color: var(--color-border);\n}\n\n._08ZPdlE98Ko-:hover + .-PUoLXltVlQ-::before {\n border-color: var(--color-interactive);\n}\n\n._08ZPdlE98Ko-:checked + .-PUoLXltVlQ-::before {\n box-shadow: var(--radio--checked-shadow);\n border-color: var(--color-interactive--hover);\n border-width: var(--radio--checked-thickness);\n background-color: var(--color-interactive);\n}\n\n._08ZPdlE98Ko-:focus-visible:checked + .-PUoLXltVlQ-:before {\n box-shadow: var(--radio--checked-shadow), var(--shadow-focus);\n}\n\n._08ZPdlE98Ko-[disabled] + .-PUoLXltVlQ- {\n color: var(--color-disabled);\n cursor: not-allowed;\n}\n\n._08ZPdlE98Ko-[disabled] + .-PUoLXltVlQ-::before {\n border-color: var(--color-disabled--secondary);\n}\n\n.jobber-retheme ._08ZPdlE98Ko-:checked + .-PUoLXltVlQ-::before {\n border-color: var(--color-interactive);\n background-color: var(--color-surface);\n}\n\n._08ZPdlE98Ko-[disabled]:checked + .-PUoLXltVlQ-::before {\n --radio--checked-shadow: 0px 0px 0px var(--space-minuscule)\n var(--color-disabled);\n border-color: var(--color-disabled);\n}\n\n._8r6qT-6S9EI-,\n.C5SzbO1epLk- {\n margin-bottom: var(--space-small);\n padding-left: calc(var(--radio-diameter) + var(--space-small));\n}\n\n.jobber-retheme ._8r6qT-6S9EI-,\n.jobber-retheme .C5SzbO1epLk- {\n margin-top: calc(var(--space-smaller) * -1);\n}\n\n._08ZPdlE98Ko-[disabled] + .-PUoLXltVlQ- + ._8r6qT-6S9EI- > p {\n color: var(--color-disabled);\n}\n";
|
|
12
|
+
var styles = {"radioGroup":"_5P8wEHDUdKY-","input":"_08ZPdlE98Ko-","label":"-PUoLXltVlQ-","description":"_8r6qT-6S9EI-","children":"C5SzbO1epLk-"};
|
|
13
|
+
styleInject_es.styleInject(css_248z);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* For rendering props only. To make updates to
|
|
17
|
+
* the real RadioOption, look at InternalRadioOption
|
|
18
|
+
*/
|
|
19
|
+
function RadioOption({ children }) {
|
|
20
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
21
|
+
}
|
|
22
|
+
function InternalRadioOption({ value, name, label, description, disabled, checked, children, onChange, }) {
|
|
23
|
+
const inputId = `${value.toString()}_${React.useId()}`;
|
|
24
|
+
const shouldRenderIndependentChildren = label && children;
|
|
25
|
+
return (React__default["default"].createElement("div", null,
|
|
26
|
+
React__default["default"].createElement("input", { onChange: handleChange, type: "radio", name: name, value: value, disabled: disabled, checked: checked, id: inputId, className: styles.input, "aria-describedby": description ? `${inputId}_description` : undefined }),
|
|
27
|
+
React__default["default"].createElement("label", { className: styles.label, htmlFor: inputId }, label ? label : children),
|
|
28
|
+
description && (React__default["default"].createElement("div", { className: styles.description, id: `${inputId}_description` },
|
|
29
|
+
React__default["default"].createElement(Text.Text, { variation: "subdued", size: "small" }, description))),
|
|
30
|
+
shouldRenderIndependentChildren && (React__default["default"].createElement("div", { className: styles.children, id: `${inputId}_children` }, children))));
|
|
31
|
+
function handleChange() {
|
|
32
|
+
onChange(value);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function RadioGroup({ children, value, ariaLabel, onChange, name = React.useId(), }) {
|
|
37
|
+
return (React__default["default"].createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: styles.radioGroup }, React__default["default"].Children.map(children, option => (React__default["default"].createElement(InternalRadioOption, Object.assign({ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
|
|
38
|
+
function handleChange(newValue) {
|
|
39
|
+
if (newValue !== value) {
|
|
40
|
+
onChange(newValue);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.RadioGroup = RadioGroup;
|
|
46
|
+
exports.RadioOption = RadioOption;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useId } from 'react';
|
|
2
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
3
|
+
import { T as Text } from './Text-c92ddeb3.js';
|
|
4
|
+
|
|
5
|
+
var css_248z = "._5P8wEHDUdKY- {\n --radio--checked-thickness: var(--border-thicker);\n --radio-diameter: var(--space-base);\n --radio--checked-shadow: 0px 0px 0px var(--space-minuscule)\n var(--color-interactive--hover);\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n\n.jobber-retheme ._5P8wEHDUdKY- {\n --radio--checked-thickness: calc(\n var(--border-thicker) + var(--space-smallest)\n );\n --radio-diameter: calc(var(--space-base) + var(--space-smaller));\n --radio--checked-shadow: 0px 0px 0px var(--space-minuscule) transparent;\n}\n\n._08ZPdlE98Ko- {\n /* Hide checkbox on UI but not screen readers and still allow focus state */\n position: absolute;\n left: -999vw;\n}\n\n.-PUoLXltVlQ- {\n display: -ms-inline-flexbox;\n display: inline-flex;\n font-size: var(--typography--fontSize-base);\n cursor: pointer;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n._08ZPdlE98Ko- + .-PUoLXltVlQ-::before {\n content: \"\";\n display: block;\n width: var(--radio-diameter);\n height: var(--radio-diameter);\n box-sizing: border-box;\n margin: var(--space-smallest) var(--space-small) 0 0;\n border: var(--border-thick) solid var(--color-interactive);\n border-radius: 100%;\n background-color: var(--color-surface);\n transition: all var(--timing-quick) ease-out;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n\n.jobber-retheme ._08ZPdlE98Ko- + .-PUoLXltVlQ-::before {\n margin-top: 0;\n border-color: var(--color-border);\n}\n\n._08ZPdlE98Ko-:hover + .-PUoLXltVlQ-::before {\n border-color: var(--color-interactive);\n}\n\n._08ZPdlE98Ko-:checked + .-PUoLXltVlQ-::before {\n box-shadow: var(--radio--checked-shadow);\n border-color: var(--color-interactive--hover);\n border-width: var(--radio--checked-thickness);\n background-color: var(--color-interactive);\n}\n\n._08ZPdlE98Ko-:focus-visible:checked + .-PUoLXltVlQ-:before {\n box-shadow: var(--radio--checked-shadow), var(--shadow-focus);\n}\n\n._08ZPdlE98Ko-[disabled] + .-PUoLXltVlQ- {\n color: var(--color-disabled);\n cursor: not-allowed;\n}\n\n._08ZPdlE98Ko-[disabled] + .-PUoLXltVlQ-::before {\n border-color: var(--color-disabled--secondary);\n}\n\n.jobber-retheme ._08ZPdlE98Ko-:checked + .-PUoLXltVlQ-::before {\n border-color: var(--color-interactive);\n background-color: var(--color-surface);\n}\n\n._08ZPdlE98Ko-[disabled]:checked + .-PUoLXltVlQ-::before {\n --radio--checked-shadow: 0px 0px 0px var(--space-minuscule)\n var(--color-disabled);\n border-color: var(--color-disabled);\n}\n\n._8r6qT-6S9EI-,\n.C5SzbO1epLk- {\n margin-bottom: var(--space-small);\n padding-left: calc(var(--radio-diameter) + var(--space-small));\n}\n\n.jobber-retheme ._8r6qT-6S9EI-,\n.jobber-retheme .C5SzbO1epLk- {\n margin-top: calc(var(--space-smaller) * -1);\n}\n\n._08ZPdlE98Ko-[disabled] + .-PUoLXltVlQ- + ._8r6qT-6S9EI- > p {\n color: var(--color-disabled);\n}\n";
|
|
6
|
+
var styles = {"radioGroup":"_5P8wEHDUdKY-","input":"_08ZPdlE98Ko-","label":"-PUoLXltVlQ-","description":"_8r6qT-6S9EI-","children":"C5SzbO1epLk-"};
|
|
7
|
+
styleInject(css_248z);
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* For rendering props only. To make updates to
|
|
11
|
+
* the real RadioOption, look at InternalRadioOption
|
|
12
|
+
*/
|
|
13
|
+
function RadioOption({ children }) {
|
|
14
|
+
return React.createElement(React.Fragment, null, children);
|
|
15
|
+
}
|
|
16
|
+
function InternalRadioOption({ value, name, label, description, disabled, checked, children, onChange, }) {
|
|
17
|
+
const inputId = `${value.toString()}_${useId()}`;
|
|
18
|
+
const shouldRenderIndependentChildren = label && children;
|
|
19
|
+
return (React.createElement("div", null,
|
|
20
|
+
React.createElement("input", { onChange: handleChange, type: "radio", name: name, value: value, disabled: disabled, checked: checked, id: inputId, className: styles.input, "aria-describedby": description ? `${inputId}_description` : undefined }),
|
|
21
|
+
React.createElement("label", { className: styles.label, htmlFor: inputId }, label ? label : children),
|
|
22
|
+
description && (React.createElement("div", { className: styles.description, id: `${inputId}_description` },
|
|
23
|
+
React.createElement(Text, { variation: "subdued", size: "small" }, description))),
|
|
24
|
+
shouldRenderIndependentChildren && (React.createElement("div", { className: styles.children, id: `${inputId}_children` }, children))));
|
|
25
|
+
function handleChange() {
|
|
26
|
+
onChange(value);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function RadioGroup({ children, value, ariaLabel, onChange, name = useId(), }) {
|
|
31
|
+
return (React.createElement("div", { role: "radiogroup", "aria-label": ariaLabel, className: styles.radioGroup }, React.Children.map(children, option => (React.createElement(InternalRadioOption, Object.assign({ checked: value === option.props.value, name: name, onChange: handleChange }, option.props), option.props.children)))));
|
|
32
|
+
function handleChange(newValue) {
|
|
33
|
+
if (newValue !== value) {
|
|
34
|
+
onChange(newValue);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { RadioGroup as R, RadioOption as a };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var RadioGroup = require('./RadioGroup-68edd1e3.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('./style-inject.es-9d2f5f4e.js');
|
|
8
|
+
require('./Text-714f7d14.js');
|
|
9
|
+
require('./Typography-fd88fcce.js');
|
|
10
|
+
require('classnames');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
15
|
+
exports.RadioOption = RadioGroup.RadioOption;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import React, { useId } from 'react';
|
|
2
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
3
|
+
import { R as RadioGroup, a as RadioOption } from './RadioGroup-a089f132.js';
|
|
4
|
+
import { T as Text } from './Text-c92ddeb3.js';
|
|
5
|
+
import 'classnames';
|
|
6
|
+
import './Typography-52ed1386.js';
|
|
7
|
+
import { S as Select, a as SelectOption } from './Option-58d7cab6.js';
|
|
8
|
+
import { I as InputNumber } from './InputNumber-4bd38b8e.js';
|
|
9
|
+
import { I as InputGroup } from './InputGroup-436859cf.js';
|
|
10
|
+
import { C as Content } from './Content-c96e9299.js';
|
|
11
|
+
|
|
12
|
+
var css_248z$5 = ".NfsRidfuJts- {\n display: grid;\n width: 100%;\n padding: var(--space-smaller);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-large);\n grid-template-columns: repeat(7, 1fr);\n grid-row-gap: var(--space-smaller);\n row-gap: var(--space-smaller);\n -webkit-column-gap: var(--space-smaller);\n -moz-column-gap: var(--space-smaller);\n grid-column-gap: var(--space-smaller);\n column-gap: var(--space-smaller);\n}\n";
|
|
13
|
+
var styles$4 = {"container":"NfsRidfuJts-"};
|
|
14
|
+
styleInject(css_248z$5);
|
|
15
|
+
|
|
16
|
+
var css_248z$4 = ".GXNuQVAsUqs- {\n position: relative;\n}\n\n/* kept present but hidden for accessibility */\n\n.PtlN3SI-Atc- {\n clip: rect(1px, 1px, 1px, 1px);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n}\n\n.VPZ0Os9TY5k- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-pack: center;\n justify-content: center;\n -ms-flex-align: center;\n align-items: center;\n padding: var(--space-smaller);\n border-radius: var(--radius-large);\n text-align: center;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background: var(--color-surface);\n transition: var(--timing-base);\n}\n\n@supports (aspect-ratio: 1/1) {\n .VPZ0Os9TY5k- {\n /*\n * disabling property-no-unknown here as this is a real property\n * that stylelint just doesn't know about. We may be able to remove\n * this when we update our stylelint to not care about IE11.\n */\n /* stylelint-disable-next-line property-no-unknown */\n aspect-ratio: 1/1;\n }\n}\n\n.VPZ0Os9TY5k-:hover {\n background: var(--color-surface--hover);\n}\n\n.PtlN3SI-Atc-:focus + .VPZ0Os9TY5k- {\n box-shadow: var(--shadow-focus);\n background: var(--color-surface--hover);\n}\n\n.PtlN3SI-Atc-:checked + .VPZ0Os9TY5k- {\n color: var(--color-text--reverse);\n background: var(--color-interactive);\n}\n\n.PtlN3SI-Atc-:disabled + .VPZ0Os9TY5k- {\n color: var(--color-disabled);\n background: var(--color-surface--background);\n cursor: default;\n}\n\n.PtlN3SI-Atc-:enabled + .VPZ0Os9TY5k- {\n cursor: pointer;\n}\n\n.PtlN3SI-Atc-:checked:focus + .VPZ0Os9TY5k- {\n background: var(--color-interactive--hover);\n}\n\n.PtlN3SI-Atc-:checked + .VPZ0Os9TY5k-:hover {\n background: var(--color-interactive--hover);\n}\n\n.PtlN3SI-Atc-:disabled:checked + .VPZ0Os9TY5k- {\n color: var(--color-disabled--secondary);\n background: var(--color-disabled);\n}\n";
|
|
17
|
+
var checkboxStyles = {"checkboxWrapper":"GXNuQVAsUqs-","dayCheckboxInput":"PtlN3SI-Atc-","dayCheckbox":"VPZ0Os9TY5k-"};
|
|
18
|
+
styleInject(css_248z$4);
|
|
19
|
+
|
|
20
|
+
var WeekDay;
|
|
21
|
+
(function (WeekDay) {
|
|
22
|
+
WeekDay[WeekDay["Sunday"] = 0] = "Sunday";
|
|
23
|
+
WeekDay[WeekDay["Monday"] = 1] = "Monday";
|
|
24
|
+
WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday";
|
|
25
|
+
WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday";
|
|
26
|
+
WeekDay[WeekDay["Thursday"] = 4] = "Thursday";
|
|
27
|
+
WeekDay[WeekDay["Friday"] = 5] = "Friday";
|
|
28
|
+
WeekDay[WeekDay["Saturday"] = 6] = "Saturday";
|
|
29
|
+
})(WeekDay || (WeekDay = {}));
|
|
30
|
+
var DurationPeriod;
|
|
31
|
+
(function (DurationPeriod) {
|
|
32
|
+
DurationPeriod["Day"] = "Day";
|
|
33
|
+
DurationPeriod["Week"] = "Week";
|
|
34
|
+
DurationPeriod["DayOfMonth"] = "DayOfMonth";
|
|
35
|
+
DurationPeriod["WeekDayOfMonth"] = "WeekDayOfMonth";
|
|
36
|
+
DurationPeriod["Year"] = "Year";
|
|
37
|
+
DurationPeriod["Visit"] = "Visit";
|
|
38
|
+
})(DurationPeriod || (DurationPeriod = {}));
|
|
39
|
+
const typeInitialStateMap = {
|
|
40
|
+
[DurationPeriod.Day]: {
|
|
41
|
+
type: DurationPeriod.Day,
|
|
42
|
+
},
|
|
43
|
+
[DurationPeriod.Week]: {
|
|
44
|
+
type: DurationPeriod.Week,
|
|
45
|
+
weekDays: new Set(),
|
|
46
|
+
},
|
|
47
|
+
[DurationPeriod.DayOfMonth]: {
|
|
48
|
+
type: DurationPeriod.DayOfMonth,
|
|
49
|
+
date: new Set(),
|
|
50
|
+
},
|
|
51
|
+
[DurationPeriod.WeekDayOfMonth]: {
|
|
52
|
+
type: DurationPeriod.WeekDayOfMonth,
|
|
53
|
+
dayOfWeek: [
|
|
54
|
+
new Set(),
|
|
55
|
+
new Set(),
|
|
56
|
+
new Set(),
|
|
57
|
+
new Set(),
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
[DurationPeriod.Year]: {
|
|
61
|
+
type: DurationPeriod.Year,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const isMonthly = (rule) => rule.type === DurationPeriod.WeekDayOfMonth ||
|
|
65
|
+
rule.type === DurationPeriod.DayOfMonth;
|
|
66
|
+
|
|
67
|
+
const weekDays = [0, 1, 2, 3, 4, 5, 6];
|
|
68
|
+
function WeeklySelect({ onChange, selectedDays, disabled, }) {
|
|
69
|
+
const onChangeWeekDays = (event) => {
|
|
70
|
+
const day = Number(event.currentTarget.value);
|
|
71
|
+
const next = new Set(Array.from(selectedDays));
|
|
72
|
+
if (selectedDays.has(day)) {
|
|
73
|
+
next.delete(day);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
next.add(day);
|
|
77
|
+
}
|
|
78
|
+
onChange(next);
|
|
79
|
+
};
|
|
80
|
+
return (React.createElement("div", { className: styles$4.container }, weekDays.map(weekDay => {
|
|
81
|
+
const isSelected = selectedDays.has(weekDay);
|
|
82
|
+
const inputId = useId();
|
|
83
|
+
return (React.createElement("div", { key: `${weekDay}`, className: checkboxStyles.checkboxWrapper },
|
|
84
|
+
React.createElement("input", { className: checkboxStyles.dayCheckboxInput, disabled: disabled, type: "checkbox", onChange: onChangeWeekDays, id: `weekly-select-${weekDay}${inputId}`, "aria-checked": isSelected, checked: isSelected, value: weekDay }),
|
|
85
|
+
React.createElement("label", { className: checkboxStyles.dayCheckbox, htmlFor: `weekly-select-${weekDay}${inputId}` }, `${WeekDay[weekDay].substr(0, 1).toUpperCase()}`)));
|
|
86
|
+
})));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var css_248z$3 = ".PW6L4PJe5TY- div[role=\"radiogroup\"] {\n -ms-flex-direction: row;\n flex-direction: row;\n}\n\n.PW6L4PJe5TY- label {\n margin-right: var(--space-base);\n}\n";
|
|
90
|
+
var styles$3 = {"radioContainer":"PW6L4PJe5TY-"};
|
|
91
|
+
styleInject(css_248z$3);
|
|
92
|
+
|
|
93
|
+
function MonthlySelect({ disabled, onChange, selectedMonthOption, }) {
|
|
94
|
+
return (React.createElement("div", { className: styles$3.radioContainer },
|
|
95
|
+
React.createElement(RadioGroup, { ariaLabel: "Monthly Frequency Selector", onChange: onChange, value: selectedMonthOption },
|
|
96
|
+
React.createElement(RadioOption, { disabled: disabled, value: DurationPeriod.DayOfMonth, label: "Day of month" }),
|
|
97
|
+
React.createElement(RadioOption, { disabled: disabled, value: DurationPeriod.WeekDayOfMonth, label: "Day of week" }))));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var css_248z$2 = ".pqYw6oCVwO8- {\n display: grid;\n grid-template-columns: var(--space-largest) 1fr;\n -ms-flex-align: center;\n align-items: center;\n grid-gap: var(--space-small);\n gap: var(--space-small);\n margin-bottom: calc(-1 * var(--border-base));\n}\n\n.xtCFaHyTmfI- div:nth-of-type(1) :last-child {\n border-top-right-radius: var(--radius-large);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n border-top-left-radius: var(--radius-large);\n}\n\n.xtCFaHyTmfI- div:nth-of-type(2) :last-child {\n border-radius: 0;\n}\n\n.xtCFaHyTmfI- div:nth-of-type(3) :last-child {\n border-radius: 0;\n}\n\n.xtCFaHyTmfI- div:nth-of-type(4) :last-child {\n border-top-right-radius: 0;\n border-bottom-right-radius: var(--radius-large);\n border-bottom-left-radius: var(--radius-large);\n border-top-left-radius: 0;\n}\n";
|
|
101
|
+
var styles$2 = {"container":"pqYw6oCVwO8-","parentContainer":"xtCFaHyTmfI-"};
|
|
102
|
+
styleInject(css_248z$2);
|
|
103
|
+
|
|
104
|
+
function MonthlyDayOfWeekSelect({ disabled, selectedWeeks, onChange, }) {
|
|
105
|
+
const orderString = ["1st", "2nd", "3rd", "4th"];
|
|
106
|
+
return (React.createElement("div", { className: styles$2.parentContainer }, selectedWeeks.map((week, index) => {
|
|
107
|
+
const onChangeWeek = (weekDay) => {
|
|
108
|
+
const next = [...selectedWeeks];
|
|
109
|
+
next.splice(index, 1, weekDay);
|
|
110
|
+
onChange(next);
|
|
111
|
+
};
|
|
112
|
+
return (React.createElement("div", { className: styles$2.container, key: `${index}${week}` },
|
|
113
|
+
React.createElement(Text, null, `${orderString[index]}`),
|
|
114
|
+
React.createElement("div", null,
|
|
115
|
+
React.createElement(WeeklySelect, { disabled: disabled, selectedDays: week, onChange: onChangeWeek }))));
|
|
116
|
+
})));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var css_248z$1 = ".dBbFx0Vu16U- {\n display: grid;\n width: 100%;\n padding: var(--space-smaller);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-large);\n grid-template-areas:\n \". . . . . . .\"\n \". . . . . . .\"\n \". . . . . . .\"\n \". . . . . . .\"\n \". . . lastday lastday lastday lastday\";\n grid-row-gap: var(--space-smaller);\n row-gap: var(--space-smaller);\n -webkit-column-gap: var(--space-smaller);\n -moz-column-gap: var(--space-smaller);\n grid-column-gap: var(--space-smaller);\n column-gap: var(--space-smaller);\n}\n\n.dBbFx0Vu16U- :last-child {\n grid-area: lastday;\n}\n\n.dBbFx0Vu16U- div:nth-child(n + 1):nth-last-child(-n + 1) label {\n height: 100%;\n}\n\n@supports (aspect-ratio: unset) {\n .dBbFx0Vu16U- div:nth-child(n + 1):nth-last-child(-n + 1) label {\n /*\n * disabling property-no-unknown here as this is a real property\n * that stylelint just doesn't know about. We may be able to remove\n * this when we update our stylelint to not care about IE11.\n */\n /* stylelint-disable-next-line property-no-unknown */\n aspect-ratio: unset;\n }\n}\n";
|
|
120
|
+
var styles$1 = {"container":"dBbFx0Vu16U-"};
|
|
121
|
+
styleInject(css_248z$1);
|
|
122
|
+
|
|
123
|
+
const daysInMonth = [...Array.from({ length: 31 }, (_, i) => i + 1), "LAST"];
|
|
124
|
+
function DayOfMonthSelect({ selectedDays, disabled, onChange, }) {
|
|
125
|
+
return (React.createElement("div", { className: styles$1.container }, daysInMonth.map(day => {
|
|
126
|
+
const isSelected = selectedDays.has(day);
|
|
127
|
+
const inputId = useId();
|
|
128
|
+
return (React.createElement("div", { key: `${day}`, className: checkboxStyles.checkboxWrapper },
|
|
129
|
+
React.createElement("input", { className: checkboxStyles.dayCheckboxInput, disabled: disabled, type: "checkbox", id: `${day}-${inputId}`, onChange: handleChangeDayOfMonth, "aria-checked": isSelected, checked: isSelected, value: day }),
|
|
130
|
+
React.createElement("label", { className: checkboxStyles.dayCheckbox, htmlFor: `${day}-${inputId}` }, `${day === "LAST" ? "Last day" : day}`)));
|
|
131
|
+
})));
|
|
132
|
+
function handleChangeDayOfMonth(event) {
|
|
133
|
+
const day = event.currentTarget.value === "LAST"
|
|
134
|
+
? event.currentTarget.value
|
|
135
|
+
: +event.currentTarget.value;
|
|
136
|
+
const next = new Set(selectedDays);
|
|
137
|
+
if (selectedDays.has(day)) {
|
|
138
|
+
next.delete(day);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
next.add(day);
|
|
142
|
+
}
|
|
143
|
+
onChange(next);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function CurrentRecurrenceComponent({ recurrenceRule, disabled = false, onChange, }) {
|
|
148
|
+
switch (recurrenceRule.type) {
|
|
149
|
+
case DurationPeriod.Week: {
|
|
150
|
+
const onChangeWeekDays = (next) => {
|
|
151
|
+
onChange(Object.assign(Object.assign({}, recurrenceRule), { weekDays: next }));
|
|
152
|
+
};
|
|
153
|
+
return (React.createElement(WeeklySelect, { disabled: disabled, selectedDays: recurrenceRule.weekDays, onChange: onChangeWeekDays }));
|
|
154
|
+
}
|
|
155
|
+
case DurationPeriod.WeekDayOfMonth: {
|
|
156
|
+
const onChangeWeekDayOfMonth = (next) => {
|
|
157
|
+
onChange(Object.assign(Object.assign({}, recurrenceRule), { dayOfWeek: next }));
|
|
158
|
+
};
|
|
159
|
+
return (React.createElement(MonthlyDayOfWeekSelect, { disabled: disabled, onChange: onChangeWeekDayOfMonth, selectedWeeks: recurrenceRule.dayOfWeek }));
|
|
160
|
+
}
|
|
161
|
+
case DurationPeriod.DayOfMonth: {
|
|
162
|
+
const onChangeDayOfMonth = (next) => {
|
|
163
|
+
onChange(Object.assign(Object.assign({}, recurrenceRule), { date: next }));
|
|
164
|
+
};
|
|
165
|
+
return (React.createElement(DayOfMonthSelect, { disabled: disabled, selectedDays: recurrenceRule.date, onChange: onChangeDayOfMonth }));
|
|
166
|
+
}
|
|
167
|
+
default:
|
|
168
|
+
return React.createElement(React.Fragment, null);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
var css_248z = ".ANBCH37jH0k- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-align: center;\n align-items: center;\n gap: var(--space-base);\n}\n\n.ZV0GgII8eWQ- {\n width: 100%;\n}\n";
|
|
173
|
+
var styles = {"container":"ANBCH37jH0k-","fullWidthWrapper":"ZV0GgII8eWQ-"};
|
|
174
|
+
styleInject(css_248z);
|
|
175
|
+
|
|
176
|
+
function RecurringSelect({ value, disabled = false, onChange, }) {
|
|
177
|
+
const disabledTextVariation = disabled ? "disabled" : undefined;
|
|
178
|
+
// we must dynamically populate the select option based on which is selected
|
|
179
|
+
// because there is no single "month" option, it must always be one of these two
|
|
180
|
+
const monthlySelectOptionValue = value.type === DurationPeriod.WeekDayOfMonth
|
|
181
|
+
? DurationPeriod.WeekDayOfMonth
|
|
182
|
+
: DurationPeriod.DayOfMonth;
|
|
183
|
+
const hasExtraFrequencyDescriptor = value.type === DurationPeriod.WeekDayOfMonth ||
|
|
184
|
+
value.type === DurationPeriod.DayOfMonth ||
|
|
185
|
+
value.type === DurationPeriod.Week;
|
|
186
|
+
return (React.createElement(Content, null,
|
|
187
|
+
React.createElement("div", { className: styles.container },
|
|
188
|
+
React.createElement(Text, { variation: disabledTextVariation }, "Every"),
|
|
189
|
+
React.createElement("div", { className: styles.fullWidthWrapper },
|
|
190
|
+
React.createElement(InputGroup, { flowDirection: "horizontal" },
|
|
191
|
+
React.createElement(InputNumber, { disabled: disabled, name: "schedule-recurrence-interval", value: value.interval, min: 1, maxLength: 3, onChange: onChangeInterval }),
|
|
192
|
+
React.createElement(Select, { disabled: disabled, value: value.type, onChange: onChangeType, name: "schedule-recurrence-type" },
|
|
193
|
+
React.createElement(SelectOption, { value: DurationPeriod.Day }, "Day(s)"),
|
|
194
|
+
React.createElement(SelectOption, { value: DurationPeriod.Week }, "Week(s)"),
|
|
195
|
+
React.createElement(SelectOption, { value: monthlySelectOptionValue }, "Month(s)"),
|
|
196
|
+
React.createElement(SelectOption, { value: DurationPeriod.Year }, "Year(s)")))),
|
|
197
|
+
hasExtraFrequencyDescriptor && (React.createElement(Text, { variation: disabledTextVariation }, "on"))),
|
|
198
|
+
isMonthly(value) && (React.createElement(MonthlySelect, { disabled: disabled, onChange: onChangeType, selectedMonthOption: value.type })),
|
|
199
|
+
React.createElement(CurrentRecurrenceComponent, { disabled: disabled, recurrenceRule: value, onChange: onChange })));
|
|
200
|
+
function onChangeInterval(interval) {
|
|
201
|
+
onChange(Object.assign(Object.assign({}, value), { interval }));
|
|
202
|
+
}
|
|
203
|
+
function onChangeType(type) {
|
|
204
|
+
onChange(Object.assign({ interval: value.interval }, typeInitialStateMap[type]));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export { DurationPeriod as D, RecurringSelect as R, WeekDay as W };
|