@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,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
|
+
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
|
+
|
|
9
|
+
function FormatRelativeDateTime({ date: inputDate, }) {
|
|
10
|
+
let dateObject;
|
|
11
|
+
if (inputDate instanceof Date) {
|
|
12
|
+
dateObject = inputDate;
|
|
13
|
+
}
|
|
14
|
+
else if (typeof inputDate === "string") {
|
|
15
|
+
dateObject = new Date(inputDate);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
dateObject = new Date(inputDate.toJSON());
|
|
19
|
+
}
|
|
20
|
+
const now = Date.now() / 1000; //seconds
|
|
21
|
+
const date = dateObject;
|
|
22
|
+
const delta = now - date.getTime() / 1000; //seconds;
|
|
23
|
+
switch (relativeTimeRange(delta)) {
|
|
24
|
+
case "less than an hour":
|
|
25
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, showMinutes(Math.round(delta / 60)));
|
|
26
|
+
case "less then a day":
|
|
27
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, date.toLocaleTimeString(undefined, {
|
|
28
|
+
hour: "numeric",
|
|
29
|
+
minute: "numeric",
|
|
30
|
+
})));
|
|
31
|
+
case "less than a week":
|
|
32
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, strFormatDate(date, { weekday: "short" }));
|
|
33
|
+
case "less than a year":
|
|
34
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, strFormatDate(date, { month: "short", day: "numeric" }));
|
|
35
|
+
default:
|
|
36
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, strFormatDate(date, {
|
|
37
|
+
month: "short",
|
|
38
|
+
day: "numeric",
|
|
39
|
+
year: "numeric",
|
|
40
|
+
})));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function relativeTimeRange(delta) {
|
|
44
|
+
delta = delta / 60;
|
|
45
|
+
if (delta < 60)
|
|
46
|
+
return "less than an hour";
|
|
47
|
+
delta = delta / 60;
|
|
48
|
+
if (delta < 24)
|
|
49
|
+
return "less then a day";
|
|
50
|
+
delta = delta / 24;
|
|
51
|
+
if (delta < 7)
|
|
52
|
+
return "less than a week";
|
|
53
|
+
delta = delta / 365;
|
|
54
|
+
if (delta < 1)
|
|
55
|
+
return "less than a year";
|
|
56
|
+
return "a year or more";
|
|
57
|
+
}
|
|
58
|
+
function strFormatDate(date, options) {
|
|
59
|
+
return date.toLocaleDateString(undefined, options);
|
|
60
|
+
}
|
|
61
|
+
function showMinutes(minutes) {
|
|
62
|
+
if (minutes <= 1) {
|
|
63
|
+
return "1 minute ago";
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return minutes + " minutes ago";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
exports.FormatRelativeDateTime = FormatRelativeDateTime;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var FormatRelativeDateTime = require('./FormatRelativeDateTime-6336002d.js');
|
|
6
|
+
require('react');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.FormatRelativeDateTime = FormatRelativeDateTime.FormatRelativeDateTime;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
|
+
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
|
+
|
|
9
|
+
function FormatTime({ time: inputTime, use24HourClock, }) {
|
|
10
|
+
let dateObject;
|
|
11
|
+
if (inputTime instanceof Date) {
|
|
12
|
+
dateObject = inputTime;
|
|
13
|
+
}
|
|
14
|
+
else if (typeof inputTime === "string") {
|
|
15
|
+
dateObject = new Date(inputTime);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const currentDate = new Date();
|
|
19
|
+
const currentYear = currentDate.getFullYear();
|
|
20
|
+
const currentMonth = currentDate.getMonth();
|
|
21
|
+
const currentDay = currentDate.getDay();
|
|
22
|
+
dateObject = new Date(currentYear, currentMonth, currentDay, inputTime.hour, inputTime.minute, inputTime.second, inputTime.millisecond);
|
|
23
|
+
}
|
|
24
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, formatCivilTime(dateObject, use24HourClock));
|
|
25
|
+
}
|
|
26
|
+
function formatCivilTime(date, use24HourClock) {
|
|
27
|
+
return date.toLocaleTimeString(navigator.language, {
|
|
28
|
+
hourCycle: use24HourClock ? "h23" : "h12",
|
|
29
|
+
minute: "2-digit",
|
|
30
|
+
hour: "numeric",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.FormatTime = FormatTime;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
function FormatTime({ time: inputTime, use24HourClock, }) {
|
|
4
|
+
let dateObject;
|
|
5
|
+
if (inputTime instanceof Date) {
|
|
6
|
+
dateObject = inputTime;
|
|
7
|
+
}
|
|
8
|
+
else if (typeof inputTime === "string") {
|
|
9
|
+
dateObject = new Date(inputTime);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
const currentDate = new Date();
|
|
13
|
+
const currentYear = currentDate.getFullYear();
|
|
14
|
+
const currentMonth = currentDate.getMonth();
|
|
15
|
+
const currentDay = currentDate.getDay();
|
|
16
|
+
dateObject = new Date(currentYear, currentMonth, currentDay, inputTime.hour, inputTime.minute, inputTime.second, inputTime.millisecond);
|
|
17
|
+
}
|
|
18
|
+
return React.createElement(React.Fragment, null, formatCivilTime(dateObject, use24HourClock));
|
|
19
|
+
}
|
|
20
|
+
function formatCivilTime(date, use24HourClock) {
|
|
21
|
+
return date.toLocaleTimeString(navigator.language, {
|
|
22
|
+
hourCycle: use24HourClock ? "h23" : "h12",
|
|
23
|
+
minute: "2-digit",
|
|
24
|
+
hour: "numeric",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { FormatTime as F };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
4
|
+
import { L as LightBox } from './LightBox-8cc72953.js';
|
|
5
|
+
import { F as FormatFile } from './FormatFile-648aea3e.js';
|
|
6
|
+
import { B as Button } from './Button-30154871.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = ".G3D4T8IYmwA-,\n._6sZaxiji5rQ- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n gap: var(--space-small);\n}\n\n._6sZaxiji5rQ- {\n gap: var(--space-base);\n}\n\n.wh-FkS64oJ0- {\n display: -ms-flexbox;\n display: flex;\n}\n\n.Idp-BJIbUUs- {\n width: 56px;\n height: 56px;\n}\n\n.kOG-STgt5Hs- {\n width: 168px;\n height: 168px;\n box-shadow: var(--shadow-base);\n}\n";
|
|
9
|
+
var styles = {"gallery":"G3D4T8IYmwA-","galleryLarge":"_6sZaxiji5rQ-","showMoreButton":"wh-FkS64oJ0-","baseShowMoreButton":"Idp-BJIbUUs-","largeShowMoreButton":"kOG-STgt5Hs-"};
|
|
10
|
+
styleInject(css_248z);
|
|
11
|
+
|
|
12
|
+
function Gallery({ files, size = "base", max, onDelete }) {
|
|
13
|
+
const { images, filesToImageIndex } = generateImagesArray(files);
|
|
14
|
+
const [lightboxOpen, setLightboxOpen] = useState(false);
|
|
15
|
+
const [lightboxIndex, setLightboxIndex] = useState(0);
|
|
16
|
+
const [displayPastMax, setDisplayPastMax] = useState(max ? false : true);
|
|
17
|
+
const visibleFiles = displayPastMax ? files : files.slice(0, max);
|
|
18
|
+
return (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement("div", { className: size === "large" ? styles.galleryLarge : styles.gallery },
|
|
20
|
+
visibleFiles.map((file, index) => {
|
|
21
|
+
return (React.createElement(FormatFile, { key: file.key, file: Object.assign(Object.assign({}, file), { src: () => Promise.resolve(file.src) }), display: "compact", displaySize: size, onClick: () => {
|
|
22
|
+
handleThumbnailClicked(index);
|
|
23
|
+
}, onDelete: onDelete ? () => onDelete === null || onDelete === void 0 ? void 0 : onDelete(file) : undefined }));
|
|
24
|
+
}),
|
|
25
|
+
max && files.length > max && !displayPastMax && (React.createElement("div", { className: classnames(styles.showMoreButton, styles[`${size}ShowMoreButton`]) },
|
|
26
|
+
React.createElement(Button, { type: "tertiary", size: size, label: `+ ${files.length - max}`, fullWidth: true, onClick: () => {
|
|
27
|
+
setDisplayPastMax(true);
|
|
28
|
+
} })))),
|
|
29
|
+
React.createElement(LightBox, { open: lightboxOpen, images: images, imageIndex: lightboxIndex, onRequestClose: handleLightboxClose })));
|
|
30
|
+
function handleThumbnailClicked(index) {
|
|
31
|
+
if (files[index].type.startsWith("image/")) {
|
|
32
|
+
handleLightboxOpen(index);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
window.open(files[index].src, "_blank");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function handleLightboxOpen(index) {
|
|
39
|
+
const fileToImageIndex = filesToImageIndex[index];
|
|
40
|
+
if (fileToImageIndex !== undefined) {
|
|
41
|
+
setLightboxIndex(fileToImageIndex);
|
|
42
|
+
setLightboxOpen(true);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function handleLightboxClose() {
|
|
46
|
+
setLightboxOpen(false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function generateImagesArray(files) {
|
|
50
|
+
const images = [];
|
|
51
|
+
const filesToImageIndex = [];
|
|
52
|
+
let imageIndex = 0;
|
|
53
|
+
for (let i = 0; i < files.length; i++) {
|
|
54
|
+
if (files[i].type.startsWith("image/")) {
|
|
55
|
+
images.push({ title: files[i].name, url: files[i].src });
|
|
56
|
+
filesToImageIndex.push(imageIndex);
|
|
57
|
+
imageIndex++;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
filesToImageIndex.push(undefined);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { images, filesToImageIndex };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { Gallery as G };
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
var LightBox = require('./LightBox-3d6e74ba.js');
|
|
7
|
+
var FormatFile = require('./FormatFile-d57b8dfa.js');
|
|
8
|
+
var Button = require('./Button-ec64869e.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
14
|
+
|
|
15
|
+
var css_248z = ".G3D4T8IYmwA-,\n._6sZaxiji5rQ- {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n gap: var(--space-small);\n}\n\n._6sZaxiji5rQ- {\n gap: var(--space-base);\n}\n\n.wh-FkS64oJ0- {\n display: -ms-flexbox;\n display: flex;\n}\n\n.Idp-BJIbUUs- {\n width: 56px;\n height: 56px;\n}\n\n.kOG-STgt5Hs- {\n width: 168px;\n height: 168px;\n box-shadow: var(--shadow-base);\n}\n";
|
|
16
|
+
var styles = {"gallery":"G3D4T8IYmwA-","galleryLarge":"_6sZaxiji5rQ-","showMoreButton":"wh-FkS64oJ0-","baseShowMoreButton":"Idp-BJIbUUs-","largeShowMoreButton":"kOG-STgt5Hs-"};
|
|
17
|
+
styleInject_es.styleInject(css_248z);
|
|
18
|
+
|
|
19
|
+
function Gallery({ files, size = "base", max, onDelete }) {
|
|
20
|
+
const { images, filesToImageIndex } = generateImagesArray(files);
|
|
21
|
+
const [lightboxOpen, setLightboxOpen] = React.useState(false);
|
|
22
|
+
const [lightboxIndex, setLightboxIndex] = React.useState(0);
|
|
23
|
+
const [displayPastMax, setDisplayPastMax] = React.useState(max ? false : true);
|
|
24
|
+
const visibleFiles = displayPastMax ? files : files.slice(0, max);
|
|
25
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
26
|
+
React__default["default"].createElement("div", { className: size === "large" ? styles.galleryLarge : styles.gallery },
|
|
27
|
+
visibleFiles.map((file, index) => {
|
|
28
|
+
return (React__default["default"].createElement(FormatFile.FormatFile, { key: file.key, file: Object.assign(Object.assign({}, file), { src: () => Promise.resolve(file.src) }), display: "compact", displaySize: size, onClick: () => {
|
|
29
|
+
handleThumbnailClicked(index);
|
|
30
|
+
}, onDelete: onDelete ? () => onDelete === null || onDelete === void 0 ? void 0 : onDelete(file) : undefined }));
|
|
31
|
+
}),
|
|
32
|
+
max && files.length > max && !displayPastMax && (React__default["default"].createElement("div", { className: classnames__default["default"](styles.showMoreButton, styles[`${size}ShowMoreButton`]) },
|
|
33
|
+
React__default["default"].createElement(Button.Button, { type: "tertiary", size: size, label: `+ ${files.length - max}`, fullWidth: true, onClick: () => {
|
|
34
|
+
setDisplayPastMax(true);
|
|
35
|
+
} })))),
|
|
36
|
+
React__default["default"].createElement(LightBox.LightBox, { open: lightboxOpen, images: images, imageIndex: lightboxIndex, onRequestClose: handleLightboxClose })));
|
|
37
|
+
function handleThumbnailClicked(index) {
|
|
38
|
+
if (files[index].type.startsWith("image/")) {
|
|
39
|
+
handleLightboxOpen(index);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
window.open(files[index].src, "_blank");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function handleLightboxOpen(index) {
|
|
46
|
+
const fileToImageIndex = filesToImageIndex[index];
|
|
47
|
+
if (fileToImageIndex !== undefined) {
|
|
48
|
+
setLightboxIndex(fileToImageIndex);
|
|
49
|
+
setLightboxOpen(true);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function handleLightboxClose() {
|
|
53
|
+
setLightboxOpen(false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function generateImagesArray(files) {
|
|
57
|
+
const images = [];
|
|
58
|
+
const filesToImageIndex = [];
|
|
59
|
+
let imageIndex = 0;
|
|
60
|
+
for (let i = 0; i < files.length; i++) {
|
|
61
|
+
if (files[i].type.startsWith("image/")) {
|
|
62
|
+
images.push({ title: files[i].name, url: files[i].src });
|
|
63
|
+
filesToImageIndex.push(imageIndex);
|
|
64
|
+
imageIndex++;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
filesToImageIndex.push(undefined);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return { images, filesToImageIndex };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
exports.Gallery = Gallery;
|
package/dist/Gallery.cjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Gallery = require('./Gallery-8d4d79a2.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('./style-inject.es-9d2f5f4e.js');
|
|
9
|
+
require('./LightBox-3d6e74ba.js');
|
|
10
|
+
require('framer-motion');
|
|
11
|
+
require('react-dom');
|
|
12
|
+
require('lodash/debounce');
|
|
13
|
+
require('@jobber/hooks/useRefocusOnActivator');
|
|
14
|
+
require('@jobber/hooks/useOnKeyDown');
|
|
15
|
+
require('@jobber/hooks/useFocusTrap');
|
|
16
|
+
require('./ButtonDismiss-d7417429.js');
|
|
17
|
+
require('./Button-ec64869e.js');
|
|
18
|
+
require('react-router-dom');
|
|
19
|
+
require('./Icon-405a216c.js');
|
|
20
|
+
require('@jobber/design');
|
|
21
|
+
require('./Typography-fd88fcce.js');
|
|
22
|
+
require('./FormatFile-d57b8dfa.js');
|
|
23
|
+
require('filesize');
|
|
24
|
+
require('./ConfirmationModal-09ec5d02.js');
|
|
25
|
+
require('./Modal-cda55f02.js');
|
|
26
|
+
require('./Heading-a8a24775.js');
|
|
27
|
+
require('./getAtlantisConfig-0f3e8af2.js');
|
|
28
|
+
require('./Content-60a3452a.js');
|
|
29
|
+
require('./Markdown-36854bd5.js');
|
|
30
|
+
require('react-markdown');
|
|
31
|
+
require('./Text-714f7d14.js');
|
|
32
|
+
require('./Emphasis-84de1f3f.js');
|
|
33
|
+
require('./Glimmer-3fcdae65.js');
|
|
34
|
+
require('./tslib.es6-754e2961.js');
|
|
35
|
+
require('./ProgressBar-4ee648b7.js');
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.Gallery = Gallery.Gallery;
|
package/dist/Gallery.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { G as Gallery } from './Gallery-7760f21f.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'classnames';
|
|
4
|
+
import './style-inject.es-a0e1a0ba.js';
|
|
5
|
+
import './LightBox-8cc72953.js';
|
|
6
|
+
import 'framer-motion';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import 'lodash/debounce';
|
|
9
|
+
import '@jobber/hooks/useRefocusOnActivator';
|
|
10
|
+
import '@jobber/hooks/useOnKeyDown';
|
|
11
|
+
import '@jobber/hooks/useFocusTrap';
|
|
12
|
+
import './ButtonDismiss-a11eef74.js';
|
|
13
|
+
import './Button-30154871.js';
|
|
14
|
+
import 'react-router-dom';
|
|
15
|
+
import './Icon-22723fe6.js';
|
|
16
|
+
import '@jobber/design';
|
|
17
|
+
import './Typography-52ed1386.js';
|
|
18
|
+
import './FormatFile-648aea3e.js';
|
|
19
|
+
import 'filesize';
|
|
20
|
+
import './ConfirmationModal-64f82a31.js';
|
|
21
|
+
import './Modal-eeb52d66.js';
|
|
22
|
+
import './Heading-dfd4f1cf.js';
|
|
23
|
+
import './getAtlantisConfig-5b50057c.js';
|
|
24
|
+
import './Content-c96e9299.js';
|
|
25
|
+
import './Markdown-7b84fcdb.js';
|
|
26
|
+
import 'react-markdown';
|
|
27
|
+
import './Text-c92ddeb3.js';
|
|
28
|
+
import './Emphasis-2a640962.js';
|
|
29
|
+
import './Glimmer-6bf75ae0.js';
|
|
30
|
+
import './tslib.es6-c563c1dd.js';
|
|
31
|
+
import './ProgressBar-022ef3f6.js';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-754e2961.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var styleInject_es = require('./style-inject.es-9d2f5f4e.js');
|
|
7
|
+
var Content = require('./Content-60a3452a.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
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
13
|
+
|
|
14
|
+
var css_248z$3 = ".FXzzrJAf890- {\n --glimmer-background: rgba(var(--color-black--rgb) 5%);\n --glimmer-shine: rgba(var(--color-white--rgb), var(--glimmer-shine-opacity));\n --glimmer-shine-opacity: 80%;\n --duration-base: calc(var(--timing-slowest) * 4); /* 2s */\n --duration-fast: calc(var(--duration-base) / 2); /* 1s */\n\n width: 100%;\n height: 100%;\n border-radius: var(--radius-base);\n background-color: rgba(var(--color-black--rgb) 5%);\n background-color: var(--glimmer-background);\n background-image: linear-gradient(\n 90deg,\n transparent 0px,\n rgba(var(--color-white--rgb) 80%) var(--space-larger),\n transparent var(--space-extravagant)\n );\n background-image: linear-gradient(\n 90deg,\n transparent 0px,\n rgba(var(--color-white--rgb), 80%) var(--space-larger),\n transparent var(--space-extravagant)\n );\n background-image: linear-gradient(\n 90deg,\n transparent 0px,\n var(--glimmer-shine) var(--space-larger),\n transparent var(--space-extravagant)\n );\n background-repeat: no-repeat;\n background-size: var(--space-extravagant) 100%;\n -webkit-animation: FXzzrJAf890- 2s infinite linear;\n animation: FXzzrJAf890- 2s infinite linear;\n}@supports (color: rgb(0 0 0 / 0.5)) and (color: hsl(0 0% 0% / 0.5)) {.FXzzrJAf890- {\n --glimmer-background: rgba(var(--color-black--rgb), 5%);\n}\n}\n\n.s9bG0yRJR3A- {\n --glimmer-background: rgba(var(--color-white--rgb) 10%);\n --glimmer-shine-opacity: 25%;\n}\n\n@supports (color: rgb(0 0 0 / 0.5)) and (color: hsl(0 0% 0% / 0.5)) {\n\n.s9bG0yRJR3A- {\n --glimmer-background: rgba(var(--color-white--rgb), 10%);\n}\n}\n\n@-webkit-keyframes FXzzrJAf890- {\n 0%,\n 20% {\n background-position-x: calc(var(--space-extravagant) * -1);\n }\n\n 100% {\n background-position-x: calc(100% + var(--space-extravagant));\n }\n}\n\n@keyframes FXzzrJAf890- {\n 0%,\n 20% {\n background-position-x: calc(var(--space-extravagant) * -1);\n }\n\n 100% {\n background-position-x: calc(100% + var(--space-extravagant));\n }\n}\n\n.M0X0dxjIyv4- {\n width: 30%;\n max-width: 180px;\n min-width: 120px;\n}\n\n.v2Q1amzd7Ac- {\n display: inline-block;\n width: 100px;\n height: 36px;\n}\n\n._8va--lBgr38- {\n display: block;\n width: 100%;\n min-width: 100px;\n}\n";
|
|
15
|
+
var styles = {"glimmer":"FXzzrJAf890-","reverseTheme":"s9bG0yRJR3A-","header":"M0X0dxjIyv4-","button":"v2Q1amzd7Ac-","buttonFill":"_8va--lBgr38-"};
|
|
16
|
+
styleInject_es.styleInject(css_248z$3);
|
|
17
|
+
|
|
18
|
+
var css_248z$2 = ".siUUG4rZNSk- {\n height: var(--space-small);\n}\n\n.nFuBXyrhG2Q- {\n height: var(--space-base);\n}\n\n.oiVEoAqI-fU- {\n height: var(--space-large);\n}\n\n.Tkmo6mSMI9Y- {\n height: var(--space-larger);\n}\n\n.uVeaD3IhD6o- {\n height: var(--space-largest);\n}\n\n._6Wak9NLJ3VQ- {\n height: 100%;\n min-width: var(--space-base);\n min-height: var(--space-base);\n}\n";
|
|
19
|
+
var sizes = {"small":"siUUG4rZNSk-","base":"nFuBXyrhG2Q-","large":"oiVEoAqI-fU-","larger":"Tkmo6mSMI9Y-","largest":"uVeaD3IhD6o-","auto":"_6Wak9NLJ3VQ-"};
|
|
20
|
+
styleInject_es.styleInject(css_248z$2);
|
|
21
|
+
|
|
22
|
+
var css_248z$1 = ".enoWbteryXg- {\n width: 100%;\n}\n\n._9qkwCdedX1M- {\n width: 85%;\n}\n\n.XtyJxvcJDFs- {\n width: 70%;\n}\n\n._8unQ0TS1He4-,\n.ameRMYEKfss- {\n width: auto;\n aspect-ratio: 1;\n}\n\n.ameRMYEKfss- {\n border-radius: var(--radius-circle);\n}\n";
|
|
23
|
+
var shapes = {"rectangle":"enoWbteryXg-","rectangleShort":"_9qkwCdedX1M-","rectangleShorter":"XtyJxvcJDFs-","square":"_8unQ0TS1He4-","circle":"ameRMYEKfss-"};
|
|
24
|
+
styleInject_es.styleInject(css_248z$1);
|
|
25
|
+
|
|
26
|
+
var css_248z = ".hO0mZ6TeVko- {\n -webkit-animation-duration: var(--duration-base);\n animation-duration: var(--duration-base);\n}\n\n.WXi5-zF8Ll4- {\n -webkit-animation-duration: calc(var(--duration-fast));\n animation-duration: calc(var(--duration-fast));\n}\n";
|
|
27
|
+
var timings = {"base":"hO0mZ6TeVko-","fast":"WXi5-zF8Ll4-"};
|
|
28
|
+
styleInject_es.styleInject(css_248z);
|
|
29
|
+
|
|
30
|
+
const GLIMMER_TEST_ID = "ATL-Glimmer";
|
|
31
|
+
const GLIMMER_HEADER_TEST_ID = "ATL-GlimmerHeader";
|
|
32
|
+
const GLIMMER_TEXT_TEST_ID = "ATL-GlimmerText";
|
|
33
|
+
const GLIMMER_BUTTON_TEST_ID = "ATL-GlimmerButton";
|
|
34
|
+
/**
|
|
35
|
+
* **Experimental component! Use at your own risk.**
|
|
36
|
+
*
|
|
37
|
+
* Foundational component used to build loading states such as Skeleton UI
|
|
38
|
+
*
|
|
39
|
+
* @experimental
|
|
40
|
+
*/
|
|
41
|
+
function Glimmer({ size = "base", shape = "rectangle", timing = "base", reverseTheme = false, width, }) {
|
|
42
|
+
const className = classnames__default["default"](styles.glimmer, sizes[size], shapes[shape], timings[timing], { [styles.reverseTheme]: reverseTheme });
|
|
43
|
+
return (React__default["default"].createElement("div", { "aria-busy": "true", role: "status", className: className, "data-testid": GLIMMER_TEST_ID, style: { width } }));
|
|
44
|
+
}
|
|
45
|
+
Glimmer.Header = function GlimmerHeader(_a) {
|
|
46
|
+
var { level = 3 } = _a, props = tslib_es6.__rest(_a, ["level"]);
|
|
47
|
+
const headerSize = {
|
|
48
|
+
1: "largest",
|
|
49
|
+
2: "larger",
|
|
50
|
+
3: "large",
|
|
51
|
+
4: "base",
|
|
52
|
+
5: "small",
|
|
53
|
+
};
|
|
54
|
+
return (React__default["default"].createElement("div", { className: styles.header, "data-testid": GLIMMER_HEADER_TEST_ID },
|
|
55
|
+
React__default["default"].createElement(Glimmer, Object.assign({ size: headerSize[level] }, props))));
|
|
56
|
+
};
|
|
57
|
+
Glimmer.Text = function GlimmerText(_a) {
|
|
58
|
+
var { width, lines = 3 } = _a, props = tslib_es6.__rest(_a, ["width", "lines"]);
|
|
59
|
+
const children = [
|
|
60
|
+
React__default["default"].createElement(Glimmer, Object.assign({ key: "1", size: "small", shape: "rectangleShort" }, props)),
|
|
61
|
+
React__default["default"].createElement(Glimmer, Object.assign({ key: "2", size: "small" }, props)),
|
|
62
|
+
React__default["default"].createElement(Glimmer, Object.assign({ key: "3", size: "small", shape: "rectangleShorter" }, props)),
|
|
63
|
+
].slice(0, lines);
|
|
64
|
+
return (React__default["default"].createElement("div", { style: { width }, "data-testid": GLIMMER_TEXT_TEST_ID },
|
|
65
|
+
React__default["default"].createElement(Content.Content, { spacing: "small" }, children)));
|
|
66
|
+
};
|
|
67
|
+
Glimmer.Button = function GlimmerButton(_a) {
|
|
68
|
+
var { fullWidth = false } = _a, props = tslib_es6.__rest(_a, ["fullWidth"]);
|
|
69
|
+
const buttonClassNames = classnames__default["default"](styles.button, {
|
|
70
|
+
[styles.buttonFill]: fullWidth,
|
|
71
|
+
});
|
|
72
|
+
return (React__default["default"].createElement("div", { className: buttonClassNames, "data-testid": GLIMMER_BUTTON_TEST_ID },
|
|
73
|
+
React__default["default"].createElement(Glimmer, Object.assign({}, props, { size: "auto" }))));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
exports.GLIMMER_TEST_ID = GLIMMER_TEST_ID;
|
|
77
|
+
exports.Glimmer = Glimmer;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { _ as __rest } from './tslib.es6-c563c1dd.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
5
|
+
import { C as Content } from './Content-c96e9299.js';
|
|
6
|
+
|
|
7
|
+
var css_248z$3 = ".FXzzrJAf890- {\n --glimmer-background: rgba(var(--color-black--rgb) 5%);\n --glimmer-shine: rgba(var(--color-white--rgb), var(--glimmer-shine-opacity));\n --glimmer-shine-opacity: 80%;\n --duration-base: calc(var(--timing-slowest) * 4); /* 2s */\n --duration-fast: calc(var(--duration-base) / 2); /* 1s */\n\n width: 100%;\n height: 100%;\n border-radius: var(--radius-base);\n background-color: rgba(var(--color-black--rgb) 5%);\n background-color: var(--glimmer-background);\n background-image: linear-gradient(\n 90deg,\n transparent 0px,\n rgba(var(--color-white--rgb) 80%) var(--space-larger),\n transparent var(--space-extravagant)\n );\n background-image: linear-gradient(\n 90deg,\n transparent 0px,\n rgba(var(--color-white--rgb), 80%) var(--space-larger),\n transparent var(--space-extravagant)\n );\n background-image: linear-gradient(\n 90deg,\n transparent 0px,\n var(--glimmer-shine) var(--space-larger),\n transparent var(--space-extravagant)\n );\n background-repeat: no-repeat;\n background-size: var(--space-extravagant) 100%;\n -webkit-animation: FXzzrJAf890- 2s infinite linear;\n animation: FXzzrJAf890- 2s infinite linear;\n}@supports (color: rgb(0 0 0 / 0.5)) and (color: hsl(0 0% 0% / 0.5)) {.FXzzrJAf890- {\n --glimmer-background: rgba(var(--color-black--rgb), 5%);\n}\n}\n\n.s9bG0yRJR3A- {\n --glimmer-background: rgba(var(--color-white--rgb) 10%);\n --glimmer-shine-opacity: 25%;\n}\n\n@supports (color: rgb(0 0 0 / 0.5)) and (color: hsl(0 0% 0% / 0.5)) {\n\n.s9bG0yRJR3A- {\n --glimmer-background: rgba(var(--color-white--rgb), 10%);\n}\n}\n\n@-webkit-keyframes FXzzrJAf890- {\n 0%,\n 20% {\n background-position-x: calc(var(--space-extravagant) * -1);\n }\n\n 100% {\n background-position-x: calc(100% + var(--space-extravagant));\n }\n}\n\n@keyframes FXzzrJAf890- {\n 0%,\n 20% {\n background-position-x: calc(var(--space-extravagant) * -1);\n }\n\n 100% {\n background-position-x: calc(100% + var(--space-extravagant));\n }\n}\n\n.M0X0dxjIyv4- {\n width: 30%;\n max-width: 180px;\n min-width: 120px;\n}\n\n.v2Q1amzd7Ac- {\n display: inline-block;\n width: 100px;\n height: 36px;\n}\n\n._8va--lBgr38- {\n display: block;\n width: 100%;\n min-width: 100px;\n}\n";
|
|
8
|
+
var styles = {"glimmer":"FXzzrJAf890-","reverseTheme":"s9bG0yRJR3A-","header":"M0X0dxjIyv4-","button":"v2Q1amzd7Ac-","buttonFill":"_8va--lBgr38-"};
|
|
9
|
+
styleInject(css_248z$3);
|
|
10
|
+
|
|
11
|
+
var css_248z$2 = ".siUUG4rZNSk- {\n height: var(--space-small);\n}\n\n.nFuBXyrhG2Q- {\n height: var(--space-base);\n}\n\n.oiVEoAqI-fU- {\n height: var(--space-large);\n}\n\n.Tkmo6mSMI9Y- {\n height: var(--space-larger);\n}\n\n.uVeaD3IhD6o- {\n height: var(--space-largest);\n}\n\n._6Wak9NLJ3VQ- {\n height: 100%;\n min-width: var(--space-base);\n min-height: var(--space-base);\n}\n";
|
|
12
|
+
var sizes = {"small":"siUUG4rZNSk-","base":"nFuBXyrhG2Q-","large":"oiVEoAqI-fU-","larger":"Tkmo6mSMI9Y-","largest":"uVeaD3IhD6o-","auto":"_6Wak9NLJ3VQ-"};
|
|
13
|
+
styleInject(css_248z$2);
|
|
14
|
+
|
|
15
|
+
var css_248z$1 = ".enoWbteryXg- {\n width: 100%;\n}\n\n._9qkwCdedX1M- {\n width: 85%;\n}\n\n.XtyJxvcJDFs- {\n width: 70%;\n}\n\n._8unQ0TS1He4-,\n.ameRMYEKfss- {\n width: auto;\n aspect-ratio: 1;\n}\n\n.ameRMYEKfss- {\n border-radius: var(--radius-circle);\n}\n";
|
|
16
|
+
var shapes = {"rectangle":"enoWbteryXg-","rectangleShort":"_9qkwCdedX1M-","rectangleShorter":"XtyJxvcJDFs-","square":"_8unQ0TS1He4-","circle":"ameRMYEKfss-"};
|
|
17
|
+
styleInject(css_248z$1);
|
|
18
|
+
|
|
19
|
+
var css_248z = ".hO0mZ6TeVko- {\n -webkit-animation-duration: var(--duration-base);\n animation-duration: var(--duration-base);\n}\n\n.WXi5-zF8Ll4- {\n -webkit-animation-duration: calc(var(--duration-fast));\n animation-duration: calc(var(--duration-fast));\n}\n";
|
|
20
|
+
var timings = {"base":"hO0mZ6TeVko-","fast":"WXi5-zF8Ll4-"};
|
|
21
|
+
styleInject(css_248z);
|
|
22
|
+
|
|
23
|
+
const GLIMMER_TEST_ID = "ATL-Glimmer";
|
|
24
|
+
const GLIMMER_HEADER_TEST_ID = "ATL-GlimmerHeader";
|
|
25
|
+
const GLIMMER_TEXT_TEST_ID = "ATL-GlimmerText";
|
|
26
|
+
const GLIMMER_BUTTON_TEST_ID = "ATL-GlimmerButton";
|
|
27
|
+
/**
|
|
28
|
+
* **Experimental component! Use at your own risk.**
|
|
29
|
+
*
|
|
30
|
+
* Foundational component used to build loading states such as Skeleton UI
|
|
31
|
+
*
|
|
32
|
+
* @experimental
|
|
33
|
+
*/
|
|
34
|
+
function Glimmer({ size = "base", shape = "rectangle", timing = "base", reverseTheme = false, width, }) {
|
|
35
|
+
const className = classnames(styles.glimmer, sizes[size], shapes[shape], timings[timing], { [styles.reverseTheme]: reverseTheme });
|
|
36
|
+
return (React.createElement("div", { "aria-busy": "true", role: "status", className: className, "data-testid": GLIMMER_TEST_ID, style: { width } }));
|
|
37
|
+
}
|
|
38
|
+
Glimmer.Header = function GlimmerHeader(_a) {
|
|
39
|
+
var { level = 3 } = _a, props = __rest(_a, ["level"]);
|
|
40
|
+
const headerSize = {
|
|
41
|
+
1: "largest",
|
|
42
|
+
2: "larger",
|
|
43
|
+
3: "large",
|
|
44
|
+
4: "base",
|
|
45
|
+
5: "small",
|
|
46
|
+
};
|
|
47
|
+
return (React.createElement("div", { className: styles.header, "data-testid": GLIMMER_HEADER_TEST_ID },
|
|
48
|
+
React.createElement(Glimmer, Object.assign({ size: headerSize[level] }, props))));
|
|
49
|
+
};
|
|
50
|
+
Glimmer.Text = function GlimmerText(_a) {
|
|
51
|
+
var { width, lines = 3 } = _a, props = __rest(_a, ["width", "lines"]);
|
|
52
|
+
const children = [
|
|
53
|
+
React.createElement(Glimmer, Object.assign({ key: "1", size: "small", shape: "rectangleShort" }, props)),
|
|
54
|
+
React.createElement(Glimmer, Object.assign({ key: "2", size: "small" }, props)),
|
|
55
|
+
React.createElement(Glimmer, Object.assign({ key: "3", size: "small", shape: "rectangleShorter" }, props)),
|
|
56
|
+
].slice(0, lines);
|
|
57
|
+
return (React.createElement("div", { style: { width }, "data-testid": GLIMMER_TEXT_TEST_ID },
|
|
58
|
+
React.createElement(Content, { spacing: "small" }, children)));
|
|
59
|
+
};
|
|
60
|
+
Glimmer.Button = function GlimmerButton(_a) {
|
|
61
|
+
var { fullWidth = false } = _a, props = __rest(_a, ["fullWidth"]);
|
|
62
|
+
const buttonClassNames = classnames(styles.button, {
|
|
63
|
+
[styles.buttonFill]: fullWidth,
|
|
64
|
+
});
|
|
65
|
+
return (React.createElement("div", { className: buttonClassNames, "data-testid": GLIMMER_BUTTON_TEST_ID },
|
|
66
|
+
React.createElement(Glimmer, Object.assign({}, props, { size: "auto" }))));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { Glimmer as G, GLIMMER_TEST_ID as a };
|
package/dist/Glimmer.cjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Glimmer = require('./Glimmer-3fcdae65.js');
|
|
6
|
+
require('./tslib.es6-754e2961.js');
|
|
7
|
+
require('react');
|
|
8
|
+
require('classnames');
|
|
9
|
+
require('./style-inject.es-9d2f5f4e.js');
|
|
10
|
+
require('./Content-60a3452a.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.GLIMMER_TEST_ID = Glimmer.GLIMMER_TEST_ID;
|
|
15
|
+
exports.Glimmer = Glimmer.Glimmer;
|
package/dist/Glimmer.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
import { s as styleInject } from './style-inject.es-a0e1a0ba.js';
|
|
4
|
+
import { useAssert } from '@jobber/hooks/useAssert';
|
|
5
|
+
|
|
6
|
+
var css_248z$2 = ".YJHtDDKq6WI- {\n grid-column: initial;\n grid-column-end: span var(--gridCell--size-xs);\n}\n@media (--small-screens-and-up) {\n .YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-sm);\n}\n }\n@media (--medium-screens-and-up) {\n .YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-md);\n}\n }\n@media (--large-screens-and-up) {\n .YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-lg);\n}\n }\n@media (--extra-large-screens-and-up) {\n .YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-xl);\n}\n }\n";
|
|
7
|
+
var styles$1 = {"gridCell":"YJHtDDKq6WI-"};
|
|
8
|
+
styleInject(css_248z$2);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Breakpoints that we support
|
|
12
|
+
*/
|
|
13
|
+
const breakpoints = ["xs", "sm", "md", "lg", "xl"];
|
|
14
|
+
const MAX_COLUMNS = 12;
|
|
15
|
+
const GRID_CELL_TEST_ID = "ATL-Grid-GridCell";
|
|
16
|
+
function InternalGridCell({ size, children, }) {
|
|
17
|
+
/**
|
|
18
|
+
* Build CSS variables for column sizes for all possible breakpoints to size
|
|
19
|
+
* the column
|
|
20
|
+
*/
|
|
21
|
+
const cssSizeVariables = breakpoints.reduce(getSizeCSSVariables(size), {});
|
|
22
|
+
return (React.createElement("div", { "data-testid": GRID_CELL_TEST_ID, className: styles$1.gridCell, style: cssSizeVariables }, children));
|
|
23
|
+
}
|
|
24
|
+
function getSizeCSSVariables(size) {
|
|
25
|
+
return (breakpointsObj, currentSize) => {
|
|
26
|
+
let columnSize = size[currentSize];
|
|
27
|
+
// If a column size isn't provided in the size prop, use the previous
|
|
28
|
+
// breakpoint's value
|
|
29
|
+
if (!columnSize) {
|
|
30
|
+
const existingValues = Object.values(breakpointsObj);
|
|
31
|
+
const lastKnownValue = existingValues[existingValues.length - 1];
|
|
32
|
+
columnSize = lastKnownValue || MAX_COLUMNS;
|
|
33
|
+
}
|
|
34
|
+
breakpointsObj[`--gridCell--size-${currentSize}`] = columnSize;
|
|
35
|
+
return breakpointsObj;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var css_248z$1 = ".NqFGJV-UF3Q- {\n display: grid;\n grid-template-columns: repeat(12, minmax(0, 1fr));\n}\n\n.IZLiiSquUTM- {\n gap: var(--space-base);\n}\n\n@media (--medium-screens-and-up) {\n .IZLiiSquUTM- {\n gap: var(--space-large);\n }\n}\n";
|
|
40
|
+
var styles = {"grid":"NqFGJV-UF3Q-","gap":"IZLiiSquUTM-"};
|
|
41
|
+
styleInject(css_248z$1);
|
|
42
|
+
|
|
43
|
+
var css_248z = "._8XlrWg3FV-Q- {\n -ms-flex-align: center;\n align-items: center;\n}\n\n.uKzqJPlYxJs- {\n -ms-flex-align: start;\n align-items: start;\n}\n\n.CSBjeFlj2xQ- {\n -ms-flex-align: end;\n align-items: end;\n}\n\n.BYyFdzONXyk- {\n -ms-flex-align: stretch;\n align-items: stretch;\n}\n";
|
|
44
|
+
var alignments = {"center":"_8XlrWg3FV-Q-","start":"uKzqJPlYxJs-","end":"CSBjeFlj2xQ-","stretch":"BYyFdzONXyk-"};
|
|
45
|
+
styleInject(css_248z);
|
|
46
|
+
|
|
47
|
+
// Only need the component to pass in the data as a react children
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
49
|
+
function GridCell(props) {
|
|
50
|
+
// Throw error when <Grid.Cell /> gets used outside of the <Grid />
|
|
51
|
+
useAssert(true, "`<Grid.Cell>` can only be used inside of a `<Grid>` component!");
|
|
52
|
+
return React.createElement(React.Fragment, null);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const GRID_TEST_ID = "ATL-Grid";
|
|
56
|
+
function Grid({ alignItems = "start", gap = true, children, }) {
|
|
57
|
+
const classnames$1 = classnames(styles.grid, alignments[alignItems], {
|
|
58
|
+
[styles.gap]: gap,
|
|
59
|
+
});
|
|
60
|
+
return (React.createElement("div", { "data-testid": GRID_TEST_ID, className: classnames$1 }, React.Children.map(children, ({ props }) => {
|
|
61
|
+
return React.createElement(InternalGridCell, Object.assign({}, props));
|
|
62
|
+
})));
|
|
63
|
+
}
|
|
64
|
+
Grid.Cell = GridCell;
|
|
65
|
+
|
|
66
|
+
export { GRID_TEST_ID as G, Grid as a };
|