@jobber/components 2.86.0 → 2.86.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/CHANGELOG.md +16 -0
- package/dist/Autocomplete/Autocomplete.d.ts +47 -47
- package/dist/Autocomplete/Menu.d.ts +9 -9
- package/dist/Autocomplete/Option.d.ts +15 -15
- package/dist/Autocomplete/index.d.ts +2 -2
- package/dist/Autocomplete/index.js +215 -211
- package/dist/Avatar/Avatar.d.ts +37 -37
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +7 -74
- package/dist/Avatar/utilities.d.ts +1 -1
- package/dist/Avatar-cfd04e86.js +82 -0
- package/dist/Banner/Banner.d.ts +19 -19
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +67 -65
- package/dist/Button/Button.d.ts +64 -64
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +9 -53
- package/dist/Button-5b2f1636.js +60 -0
- package/dist/ButtonDismiss/ButtonDismiss.d.ts +7 -7
- package/dist/ButtonDismiss/index.d.ts +1 -1
- package/dist/ButtonDismiss/index.js +10 -15
- package/dist/ButtonDismiss-4cde8f7c.js +15 -0
- package/dist/Card/Card.d.ts +31 -31
- package/dist/Card/CardClickable.d.ts +12 -12
- package/dist/Card/index.d.ts +1 -1
- package/dist/Card/index.js +7 -61
- package/dist/Card-368e01a3.js +68 -0
- package/dist/Checkbox/Checkbox.d.ts +52 -52
- package/dist/Checkbox/index.d.ts +1 -1
- package/dist/Checkbox/index.js +34 -32
- package/dist/Chips/Chip.d.ts +8 -8
- package/dist/Chips/ChipDismissible.d.ts +7 -7
- package/dist/Chips/ChipTypes.d.ts +59 -59
- package/dist/Chips/Chips.d.ts +2 -2
- package/dist/Chips/ChipsTypes.d.ts +82 -82
- package/dist/Chips/InternalChip.d.ts +2 -2
- package/dist/Chips/InternalChipAffix.d.ts +10 -10
- package/dist/Chips/InternalChipButton.d.ts +10 -10
- package/dist/Chips/InternalChipDismissible/InternalChipDismissible.d.ts +2 -2
- package/dist/Chips/InternalChipDismissible/InternalChipDismissibleInput.d.ts +2 -2
- package/dist/Chips/InternalChipDismissible/InternalChipDismissibleTypes.d.ts +13 -13
- package/dist/Chips/InternalChipDismissible/hooks/index.d.ts +5 -5
- package/dist/Chips/InternalChipDismissible/hooks/useInView.d.ts +5 -5
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissible.d.ts +15 -15
- package/dist/Chips/InternalChipDismissible/hooks/useInternalChipDismissibleInput.d.ts +28 -28
- package/dist/Chips/InternalChipDismissible/hooks/useRepositionMenu.d.ts +16 -16
- package/dist/Chips/InternalChipDismissible/hooks/useScrollToActive.d.ts +2 -2
- package/dist/Chips/InternalChipDismissible/index.d.ts +1 -1
- package/dist/Chips/InternalChipMultiSelect.d.ts +4 -4
- package/dist/Chips/InternalChipSingleSelect.d.ts +4 -4
- package/dist/Chips/index.d.ts +3 -3
- package/dist/Chips/index.js +493 -491
- package/dist/Chips/utils/mdxUtils.d.ts +9 -9
- package/dist/ConfirmationModal/ConfirmationModal.d.ts +62 -62
- package/dist/ConfirmationModal/index.d.ts +1 -1
- package/dist/ConfirmationModal/index.js +20 -109
- package/dist/ConfirmationModal-b7ef110f.js +103 -0
- package/dist/Content/Content.d.ts +13 -13
- package/dist/Content/index.d.ts +1 -1
- package/dist/Content/index.js +5 -19
- package/dist/Content-18de5fbb.js +26 -0
- package/dist/Countdown/Countdown.d.ts +31 -31
- package/dist/Countdown/computeTimeUnit.d.ts +3 -3
- package/dist/Countdown/index.d.ts +1 -1
- package/dist/Countdown/index.js +63 -61
- package/dist/DataDump/DataDump.d.ts +20 -20
- package/dist/DataDump/index.d.ts +1 -1
- package/dist/DataDump/index.js +18 -17
- package/dist/DatePicker/DatePicker.d.ts +50 -50
- package/dist/DatePicker/DatePickerActivator.d.ts +12 -12
- package/dist/DatePicker/DatePickerCustomHeader.d.ts +2 -2
- package/dist/DatePicker/index.d.ts +1 -1
- package/dist/DatePicker/index.js +13 -97
- package/dist/DatePicker/useFocusOnSelectedDate.d.ts +5 -5
- package/dist/DatePicker-ad6f8630.js +103 -0
- package/dist/DescriptionList/DescriptionList.d.ts +10 -10
- package/dist/DescriptionList/index.d.ts +1 -1
- package/dist/DescriptionList/index.js +16 -15
- package/dist/Disclosure/Disclosure.d.ts +20 -20
- package/dist/Disclosure/index.d.ts +1 -1
- package/dist/Disclosure/index.js +32 -31
- package/dist/Divider/Divider.d.ts +16 -16
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +19 -17
- package/dist/Drawer/Drawer.d.ts +13 -13
- package/dist/Drawer/DrawerGrid.d.ts +6 -6
- package/dist/Drawer/index.d.ts +2 -2
- package/dist/Drawer/index.js +39 -37
- package/dist/Emphasis/Emphasis.d.ts +11 -11
- package/dist/Emphasis/index.d.ts +1 -1
- package/dist/Emphasis/index.js +7 -17
- package/dist/Emphasis-fd845639.js +21 -0
- package/dist/FeatureSwitch/FeatureSwitch.d.ts +51 -51
- package/dist/FeatureSwitch/index.d.ts +1 -1
- package/dist/FeatureSwitch/index.js +57 -55
- package/dist/Form/Form.d.ts +18 -18
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.js +58 -57
- package/dist/FormField/FormField.d.ts +2 -2
- package/dist/FormField/FormFieldAffix.d.ts +13 -13
- package/dist/FormField/FormFieldDescription.d.ts +6 -6
- package/dist/FormField/FormFieldPostFix.d.ts +5 -5
- package/dist/FormField/FormFieldTypes.d.ts +160 -160
- package/dist/FormField/FormFieldWrapper.d.ts +9 -9
- package/dist/FormField/index.d.ts +2 -2
- package/dist/FormField/index.js +15 -208
- package/dist/FormField-a92c7bac.js +213 -0
- package/dist/FormatDate/FormatDate.d.ts +12 -12
- package/dist/FormatDate/index.d.ts +1 -1
- package/dist/FormatDate/index.js +24 -23
- package/dist/FormatEmail/FormatEmail.d.ts +8 -8
- package/dist/FormatEmail/index.d.ts +1 -1
- package/dist/FormatEmail/index.js +12 -10
- package/dist/FormatFile/FormatFile.d.ts +30 -30
- package/dist/FormatFile/FormatFileDeleteButton.d.ts +6 -6
- package/dist/FormatFile/InternalThumbnail.d.ts +9 -9
- package/dist/FormatFile/index.d.ts +1 -1
- package/dist/FormatFile/index.js +21 -112
- package/dist/FormatFile-5391d4cf.js +112 -0
- package/dist/FormatRelativeDateTime/FormatRelativeDateTime.d.ts +11 -11
- package/dist/FormatRelativeDateTime/index.d.ts +1 -1
- package/dist/FormatRelativeDateTime/index.js +64 -63
- package/dist/FormatTime/FormatTime.d.ts +15 -15
- package/dist/FormatTime/index.d.ts +1 -1
- package/dist/FormatTime/index.js +28 -27
- package/dist/Gallery/Gallery.d.ts +2 -2
- package/dist/Gallery/GalleryTypes.d.ts +31 -31
- package/dist/Gallery/index.d.ts +1 -1
- package/dist/Gallery/index.js +82 -80
- package/dist/Heading/Heading.d.ts +14 -14
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +7 -53
- package/dist/Heading-56750113.js +57 -0
- package/dist/Icon/Icon.d.ts +22 -22
- package/dist/Icon/index.d.ts +1 -1
- package/dist/Icon/index.js +4 -35
- package/dist/Icon-d5ad1a6d.js +41 -0
- package/dist/InlineLabel/InlineLabel.d.ts +17 -17
- package/dist/InlineLabel/index.d.ts +1 -1
- package/dist/InlineLabel/index.js +20 -18
- package/dist/InputAvatar/InputAvatar.d.ts +22 -22
- package/dist/InputAvatar/index.d.ts +1 -1
- package/dist/InputAvatar/index.js +57 -56
- package/dist/InputDate/InputDate.d.ts +19 -19
- package/dist/InputDate/index.d.ts +1 -1
- package/dist/InputDate/index.js +34 -33
- package/dist/InputEmail/InputEmail.d.ts +5 -5
- package/dist/InputEmail/index.d.ts +1 -1
- package/dist/InputEmail/index.js +29 -28
- package/dist/InputFile/InputFile.d.ts +121 -121
- package/dist/InputFile/index.d.ts +1 -1
- package/dist/InputFile/index.js +15 -168
- package/dist/InputFile-b5cf90c3.js +174 -0
- package/dist/InputGroup/InputGroup.d.ts +11 -11
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +24 -22
- package/dist/InputNumber/InputNumber.d.ts +11 -11
- package/dist/InputNumber/index.d.ts +1 -1
- package/dist/InputNumber/index.js +52 -51
- package/dist/InputPassword/InputPassword.d.ts +12 -12
- package/dist/InputPassword/index.d.ts +1 -1
- package/dist/InputPassword/index.js +28 -27
- package/dist/InputText/InputText.d.ts +29 -29
- package/dist/InputText/index.d.ts +1 -1
- package/dist/InputText/index.js +15 -95
- package/dist/InputText-cb3be15c.js +91 -0
- package/dist/InputTime/InputTime.d.ts +2 -2
- package/dist/InputTime/InputTimeProps.d.ts +18 -18
- package/dist/InputTime/InputTimeSafari.d.ts +2 -2
- package/dist/InputTime/civilTimeConversions.d.ts +3 -3
- package/dist/InputTime/index.d.ts +1 -1
- package/dist/InputTime/index.js +402 -257
- package/dist/InputValidation/InputValidation.d.ts +8 -8
- package/dist/InputValidation/index.d.ts +1 -1
- package/dist/InputValidation/index.js +8 -24
- package/dist/InputValidation-24d3621a.js +28 -0
- package/dist/LightBox/LightBox.d.ts +37 -37
- package/dist/LightBox/index.d.ts +1 -1
- package/dist/LightBox/index.js +6 -34
- package/dist/LightBox-b893b656.js +42 -0
- package/dist/List/List.d.ts +11 -11
- package/dist/List/ListItem.d.ts +54 -54
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +76 -74
- package/dist/Markdown/Markdown.d.ts +17 -17
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.js +12 -64
- package/dist/Markdown-69986c49.js +68 -0
- package/dist/Menu/Menu.d.ts +46 -46
- package/dist/Menu/index.d.ts +1 -1
- package/dist/Menu/index.js +13 -128
- package/dist/Menu-6a392af6.js +134 -0
- package/dist/Modal/Modal.d.ts +22 -22
- package/dist/Modal/index.d.ts +1 -1
- package/dist/Modal/index.js +14 -127
- package/dist/Modal/useFocusTrap.d.ts +10 -10
- package/dist/Modal-aaaaf2df.js +132 -0
- package/dist/Page/Page.d.ts +59 -59
- package/dist/Page/index.d.ts +1 -1
- package/dist/Page/index.js +63 -61
- package/dist/Popover/Popover.d.ts +26 -26
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +49 -48
- package/dist/ProgressBar/ProgressBar.d.ts +18 -18
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +5 -22
- package/dist/ProgressBar-e9a49129.js +29 -0
- package/dist/RadioGroup/RadioGroup.d.ts +27 -27
- package/dist/RadioGroup/RadioOption.d.ts +34 -34
- package/dist/RadioGroup/index.d.ts +2 -2
- package/dist/RadioGroup/index.js +38 -37
- package/dist/RecurringSelect/CurrentRecurrenceComponent.d.ts +8 -8
- package/dist/RecurringSelect/RecurringSelect.d.ts +8 -8
- package/dist/RecurringSelect/components/DayOfMonthSelect.d.ts +8 -8
- package/dist/RecurringSelect/components/MonthlyDayOfWeekSelect.d.ts +8 -8
- package/dist/RecurringSelect/components/MonthlySelect.d.ts +8 -8
- package/dist/RecurringSelect/components/WeeklySelect.d.ts +8 -8
- package/dist/RecurringSelect/components/index.d.ts +4 -4
- package/dist/RecurringSelect/index.d.ts +2 -2
- package/dist/RecurringSelect/types.d.ts +65 -65
- package/dist/Select/Option.d.ts +17 -17
- package/dist/Select/Select.d.ts +10 -10
- package/dist/Select/index.d.ts +2 -2
- package/dist/Select/index.js +20 -19
- package/dist/Spinner/Spinner.d.ts +15 -15
- package/dist/Spinner/index.d.ts +1 -1
- package/dist/Spinner/index.js +5 -19
- package/dist/Spinner-18d3dee6.js +26 -0
- package/dist/StatusLabel/StatusLabel.d.ts +25 -25
- package/dist/StatusLabel/index.d.ts +1 -1
- package/dist/StatusLabel/index.js +21 -19
- package/dist/Switch/Switch.d.ts +14 -14
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +7 -53
- package/dist/Switch-d2bec677.js +60 -0
- package/dist/Table/Body.d.ts +6 -6
- package/dist/Table/Cells/Cell.d.ts +7 -7
- package/dist/Table/Cells/CellCurrency.d.ts +8 -8
- package/dist/Table/Cells/CellNumeric.d.ts +4 -4
- package/dist/Table/Footer.d.ts +6 -6
- package/dist/Table/Header.d.ts +6 -6
- package/dist/Table/Row.d.ts +6 -6
- package/dist/Table/Table.d.ts +6 -6
- package/dist/Table/index.d.ts +8 -8
- package/dist/Table/index.js +41 -39
- package/dist/Tabs/Tabs.d.ts +19 -19
- package/dist/Tabs/index.d.ts +1 -1
- package/dist/Tabs/index.js +69 -67
- package/dist/Text/Text.d.ts +9 -9
- package/dist/Text/index.d.ts +1 -1
- package/dist/Text/index.js +7 -29
- package/dist/Text-9bc093e9.js +32 -0
- package/dist/Toast/Toast.d.ts +17 -17
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +93 -93
- package/dist/Toast/showToast.d.ts +2 -2
- package/dist/Tooltip/Tooltip.d.ts +10 -10
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +11 -110
- package/dist/Tooltip/useTooltipPositioning.d.ts +18 -18
- package/dist/Tooltip-4396164d.js +116 -0
- package/dist/Typography/Typography.d.ts +38 -38
- package/dist/Typography/index.d.ts +1 -1
- package/dist/Typography/index.js +6 -57
- package/dist/Typography-7e542a72.js +64 -0
- package/dist/{chunk-17e02351.js → style-inject.es-dcee06b6.js} +0 -0
- package/dist/{chunk-b67af3cb.js → tslib.es6-5b50eb8e.js} +0 -0
- package/package.json +6 -8
- package/rollup.config.js +28 -3
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
export declare enum WeekDay {
|
|
2
|
-
Sunday = 0,
|
|
3
|
-
Monday = 1,
|
|
4
|
-
Tuesday = 2,
|
|
5
|
-
Wednesday = 3,
|
|
6
|
-
Thursday = 4,
|
|
7
|
-
Friday = 5,
|
|
8
|
-
Saturday = 6
|
|
9
|
-
}
|
|
10
|
-
export declare type DayOfMonth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | "LAST";
|
|
11
|
-
export declare enum DurationPeriod {
|
|
12
|
-
Day = "Day",
|
|
13
|
-
Week = "Week",
|
|
14
|
-
DayOfMonth = "DayOfMonth",
|
|
15
|
-
WeekDayOfMonth = "WeekDayOfMonth",
|
|
16
|
-
Year = "Year",
|
|
17
|
-
Visit = "Visit"
|
|
18
|
-
}
|
|
19
|
-
export interface RecurrenceRuleDay {
|
|
20
|
-
type: DurationPeriod.Day;
|
|
21
|
-
}
|
|
22
|
-
export interface RecurrenceRuleWeek {
|
|
23
|
-
type: DurationPeriod.Week;
|
|
24
|
-
weekDays: Set<WeekDay>;
|
|
25
|
-
}
|
|
26
|
-
export interface RecurrenceRuleYear {
|
|
27
|
-
type: DurationPeriod.Year;
|
|
28
|
-
}
|
|
29
|
-
export interface RecurrenceRuleDayOfMonth {
|
|
30
|
-
type: DurationPeriod.DayOfMonth;
|
|
31
|
-
date: Set<DayOfMonth>;
|
|
32
|
-
}
|
|
33
|
-
export interface RecurrenceRuleWeekDayOfMonth {
|
|
34
|
-
type: DurationPeriod.WeekDayOfMonth;
|
|
35
|
-
dayOfWeek: [Set<WeekDay>, Set<WeekDay>, Set<WeekDay>, Set<WeekDay>];
|
|
36
|
-
}
|
|
37
|
-
export declare type RecurrenceRule = {
|
|
38
|
-
interval: number;
|
|
39
|
-
} & (RecurrenceRuleDay | RecurrenceRuleWeek | RecurrenceRuleYear | RecurrenceRuleDayOfMonth | RecurrenceRuleWeekDayOfMonth);
|
|
40
|
-
export interface InitialStateMap {
|
|
41
|
-
[DurationPeriod.Day]: {
|
|
42
|
-
type: DurationPeriod.Day;
|
|
43
|
-
};
|
|
44
|
-
[DurationPeriod.Week]: {
|
|
45
|
-
type: DurationPeriod.Week;
|
|
46
|
-
weekDays: Set<WeekDay>;
|
|
47
|
-
};
|
|
48
|
-
[DurationPeriod.DayOfMonth]: {
|
|
49
|
-
type: DurationPeriod.DayOfMonth;
|
|
50
|
-
date: Set<DayOfMonth>;
|
|
51
|
-
};
|
|
52
|
-
[DurationPeriod.WeekDayOfMonth]: {
|
|
53
|
-
type: DurationPeriod.WeekDayOfMonth;
|
|
54
|
-
dayOfWeek: [Set<WeekDay>, Set<WeekDay>, Set<WeekDay>, Set<WeekDay>];
|
|
55
|
-
};
|
|
56
|
-
[DurationPeriod.Year]: {
|
|
57
|
-
type: DurationPeriod.Year;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export declare const typeInitialStateMap: InitialStateMap;
|
|
61
|
-
export declare const isMonthly: (rule: RecurrenceRule) => rule is ({
|
|
62
|
-
interval: number;
|
|
63
|
-
} & RecurrenceRuleDayOfMonth) | ({
|
|
64
|
-
interval: number;
|
|
65
|
-
} & RecurrenceRuleWeekDayOfMonth);
|
|
1
|
+
export declare enum WeekDay {
|
|
2
|
+
Sunday = 0,
|
|
3
|
+
Monday = 1,
|
|
4
|
+
Tuesday = 2,
|
|
5
|
+
Wednesday = 3,
|
|
6
|
+
Thursday = 4,
|
|
7
|
+
Friday = 5,
|
|
8
|
+
Saturday = 6
|
|
9
|
+
}
|
|
10
|
+
export declare type DayOfMonth = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | "LAST";
|
|
11
|
+
export declare enum DurationPeriod {
|
|
12
|
+
Day = "Day",
|
|
13
|
+
Week = "Week",
|
|
14
|
+
DayOfMonth = "DayOfMonth",
|
|
15
|
+
WeekDayOfMonth = "WeekDayOfMonth",
|
|
16
|
+
Year = "Year",
|
|
17
|
+
Visit = "Visit"
|
|
18
|
+
}
|
|
19
|
+
export interface RecurrenceRuleDay {
|
|
20
|
+
type: DurationPeriod.Day;
|
|
21
|
+
}
|
|
22
|
+
export interface RecurrenceRuleWeek {
|
|
23
|
+
type: DurationPeriod.Week;
|
|
24
|
+
weekDays: Set<WeekDay>;
|
|
25
|
+
}
|
|
26
|
+
export interface RecurrenceRuleYear {
|
|
27
|
+
type: DurationPeriod.Year;
|
|
28
|
+
}
|
|
29
|
+
export interface RecurrenceRuleDayOfMonth {
|
|
30
|
+
type: DurationPeriod.DayOfMonth;
|
|
31
|
+
date: Set<DayOfMonth>;
|
|
32
|
+
}
|
|
33
|
+
export interface RecurrenceRuleWeekDayOfMonth {
|
|
34
|
+
type: DurationPeriod.WeekDayOfMonth;
|
|
35
|
+
dayOfWeek: [Set<WeekDay>, Set<WeekDay>, Set<WeekDay>, Set<WeekDay>];
|
|
36
|
+
}
|
|
37
|
+
export declare type RecurrenceRule = {
|
|
38
|
+
interval: number;
|
|
39
|
+
} & (RecurrenceRuleDay | RecurrenceRuleWeek | RecurrenceRuleYear | RecurrenceRuleDayOfMonth | RecurrenceRuleWeekDayOfMonth);
|
|
40
|
+
export interface InitialStateMap {
|
|
41
|
+
[DurationPeriod.Day]: {
|
|
42
|
+
type: DurationPeriod.Day;
|
|
43
|
+
};
|
|
44
|
+
[DurationPeriod.Week]: {
|
|
45
|
+
type: DurationPeriod.Week;
|
|
46
|
+
weekDays: Set<WeekDay>;
|
|
47
|
+
};
|
|
48
|
+
[DurationPeriod.DayOfMonth]: {
|
|
49
|
+
type: DurationPeriod.DayOfMonth;
|
|
50
|
+
date: Set<DayOfMonth>;
|
|
51
|
+
};
|
|
52
|
+
[DurationPeriod.WeekDayOfMonth]: {
|
|
53
|
+
type: DurationPeriod.WeekDayOfMonth;
|
|
54
|
+
dayOfWeek: [Set<WeekDay>, Set<WeekDay>, Set<WeekDay>, Set<WeekDay>];
|
|
55
|
+
};
|
|
56
|
+
[DurationPeriod.Year]: {
|
|
57
|
+
type: DurationPeriod.Year;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare const typeInitialStateMap: InitialStateMap;
|
|
61
|
+
export declare const isMonthly: (rule: RecurrenceRule) => rule is ({
|
|
62
|
+
interval: number;
|
|
63
|
+
} & RecurrenceRuleDayOfMonth) | ({
|
|
64
|
+
interval: number;
|
|
65
|
+
} & RecurrenceRuleWeekDayOfMonth);
|
package/dist/Select/Option.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
interface InputSelectProps {
|
|
3
|
-
readonly children?: ReactNode;
|
|
4
|
-
readonly disabled?: boolean;
|
|
5
|
-
/**
|
|
6
|
-
* The content of this attribute represents the value to be submitted with the
|
|
7
|
-
* form, should this option be selected.
|
|
8
|
-
*/
|
|
9
|
-
readonly value?: string;
|
|
10
|
-
}
|
|
11
|
-
declare function SelectOption({ children, disabled, value }: InputSelectProps): JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* Whatever mechanism that docz is using to parse out props fails if this
|
|
14
|
-
* component is called Option internally. We have opened an issue with them
|
|
15
|
-
* to find out more information.
|
|
16
|
-
*/
|
|
17
|
-
export { SelectOption as Option };
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface InputSelectProps {
|
|
3
|
+
readonly children?: ReactNode;
|
|
4
|
+
readonly disabled?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The content of this attribute represents the value to be submitted with the
|
|
7
|
+
* form, should this option be selected.
|
|
8
|
+
*/
|
|
9
|
+
readonly value?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function SelectOption({ children, disabled, value }: InputSelectProps): JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* Whatever mechanism that docz is using to parse out props fails if this
|
|
14
|
+
* component is called Option internally. We have opened an issue with them
|
|
15
|
+
* to find out more information.
|
|
16
|
+
*/
|
|
17
|
+
export { SelectOption as Option };
|
package/dist/Select/Select.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FormFieldProps } from "../FormField";
|
|
2
|
-
/**
|
|
3
|
-
* The following is the same as:
|
|
4
|
-
* type BaseProps = Omit<FormFieldProps, "type" | "children">;
|
|
5
|
-
* Unfortunately Docz doesn't currently support Omit so it has been reduced to
|
|
6
|
-
* its component parts.
|
|
7
|
-
*/
|
|
8
|
-
declare type SelectProps = Pick<FormFieldProps, Exclude<keyof FormFieldProps, "type" | "rows" | "keyboard" | "actionsRef">>;
|
|
9
|
-
export declare function Select(props: SelectProps): JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
import { FormFieldProps } from "../FormField";
|
|
2
|
+
/**
|
|
3
|
+
* The following is the same as:
|
|
4
|
+
* type BaseProps = Omit<FormFieldProps, "type" | "children">;
|
|
5
|
+
* Unfortunately Docz doesn't currently support Omit so it has been reduced to
|
|
6
|
+
* its component parts.
|
|
7
|
+
*/
|
|
8
|
+
declare type SelectProps = Pick<FormFieldProps, Exclude<keyof FormFieldProps, "type" | "rows" | "keyboard" | "actionsRef">>;
|
|
9
|
+
export declare function Select(props: SelectProps): JSX.Element;
|
|
10
|
+
export {};
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Select } from "./Select";
|
|
2
|
-
export { Option } from "./Option";
|
|
1
|
+
export { Select } from "./Select";
|
|
2
|
+
export { Option } from "./Option";
|
package/dist/Select/index.js
CHANGED
|
@@ -2,33 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var __chunk_1 = require('../chunk-b67af3cb.js');
|
|
5
|
+
var tslib_es6 = require('../tslib.es6-5b50eb8e.js');
|
|
8
6
|
var React = require('react');
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-17e02351.js');
|
|
11
|
-
require('classnames');
|
|
12
|
-
require('../Typography/index.js');
|
|
13
|
-
require('../Text/index.js');
|
|
14
|
-
require('@jobber/design');
|
|
15
|
-
require('../Icon/index.js');
|
|
7
|
+
var FormField = require('../FormField-a92c7bac.js');
|
|
16
8
|
require('uuid');
|
|
17
9
|
require('react-hook-form');
|
|
18
|
-
|
|
10
|
+
require('../style-inject.es-dcee06b6.js');
|
|
11
|
+
require('classnames');
|
|
12
|
+
require('../Button-5b2f1636.js');
|
|
19
13
|
require('react-router-dom');
|
|
20
|
-
require('../
|
|
14
|
+
require('../Icon-d5ad1a6d.js');
|
|
15
|
+
require('@jobber/design');
|
|
16
|
+
require('../Typography-7e542a72.js');
|
|
17
|
+
require('../Text-9bc093e9.js');
|
|
18
|
+
require('../InputValidation-24d3621a.js');
|
|
21
19
|
require('framer-motion');
|
|
22
|
-
require('../
|
|
23
|
-
|
|
20
|
+
require('../Spinner-18d3dee6.js');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
25
|
|
|
25
|
-
function Select(props) {
|
|
26
|
-
return React__default.createElement(
|
|
26
|
+
function Select(props) {
|
|
27
|
+
return React__default["default"].createElement(FormField.FormField, tslib_es6.__assign({ type: "select" }, props));
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
function SelectOption(_a) {
|
|
30
|
-
var children = _a.children, disabled = _a.disabled, value = _a.value;
|
|
31
|
-
return (React__default.createElement("option", { disabled: disabled, value: value }, children));
|
|
30
|
+
function SelectOption(_a) {
|
|
31
|
+
var children = _a.children, disabled = _a.disabled, value = _a.value;
|
|
32
|
+
return (React__default["default"].createElement("option", { disabled: disabled, value: value }, children));
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
exports.Option = SelectOption;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
interface SpinnerProps {
|
|
2
|
-
/**
|
|
3
|
-
* Specifies the size of the spinner
|
|
4
|
-
*
|
|
5
|
-
* @default "base"
|
|
6
|
-
*/
|
|
7
|
-
readonly size?: "small" | "base";
|
|
8
|
-
/**
|
|
9
|
-
* Spinner becomes an inline element when true,
|
|
10
|
-
* otherwise it is a block element
|
|
11
|
-
*/
|
|
12
|
-
readonly inline?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare function Spinner({ size, inline }: SpinnerProps): JSX.Element;
|
|
15
|
-
export {};
|
|
1
|
+
interface SpinnerProps {
|
|
2
|
+
/**
|
|
3
|
+
* Specifies the size of the spinner
|
|
4
|
+
*
|
|
5
|
+
* @default "base"
|
|
6
|
+
*/
|
|
7
|
+
readonly size?: "small" | "base";
|
|
8
|
+
/**
|
|
9
|
+
* Spinner becomes an inline element when true,
|
|
10
|
+
* otherwise it is a block element
|
|
11
|
+
*/
|
|
12
|
+
readonly inline?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function Spinner({ size, inline }: SpinnerProps): JSX.Element;
|
|
15
|
+
export {};
|
package/dist/Spinner/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Spinner } from "./Spinner";
|
|
1
|
+
export { Spinner } from "./Spinner";
|
package/dist/Spinner/index.js
CHANGED
|
@@ -2,25 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var Spinner = require('../Spinner-18d3dee6.js');
|
|
6
|
+
require('react');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../style-inject.es-dcee06b6.js');
|
|
6
9
|
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var React__default = _interopDefault(React);
|
|
9
|
-
var __chunk_2 = require('../chunk-17e02351.js');
|
|
10
|
-
var classnames = _interopDefault(require('classnames'));
|
|
11
10
|
|
|
12
|
-
var css = "._2Vxgrs4a5osOKmp9b0i7ud {\n width: var(--space-larger);\n height: var(--space-larger);\n box-shadow: 0px 0px 4px 2px rgba(1, 41, 57, 0.4);\n border: solid var(--color-blue--light);\n border-top-color: var(--color-white);\n border-width: calc(var(--space-small) * 0.75);\n border-radius: var(--radius-circle);\n background-color: var(--color-blue--lightest);\n -webkit-animation-duration: 1s;\n animation-duration: 1s;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: _3bn_eCsItKh7HS1dEQIERv;\n animation-name: _3bn_eCsItKh7HS1dEQIERv;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n will-change: transform;\n}\n\n@-webkit-keyframes _3bn_eCsItKh7HS1dEQIERv {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes _3bn_eCsItKh7HS1dEQIERv {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n._3uMtJrFH9VsqhWvHLkG1SQ {\n width: var(--space-base);\n height: var(--space-base);\n border-width: var(--space-smaller);\n}\n\n._20N4X28gVsanpe8jhUzYxj {\n display: inline-block;\n margin-top: calc(var(--space-smaller) * -1);\n vertical-align: middle;\n}\n";
|
|
13
|
-
var styles = {"spinner":"_2Vxgrs4a5osOKmp9b0i7ud","animationSpin":"_3bn_eCsItKh7HS1dEQIERv","small":"_3uMtJrFH9VsqhWvHLkG1SQ","inline-left":"_20N4X28gVsanpe8jhUzYxj","inline-right":"_20N4X28gVsanpe8jhUzYxj","inline":"_20N4X28gVsanpe8jhUzYxj"};
|
|
14
|
-
__chunk_2.styleInject(css);
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
var _b;
|
|
18
|
-
var _c = _a.size, size = _c === void 0 ? "base" : _c, inline = _a.inline;
|
|
19
|
-
var spinnerStyles = classnames(styles.spinner, (_b = {},
|
|
20
|
-
_b[styles.small] = size === "small",
|
|
21
|
-
_b[styles.inline] = inline,
|
|
22
|
-
_b));
|
|
23
|
-
return (React__default.createElement("div", { className: spinnerStyles, role: "alert", "aria-busy": true, "aria-label": "loading" }));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
exports.Spinner = Spinner;
|
|
12
|
+
exports.Spinner = Spinner.Spinner;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
var styleInject_es = require('./style-inject.es-dcee06b6.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 = "._2Vxgrs4a5osOKmp9b0i7ud {\n width: var(--space-larger);\n height: var(--space-larger);\n box-shadow: 0px 0px 4px 2px rgba(1, 41, 57, 0.4);\n border: solid var(--color-blue--light);\n border-top-color: var(--color-white);\n border-width: calc(var(--space-small) * 0.75);\n border-radius: var(--radius-circle);\n background-color: var(--color-blue--lightest);\n -webkit-animation-duration: 1s;\n animation-duration: 1s;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: _3bn_eCsItKh7HS1dEQIERv;\n animation-name: _3bn_eCsItKh7HS1dEQIERv;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n will-change: transform;\n}\n\n@-webkit-keyframes _3bn_eCsItKh7HS1dEQIERv {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes _3bn_eCsItKh7HS1dEQIERv {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n._3uMtJrFH9VsqhWvHLkG1SQ {\n width: var(--space-base);\n height: var(--space-base);\n border-width: var(--space-smaller);\n}\n\n._20N4X28gVsanpe8jhUzYxj {\n display: inline-block;\n margin-top: calc(var(--space-smaller) * -1);\n vertical-align: middle;\n}\n";
|
|
13
|
+
var styles = {"spinner":"_2Vxgrs4a5osOKmp9b0i7ud","animationSpin":"_3bn_eCsItKh7HS1dEQIERv","small":"_3uMtJrFH9VsqhWvHLkG1SQ","inline-left":"_20N4X28gVsanpe8jhUzYxj","inline-right":"_20N4X28gVsanpe8jhUzYxj","inline":"_20N4X28gVsanpe8jhUzYxj"};
|
|
14
|
+
styleInject_es.styleInject(css);
|
|
15
|
+
|
|
16
|
+
function Spinner(_a) {
|
|
17
|
+
var _b;
|
|
18
|
+
var _c = _a.size, size = _c === void 0 ? "base" : _c, inline = _a.inline;
|
|
19
|
+
var spinnerStyles = classnames__default["default"](styles.spinner, (_b = {},
|
|
20
|
+
_b[styles.small] = size === "small",
|
|
21
|
+
_b[styles.inline] = inline,
|
|
22
|
+
_b));
|
|
23
|
+
return (React__default["default"].createElement("div", { className: spinnerStyles, role: "alert", "aria-busy": true, "aria-label": "loading" }));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.Spinner = Spinner;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export declare type StatusType = "success" | "warning" | "critical" | "inactive" | "informative";
|
|
2
|
-
export interface StatusLabelType {
|
|
3
|
-
readonly statusLabel: string;
|
|
4
|
-
readonly statusType?: StatusType;
|
|
5
|
-
}
|
|
6
|
-
interface StatusLabelProps {
|
|
7
|
-
/**
|
|
8
|
-
* Text to display
|
|
9
|
-
*/
|
|
10
|
-
readonly label: string;
|
|
11
|
-
/**
|
|
12
|
-
* Alignment of label
|
|
13
|
-
*
|
|
14
|
-
* @default "start"
|
|
15
|
-
*/
|
|
16
|
-
readonly alignment?: "start" | "end";
|
|
17
|
-
/**
|
|
18
|
-
* Status color of the indicator beside text
|
|
19
|
-
*
|
|
20
|
-
* @default "inactive"
|
|
21
|
-
*/
|
|
22
|
-
readonly status: StatusType;
|
|
23
|
-
}
|
|
24
|
-
export declare function StatusLabel({ label, alignment, status, }: StatusLabelProps): JSX.Element;
|
|
25
|
-
export {};
|
|
1
|
+
export declare type StatusType = "success" | "warning" | "critical" | "inactive" | "informative";
|
|
2
|
+
export interface StatusLabelType {
|
|
3
|
+
readonly statusLabel: string;
|
|
4
|
+
readonly statusType?: StatusType;
|
|
5
|
+
}
|
|
6
|
+
interface StatusLabelProps {
|
|
7
|
+
/**
|
|
8
|
+
* Text to display
|
|
9
|
+
*/
|
|
10
|
+
readonly label: string;
|
|
11
|
+
/**
|
|
12
|
+
* Alignment of label
|
|
13
|
+
*
|
|
14
|
+
* @default "start"
|
|
15
|
+
*/
|
|
16
|
+
readonly alignment?: "start" | "end";
|
|
17
|
+
/**
|
|
18
|
+
* Status color of the indicator beside text
|
|
19
|
+
*
|
|
20
|
+
* @default "inactive"
|
|
21
|
+
*/
|
|
22
|
+
readonly status: StatusType;
|
|
23
|
+
}
|
|
24
|
+
export declare function StatusLabel({ label, alignment, status, }: StatusLabelProps): JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { StatusLabel } from "./StatusLabel";
|
|
1
|
+
export { StatusLabel } from "./StatusLabel";
|
|
@@ -2,30 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
6
|
-
|
|
7
|
-
require('../chunk-b67af3cb.js');
|
|
8
5
|
var React = require('react');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
require('../Typography
|
|
13
|
-
|
|
6
|
+
var classnames = require('classnames');
|
|
7
|
+
var styleInject_es = require('../style-inject.es-dcee06b6.js');
|
|
8
|
+
var Text = require('../Text-9bc093e9.js');
|
|
9
|
+
require('../Typography-7e542a72.js');
|
|
10
|
+
require('../tslib.es6-5b50eb8e.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
14
16
|
|
|
15
17
|
var css = ":root {\n --statusLabel-icon-diameter: calc(var(--space-base) - var(--space-smaller));\n}\n\n.NUUO4mR41Qn5Pf0pzjhZe {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n grid-gap: var(--space-small);\n grid-gap: var(--space-small);\n gap: var(--space-small);\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n._2XU8xQD0q92o9P2Ej5EdwP {\n width: calc(var(--space-base) - var(--space-smaller));\n width: calc(var(--space-base) - var(--space-smaller));\n width: var(--statusLabel-icon-diameter);\n height: calc(var(--space-base) - var(--space-smaller));\n height: calc(var(--space-base) - var(--space-smaller));\n height: var(--statusLabel-icon-diameter);\n margin-top: var(--space-smallest);\n border-radius: var(--radius-base);\n background-color: var(--color-success);\n -ms-flex-negative: 0;\n flex-shrink: 0;\n}\n\n._3eQHL9hZlneMfEoGaF0dDv {\n -ms-flex-direction: row-reverse;\n flex-direction: row-reverse;\n}\n";
|
|
16
18
|
var styles = {"statusLabelRow":"NUUO4mR41Qn5Pf0pzjhZe","statusIndicator":"_2XU8xQD0q92o9P2Ej5EdwP","labelTextEndAligned":"_3eQHL9hZlneMfEoGaF0dDv"};
|
|
17
|
-
|
|
19
|
+
styleInject_es.styleInject(css);
|
|
18
20
|
|
|
19
|
-
function StatusLabel(_a) {
|
|
20
|
-
var label = _a.label, _b = _a.alignment, alignment = _b === void 0 ? "start" : _b, _c = _a.status, status = _c === void 0 ? "inactive" : _c;
|
|
21
|
-
var containerClassNames =
|
|
22
|
-
return (React__default.createElement("div", { role: "status", className: containerClassNames },
|
|
23
|
-
React__default.createElement(StatusLabelIcon, { status: status }),
|
|
24
|
-
React__default.createElement(
|
|
25
|
-
}
|
|
26
|
-
function StatusLabelIcon(_a) {
|
|
27
|
-
var status = _a.status;
|
|
28
|
-
return (React__default.createElement("div", { style: { backgroundColor: "var(--color-" + status }, className: styles.statusIndicator }));
|
|
21
|
+
function StatusLabel(_a) {
|
|
22
|
+
var label = _a.label, _b = _a.alignment, alignment = _b === void 0 ? "start" : _b, _c = _a.status, status = _c === void 0 ? "inactive" : _c;
|
|
23
|
+
var containerClassNames = classnames__default["default"](styles.statusLabelRow, alignment === "end" && styles.labelTextEndAligned);
|
|
24
|
+
return (React__default["default"].createElement("div", { role: "status", className: containerClassNames },
|
|
25
|
+
React__default["default"].createElement(StatusLabelIcon, { status: status }),
|
|
26
|
+
React__default["default"].createElement(Text.Text, { size: "small", align: alignment }, label)));
|
|
27
|
+
}
|
|
28
|
+
function StatusLabelIcon(_a) {
|
|
29
|
+
var status = _a.status;
|
|
30
|
+
return (React__default["default"].createElement("div", { style: { backgroundColor: "var(--color-" + status }, className: styles.statusIndicator }));
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
exports.StatusLabel = StatusLabel;
|
package/dist/Switch/Switch.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
interface SwitchProps {
|
|
2
|
-
readonly value?: boolean;
|
|
3
|
-
/**
|
|
4
|
-
* Adds a name for the hidden input and an ID so a label can be used to
|
|
5
|
-
* describe the switch instead of an aria-label. This prevents screen readers
|
|
6
|
-
* from reading the label twice
|
|
7
|
-
*/
|
|
8
|
-
readonly name?: string;
|
|
9
|
-
readonly ariaLabel?: string;
|
|
10
|
-
readonly disabled?: boolean;
|
|
11
|
-
onChange?(newValue: boolean): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function Switch({ value: providedValue, ariaLabel, name, disabled, onChange, }: SwitchProps): JSX.Element;
|
|
14
|
-
export {};
|
|
1
|
+
interface SwitchProps {
|
|
2
|
+
readonly value?: boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Adds a name for the hidden input and an ID so a label can be used to
|
|
5
|
+
* describe the switch instead of an aria-label. This prevents screen readers
|
|
6
|
+
* from reading the label twice
|
|
7
|
+
*/
|
|
8
|
+
readonly name?: string;
|
|
9
|
+
readonly ariaLabel?: string;
|
|
10
|
+
readonly disabled?: boolean;
|
|
11
|
+
onChange?(newValue: boolean): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function Switch({ value: providedValue, ariaLabel, name, disabled, onChange, }: SwitchProps): JSX.Element;
|
|
14
|
+
export {};
|
package/dist/Switch/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Switch } from "./Switch";
|
|
1
|
+
export { Switch } from "./Switch";
|
package/dist/Switch/index.js
CHANGED
|
@@ -2,59 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var Switch = require('../Switch-d2bec677.js');
|
|
6
|
+
require('../tslib.es6-5b50eb8e.js');
|
|
7
|
+
require('react');
|
|
8
|
+
require('classnames');
|
|
9
|
+
require('../style-inject.es-dcee06b6.js');
|
|
10
|
+
require('../Typography-7e542a72.js');
|
|
6
11
|
|
|
7
|
-
var __chunk_1 = require('../chunk-b67af3cb.js');
|
|
8
|
-
var React = require('react');
|
|
9
|
-
var React__default = _interopDefault(React);
|
|
10
|
-
var __chunk_2 = require('../chunk-17e02351.js');
|
|
11
|
-
var classnames = _interopDefault(require('classnames'));
|
|
12
|
-
var index = require('../Typography/index.js');
|
|
13
12
|
|
|
14
|
-
var css = ":root {\n --switch--pipSize: calc(var(--space-base) * 1.875);\n --switch--labelWidth: calc(var(--switch--pipSize) * 1.3);\n --switch--borderOffset: calc(var(--border-base) * 2);\n}\n\n._1TYiN0KipS0HguS_tKWfjN,\n._1TYiN0KipS0HguS_tKWfjN * {\n box-sizing: border-box;\n transition: all var(--timing-base);\n}\n\n._1TYiN0KipS0HguS_tKWfjN {\n display: -ms-inline-flexbox;\n display: inline-flex;\n width: calc(calc(calc(var(--space-base) * 1.875) * 1.3) + calc(var(--space-base) * 1.875));\n width: calc(calc(calc(var(--space-base) * 1.875) * 1.3) + calc(var(--space-base) * 1.875));\n width: calc(var(--switch--labelWidth) + var(--switch--pipSize));\n padding: 0;\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(var(--space-base) * 1.875);\n border-radius: calc(var(--space-base) * 1.875);\n border-radius: var(--switch--pipSize);\n overflow: hidden;\n line-height: normal;\n background-color: var(--color-surface--background);\n cursor: pointer;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n._1TYiN0KipS0HguS_tKWfjN:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n\n._2FTUgoy1jHHC6Zp3jZiFem {\n border-color: var(--color-interactive);\n background-color: var(--color-interactive);\n}\n\n._17OASjesGo_G7ojFH6iMvI {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n margin-left: calc(-1 * calc(calc(var(--space-base) * 1.875) * 1.3));\n margin-left: calc(-1 * calc(calc(var(--space-base) * 1.875) * 1.3));\n margin-left: calc(-1 * var(--switch--labelWidth));\n pointer-events: none;\n -ms-flex: 1 1 100%;\n flex: 1 1 100%;\n -ms-flex-align: center;\n align-items: center;\n}\n\n._2FTUgoy1jHHC6Zp3jZiFem ._17OASjesGo_G7ojFH6iMvI {\n margin-left: calc(-1 * calc(var(--border-base) * 2));\n margin-left: calc(-1 * calc(var(--border-base) * 2));\n margin-left: calc(-1 * var(--switch--borderOffset));\n}\n\n._2QoMYBKIeOc4fkTMpeJ-0Y {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n min-width: calc(calc(var(--space-base) * 1.875) * 1.3);\n min-width: calc(calc(var(--space-base) * 1.875) * 1.3);\n min-width: var(--switch--labelWidth);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n pointer-events: none;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n._2QoMYBKIeOc4fkTMpeJ-0Y:first-of-type {\n padding-left: var(--space-small);\n}\n\n._2QoMYBKIeOc4fkTMpeJ-0Y:last-of-type {\n padding-right: var(--space-small);\n}\n\n.JsY6cDqLe8d_25vumz97W {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: calc(var(--space-base) * 1.875);\n width: calc(var(--space-base) * 1.875);\n width: var(--switch--pipSize);\n height: calc(var(--space-base) * 1.875);\n height: calc(var(--space-base) * 1.875);\n height: var(--switch--pipSize);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-circle);\n background-color: var(--color-surface);\n}\n\n._2FTUgoy1jHHC6Zp3jZiFem .JsY6cDqLe8d_25vumz97W {\n border-color: var(--color-green);\n}\n\n._3uDSBuknYCWotuDOq6jYUD {\n border-color: var(--color-disabled--secondary);\n background-color: var(--color-surface--background);\n cursor: not-allowed;\n}\n\n._3uDSBuknYCWotuDOq6jYUD .JsY6cDqLe8d_25vumz97W {\n border-color: var(--color-disabled--secondary);\n}\n";
|
|
15
|
-
var styles = {"track":"_1TYiN0KipS0HguS_tKWfjN","isChecked":"_2FTUgoy1jHHC6Zp3jZiFem","toggle":"_17OASjesGo_G7ojFH6iMvI","label":"_2QoMYBKIeOc4fkTMpeJ-0Y","pip":"JsY6cDqLe8d_25vumz97W","disabled":"_3uDSBuknYCWotuDOq6jYUD"};
|
|
16
|
-
__chunk_2.styleInject(css);
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
var _b;
|
|
20
|
-
var providedValue = _a.value, ariaLabel = _a.ariaLabel, name = _a.name, disabled = _a.disabled, onChange = _a.onChange;
|
|
21
|
-
var _c = __chunk_1.__read(React.useState(false), 2), statefulValue = _c[0], setValue = _c[1];
|
|
22
|
-
var value = providedValue != undefined ? providedValue : statefulValue;
|
|
23
|
-
var toggleSwitch = function () {
|
|
24
|
-
if (disabled) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
var newValue = !value;
|
|
28
|
-
onChange && onChange(newValue);
|
|
29
|
-
if (providedValue == undefined) {
|
|
30
|
-
setValue(newValue);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var className = classnames(styles.track, (_b = {},
|
|
34
|
-
_b[styles.isChecked] = value,
|
|
35
|
-
_b[styles.disabled] = disabled,
|
|
36
|
-
_b));
|
|
37
|
-
return (React__default.createElement(React__default.Fragment, null,
|
|
38
|
-
React__default.createElement("button", { id: name, type: "button", role: "switch", "aria-checked": value, "aria-label": ariaLabel, className: className, onClick: toggleSwitch, disabled: disabled },
|
|
39
|
-
React__default.createElement("span", { className: styles.toggle },
|
|
40
|
-
React__default.createElement(Label, { as: "On", disabled: disabled }),
|
|
41
|
-
React__default.createElement("span", { className: styles.pip }),
|
|
42
|
-
React__default.createElement(Label, { as: "Off", disabled: disabled }))),
|
|
43
|
-
React__default.createElement("input", { name: name, type: "hidden", value: String(value) })));
|
|
44
|
-
}
|
|
45
|
-
function Label(_a) {
|
|
46
|
-
var as = _a.as, disabled = _a.disabled;
|
|
47
|
-
var getTextColor = function () {
|
|
48
|
-
if (disabled) {
|
|
49
|
-
return "grey";
|
|
50
|
-
}
|
|
51
|
-
else if (as === "On") {
|
|
52
|
-
return "white";
|
|
53
|
-
}
|
|
54
|
-
return "greyBlue";
|
|
55
|
-
};
|
|
56
|
-
return (React__default.createElement("span", { className: styles.label },
|
|
57
|
-
React__default.createElement(index.Typography, { element: "span", textColor: getTextColor(), size: "small", fontWeight: "bold", textCase: "uppercase" }, as)));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
exports.Switch = Switch;
|
|
14
|
+
exports.Switch = Switch.Switch;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('./tslib.es6-5b50eb8e.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var styleInject_es = require('./style-inject.es-dcee06b6.js');
|
|
7
|
+
var Typography = require('./Typography-7e542a72.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 = ":root {\n --switch--pipSize: calc(var(--space-base) * 1.875);\n --switch--labelWidth: calc(var(--switch--pipSize) * 1.3);\n --switch--borderOffset: calc(var(--border-base) * 2);\n}\n\n._1TYiN0KipS0HguS_tKWfjN,\n._1TYiN0KipS0HguS_tKWfjN * {\n box-sizing: border-box;\n transition: all var(--timing-base);\n}\n\n._1TYiN0KipS0HguS_tKWfjN {\n display: -ms-inline-flexbox;\n display: inline-flex;\n width: calc(calc(calc(var(--space-base) * 1.875) * 1.3) + calc(var(--space-base) * 1.875));\n width: calc(calc(calc(var(--space-base) * 1.875) * 1.3) + calc(var(--space-base) * 1.875));\n width: calc(var(--switch--labelWidth) + var(--switch--pipSize));\n padding: 0;\n border: var(--border-base) solid var(--color-border);\n border-radius: calc(var(--space-base) * 1.875);\n border-radius: calc(var(--space-base) * 1.875);\n border-radius: var(--switch--pipSize);\n overflow: hidden;\n line-height: normal;\n background-color: var(--color-surface--background);\n cursor: pointer;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n._1TYiN0KipS0HguS_tKWfjN:focus {\n box-shadow: var(--shadow-focus);\n outline: none;\n}\n\n._2FTUgoy1jHHC6Zp3jZiFem {\n border-color: var(--color-interactive);\n background-color: var(--color-interactive);\n}\n\n._17OASjesGo_G7ojFH6iMvI {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n margin-left: calc(-1 * calc(calc(var(--space-base) * 1.875) * 1.3));\n margin-left: calc(-1 * calc(calc(var(--space-base) * 1.875) * 1.3));\n margin-left: calc(-1 * var(--switch--labelWidth));\n pointer-events: none;\n -ms-flex: 1 1 100%;\n flex: 1 1 100%;\n -ms-flex-align: center;\n align-items: center;\n}\n\n._2FTUgoy1jHHC6Zp3jZiFem ._17OASjesGo_G7ojFH6iMvI {\n margin-left: calc(-1 * calc(var(--border-base) * 2));\n margin-left: calc(-1 * calc(var(--border-base) * 2));\n margin-left: calc(-1 * var(--switch--borderOffset));\n}\n\n._2QoMYBKIeOc4fkTMpeJ-0Y {\n display: -ms-flexbox;\n display: flex;\n position: relative;\n min-width: calc(calc(var(--space-base) * 1.875) * 1.3);\n min-width: calc(calc(var(--space-base) * 1.875) * 1.3);\n min-width: var(--switch--labelWidth);\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n pointer-events: none;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n._2QoMYBKIeOc4fkTMpeJ-0Y:first-of-type {\n padding-left: var(--space-small);\n}\n\n._2QoMYBKIeOc4fkTMpeJ-0Y:last-of-type {\n padding-right: var(--space-small);\n}\n\n.JsY6cDqLe8d_25vumz97W {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: calc(var(--space-base) * 1.875);\n width: calc(var(--space-base) * 1.875);\n width: var(--switch--pipSize);\n height: calc(var(--space-base) * 1.875);\n height: calc(var(--space-base) * 1.875);\n height: var(--switch--pipSize);\n border: var(--border-base) solid var(--color-border);\n border-radius: var(--radius-circle);\n background-color: var(--color-surface);\n}\n\n._2FTUgoy1jHHC6Zp3jZiFem .JsY6cDqLe8d_25vumz97W {\n border-color: var(--color-green);\n}\n\n._3uDSBuknYCWotuDOq6jYUD {\n border-color: var(--color-disabled--secondary);\n background-color: var(--color-surface--background);\n cursor: not-allowed;\n}\n\n._3uDSBuknYCWotuDOq6jYUD .JsY6cDqLe8d_25vumz97W {\n border-color: var(--color-disabled--secondary);\n}\n";
|
|
15
|
+
var styles = {"track":"_1TYiN0KipS0HguS_tKWfjN","isChecked":"_2FTUgoy1jHHC6Zp3jZiFem","toggle":"_17OASjesGo_G7ojFH6iMvI","label":"_2QoMYBKIeOc4fkTMpeJ-0Y","pip":"JsY6cDqLe8d_25vumz97W","disabled":"_3uDSBuknYCWotuDOq6jYUD"};
|
|
16
|
+
styleInject_es.styleInject(css);
|
|
17
|
+
|
|
18
|
+
function Switch(_a) {
|
|
19
|
+
var _b;
|
|
20
|
+
var providedValue = _a.value, ariaLabel = _a.ariaLabel, name = _a.name, disabled = _a.disabled, onChange = _a.onChange;
|
|
21
|
+
var _c = tslib_es6.__read(React.useState(false), 2), statefulValue = _c[0], setValue = _c[1];
|
|
22
|
+
var value = providedValue != undefined ? providedValue : statefulValue;
|
|
23
|
+
var toggleSwitch = function () {
|
|
24
|
+
if (disabled) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
var newValue = !value;
|
|
28
|
+
onChange && onChange(newValue);
|
|
29
|
+
if (providedValue == undefined) {
|
|
30
|
+
setValue(newValue);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var className = classnames__default["default"](styles.track, (_b = {},
|
|
34
|
+
_b[styles.isChecked] = value,
|
|
35
|
+
_b[styles.disabled] = disabled,
|
|
36
|
+
_b));
|
|
37
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
38
|
+
React__default["default"].createElement("button", { id: name, type: "button", role: "switch", "aria-checked": value, "aria-label": ariaLabel, className: className, onClick: toggleSwitch, disabled: disabled },
|
|
39
|
+
React__default["default"].createElement("span", { className: styles.toggle },
|
|
40
|
+
React__default["default"].createElement(Label, { as: "On", disabled: disabled }),
|
|
41
|
+
React__default["default"].createElement("span", { className: styles.pip }),
|
|
42
|
+
React__default["default"].createElement(Label, { as: "Off", disabled: disabled }))),
|
|
43
|
+
React__default["default"].createElement("input", { name: name, type: "hidden", value: String(value) })));
|
|
44
|
+
}
|
|
45
|
+
function Label(_a) {
|
|
46
|
+
var as = _a.as, disabled = _a.disabled;
|
|
47
|
+
var getTextColor = function () {
|
|
48
|
+
if (disabled) {
|
|
49
|
+
return "grey";
|
|
50
|
+
}
|
|
51
|
+
else if (as === "On") {
|
|
52
|
+
return "white";
|
|
53
|
+
}
|
|
54
|
+
return "greyBlue";
|
|
55
|
+
};
|
|
56
|
+
return (React__default["default"].createElement("span", { className: styles.label },
|
|
57
|
+
React__default["default"].createElement(Typography.Typography, { element: "span", textColor: getTextColor(), size: "small", fontWeight: "bold", textCase: "uppercase" }, as)));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports.Switch = Switch;
|