@sparrowengg/integrations-templates-frontend 1.9.63 → 1.9.65
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/cjs/_virtual/index10.js +2 -2
- package/dist/cjs/_virtual/index9.js +2 -2
- package/dist/cjs/node_modules/@internationalized/date/dist/utils.js +1 -2
- package/dist/cjs/node_modules/@internationalized/date/dist/utils.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +9 -3
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js +6 -8
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js +106 -99
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js +18 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js +113 -71
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js +31 -8
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js +19 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js +20 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js +5 -3
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js +43 -13
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js +18 -15
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js +60 -52
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js +90 -20
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js +138 -113
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +71 -13
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js +660 -88
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +68 -13
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js +11 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js +22 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js +25 -19
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +28 -6
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js +56 -54
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js +28 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +109 -20
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js +103 -66
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js +199 -110
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js +10 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +4 -4
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js +2 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js +2 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js +2 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js +4 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js +4 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +7 -5
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js +143 -25
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js +23 -18
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +2 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +112 -14
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +10 -2
- package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
- package/dist/cjs/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +1 -1
- package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/cjs/single-mapping/components/mapping.js +2 -2
- package/dist/cjs/single-mapping/components/mapping.js.map +1 -1
- package/dist/es/_virtual/index10.js +2 -2
- package/dist/es/_virtual/index9.js +2 -2
- package/dist/es/node_modules/@internationalized/date/dist/utils.js +1 -2
- package/dist/es/node_modules/@internationalized/date/dist/utils.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +9 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js +6 -8
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js +107 -100
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js +18 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js +113 -71
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js +31 -8
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js +19 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js +20 -4
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js +5 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js +43 -13
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js +19 -16
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js +60 -52
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js +90 -20
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js +134 -109
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +71 -13
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js +662 -90
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +66 -13
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js +12 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js +23 -3
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js +26 -20
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +28 -6
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js +56 -54
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js +28 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +110 -21
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js +105 -67
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js +199 -110
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js +10 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js +2 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js +2 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js +2 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js +4 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js +4 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +7 -5
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js +144 -26
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js +22 -19
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +2 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +110 -15
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +10 -2
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
- package/dist/es/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +1 -1
- package/dist/es/node_modules/style-to-js/cjs/index.js +1 -1
- package/dist/es/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/es/single-mapping/components/mapping.js +2 -2
- package/dist/es/single-mapping/components/mapping.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,28 +14,41 @@ const StyledSplitButtonContainer = stitches_config.styled(box.Box, {
|
|
|
14
14
|
alignItems: "center",
|
|
15
15
|
whiteSpace: "nowrap"
|
|
16
16
|
});
|
|
17
|
-
const StyledPrimaryButton = stitches_config.styled(box.Box, {
|
|
18
|
-
"button,a": {
|
|
19
|
-
borderEndEndRadius: 0,
|
|
20
|
-
borderStartEndRadius: 0
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
17
|
const StyledSecondaryButton = stitches_config.styled(box.Box, {
|
|
24
18
|
"button,a": {
|
|
25
19
|
borderEndStartRadius: 0,
|
|
26
|
-
borderStartStartRadius: 0
|
|
20
|
+
borderStartStartRadius: 0,
|
|
21
|
+
"&:not(:disabled):hover, &:active, &:focus": {
|
|
22
|
+
borderLeftColor: "transparent"
|
|
23
|
+
}
|
|
27
24
|
},
|
|
28
25
|
variants: {
|
|
29
26
|
color: {
|
|
30
27
|
primary: {
|
|
31
28
|
"button,a": {
|
|
32
|
-
borderLeft: "1.5px solid $
|
|
29
|
+
borderLeft: "1.5px solid $primary600"
|
|
33
30
|
}
|
|
34
31
|
},
|
|
35
32
|
secondary: {
|
|
36
33
|
"button,a": {
|
|
37
34
|
borderLeft: "1.5px solid $secondary600"
|
|
38
35
|
}
|
|
36
|
+
},
|
|
37
|
+
default: {
|
|
38
|
+
"button,a": {
|
|
39
|
+
borderLeft: "1.5px solid $secondary400",
|
|
40
|
+
borderColorOpacity: ["$secondary500", 0.2]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
light: {
|
|
44
|
+
"button,a": {
|
|
45
|
+
borderLeft: "1.5px solid $white300"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
error: {
|
|
49
|
+
"button,a": {
|
|
50
|
+
borderLeft: "1.5px solid $negative200"
|
|
51
|
+
}
|
|
39
52
|
}
|
|
40
53
|
},
|
|
41
54
|
size: {
|
|
@@ -77,6 +90,16 @@ const StyledSecondaryButton = stitches_config.styled(box.Box, {
|
|
|
77
90
|
}
|
|
78
91
|
}
|
|
79
92
|
});
|
|
93
|
+
const StyledPrimaryButton = stitches_config.styled(box.Box, {
|
|
94
|
+
"button,a": {
|
|
95
|
+
borderEndEndRadius: 0,
|
|
96
|
+
borderStartEndRadius: 0
|
|
97
|
+
},
|
|
98
|
+
[`&:has(button:not(:disabled):hover, button:active, button:focus) + ${StyledSecondaryButton} button,
|
|
99
|
+
&:has(a:not(:disabled):hover, a:active, a:focus) + ${StyledSecondaryButton} a`]: {
|
|
100
|
+
borderLeftColor: "transparent"
|
|
101
|
+
}
|
|
102
|
+
});
|
|
80
103
|
const ButtonContainer = ({ children }) => {
|
|
81
104
|
const { color, disabled, size } = React.useContext(splitButtonContext.SplitButtonContext);
|
|
82
105
|
if (React.isValidElement(children) && (children.type === button.Button || children.type === iconButton.IconButton)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-button.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport React__default, { forwardRef, Children, useContext, cloneElement } from 'react';\nimport { styled } from '../stitches.config.js';\nimport { Box } from '../box/box.js';\nimport { Button } from './button.js';\nimport { IconButton } from './icon-button.js';\nimport { SplitButtonContext } from './split-button-context.js';\n\nconst StyledSplitButtonContainer = styled(Box, {\n display: \"inline-flex\",\n position: \"relative\",\n alignItems: \"center\",\n whiteSpace: \"nowrap\"\n});\nconst
|
|
1
|
+
{"version":3,"file":"split-button.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport React__default, { forwardRef, Children, useContext, cloneElement } from 'react';\nimport { styled } from '../stitches.config.js';\nimport { Box } from '../box/box.js';\nimport { Button } from './button.js';\nimport { IconButton } from './icon-button.js';\nimport { SplitButtonContext } from './split-button-context.js';\n\nconst StyledSplitButtonContainer = styled(Box, {\n display: \"inline-flex\",\n position: \"relative\",\n alignItems: \"center\",\n whiteSpace: \"nowrap\"\n});\nconst StyledSecondaryButton = styled(Box, {\n \"button,a\": {\n borderEndStartRadius: 0,\n borderStartStartRadius: 0,\n \"&:not(:disabled):hover, &:active, &:focus\": {\n borderLeftColor: \"transparent\"\n }\n },\n variants: {\n color: {\n primary: {\n \"button,a\": {\n borderLeft: \"1.5px solid $primary600\"\n }\n },\n secondary: {\n \"button,a\": {\n borderLeft: \"1.5px solid $secondary600\"\n }\n },\n default: {\n \"button,a\": {\n borderLeft: \"1.5px solid $secondary400\",\n borderColorOpacity: [\"$secondary500\", 0.2]\n }\n },\n light: {\n \"button,a\": {\n borderLeft: \"1.5px solid $white300\"\n }\n },\n error: {\n \"button,a\": {\n borderLeft: \"1.5px solid $negative200\"\n }\n }\n },\n size: {\n xxs: {\n \"button,a\": {\n borderLeftWidth: \".8px\"\n }\n },\n xs: {\n \"button,a\": {\n borderLeftWidth: \".8px\"\n }\n },\n sm: {\n \"button,a\": {\n borderLeftWidth: \"1px\"\n }\n },\n md: {\n \"button,a\": {\n borderLeftWidth: \"1px\"\n }\n },\n lg: {\n \"button,a\": {\n borderLeftWidth: \"1.2px\"\n }\n },\n xl: {\n \"button,a\": {\n borderLeftWidth: \"1.5px\"\n }\n },\n \"2xl\": {\n \"button,a\": {\n borderLeftWidth: \"1.5px\"\n }\n }\n }\n }\n});\nconst StyledPrimaryButton = styled(Box, {\n \"button,a\": {\n borderEndEndRadius: 0,\n borderStartEndRadius: 0\n },\n [`&:has(button:not(:disabled):hover, button:active, button:focus) + ${StyledSecondaryButton} button,\n &:has(a:not(:disabled):hover, a:active, a:focus) + ${StyledSecondaryButton} a`]: {\n borderLeftColor: \"transparent\"\n }\n});\nconst ButtonContainer = ({ children }) => {\n const { color, disabled, size } = useContext(SplitButtonContext);\n if (React__default.isValidElement(children) && (children.type === Button || children.type === IconButton)) {\n return cloneElement(children, {\n color,\n disabled,\n size\n });\n }\n return /* @__PURE__ */ jsx(Fragment, { children });\n};\nconst SplitButtonContainer = forwardRef(({ children }, ref) => /* @__PURE__ */ jsx(StyledSplitButtonContainer, { ref, children }));\nconst SplitButton = forwardRef(\n ({\n children,\n disabled = false,\n color = \"primary\",\n size = \"md\"\n }, ref) => {\n if (Children.count(children) !== 2) {\n throw new Error(\"SplitButton component requires exactly two children\");\n }\n const [PrimaryAction, SecondaryAction] = Children.toArray(children);\n return /* @__PURE__ */ jsx(SplitButtonContext.Provider, { value: { color, disabled, size }, children: /* @__PURE__ */ jsxs(SplitButtonContainer, { ref, children: [\n /* @__PURE__ */ jsx(StyledPrimaryButton, { children: /* @__PURE__ */ jsx(ButtonContainer, { children: PrimaryAction }) }),\n /* @__PURE__ */ jsx(StyledSecondaryButton, { color, size, children: /* @__PURE__ */ jsx(ButtonContainer, { children: SecondaryAction }) })\n ] }) });\n }\n);\n\nexport { SplitButton, SplitButtonContainer };\n//# sourceMappingURL=split-button.js.map\n"],"names":["styled","Box","useContext","SplitButtonContext","React__default","Button","IconButton","cloneElement","jsx","Fragment","forwardRef","Children","jsxs"],"mappings":";;;;;;;;;;AAQA,MAAM,0BAA0B,GAAGA,sBAAM,CAACC,OAAG,EAAE;AAC/C,EAAE,OAAO,EAAE,aAAa;AACxB,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,UAAU,EAAE,QAAQ;AACtB,EAAE,UAAU,EAAE,QAAQ;AACtB,CAAC,CAAC,CAAC;AACH,MAAM,qBAAqB,GAAGD,sBAAM,CAACC,OAAG,EAAE;AAC1C,EAAE,UAAU,EAAE;AACd,IAAI,oBAAoB,EAAE,CAAC;AAC3B,IAAI,sBAAsB,EAAE,CAAC;AA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-72,7 +74,10 @@ const buttonVariantToLoaderVariantMapping = {
|
|
|
72
74
|
light: "bright",
|
|
73
75
|
error: "negative"
|
|
74
76
|
};
|
|
75
|
-
const getLoaderVariantFromButtonVariant = ({
|
|
77
|
+
const getLoaderVariantFromButtonVariant = ({
|
|
78
|
+
color,
|
|
79
|
+
variant
|
|
80
|
+
}) => {
|
|
76
81
|
const colorString = color;
|
|
77
82
|
const variantString = variant;
|
|
78
83
|
if (buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`]) {
|
|
@@ -80,7 +85,20 @@ const getLoaderVariantFromButtonVariant = ({ color, variant }) => {
|
|
|
80
85
|
}
|
|
81
86
|
return buttonVariantToLoaderVariantMapping[colorString];
|
|
82
87
|
};
|
|
88
|
+
const BUTTON_CLASSNAMES = {
|
|
89
|
+
button: prefixClassName.prefixClassName("button"),
|
|
90
|
+
iconContainer: prefixClassName.prefixClassName("button__icon-container"),
|
|
91
|
+
iconBox: prefixClassName.prefixClassName("button__icon-box"),
|
|
92
|
+
loader: prefixClassName.prefixClassName("button__loader"),
|
|
93
|
+
content: prefixClassName.prefixClassName("button__content"),
|
|
94
|
+
loading: prefixClassName.prefixClassName("button--loading"),
|
|
95
|
+
disabled: prefixClassName.prefixClassName("button--disabled"),
|
|
96
|
+
sideElement: prefixClassName.prefixClassName("button__side-element"),
|
|
97
|
+
sideElementLoaderHidden: prefixClassName.prefixClassName("button__side-element--loader-hidden"),
|
|
98
|
+
sideElementIconHidden: prefixClassName.prefixClassName("button__side-element--icon-hidden")
|
|
99
|
+
};
|
|
83
100
|
|
|
101
|
+
exports.BUTTON_CLASSNAMES = BUTTON_CLASSNAMES;
|
|
84
102
|
exports.buttonVariantToLoaderVariantMapping = buttonVariantToLoaderVariantMapping;
|
|
85
103
|
exports.getLoaderIconSizeFromButtonProps = getLoaderIconSizeFromButtonProps;
|
|
86
104
|
exports.getLoaderVariantFromButtonVariant = getLoaderVariantFromButtonVariant;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js"],"sourcesContent":["import { prefixClassName } from '../utils/prefix-class-name.js';\n\nconst buttonSizeToLineLoaderSizeMapping = {\n \"2xl\": {\n size: \"lg\"\n },\n xl: {\n size: \"md\",\n width: \"$5\"\n },\n lg: {\n size: \"sm\",\n width: \"$5\"\n },\n md: {\n size: \"sm\",\n width: \"$4\"\n },\n sm: {\n size: \"sm\",\n width: \"$4\"\n },\n xs: {\n size: \"sm\",\n width: \"$3\"\n },\n xxs: {\n size: \"sm\",\n width: \"$3\"\n }\n};\nconst buttonSizeToCircleLoaderSizeMapping = {\n \"2xl\": {\n size: \"lg\"\n },\n xl: {\n size: \"lg\"\n },\n lg: {\n size: \"lg\"\n },\n md: {\n size: \"md\"\n },\n sm: {\n size: \"sm\"\n },\n xs: {\n size: \"xs\"\n },\n xxs: {\n size: \"xs\"\n }\n};\nconst getLoaderIconSizeFromButtonProps = ({\n buttonSize,\n loaderType\n}) => {\n if (loaderType === \"circle\") {\n return buttonSizeToCircleLoaderSizeMapping[typeof buttonSize === \"string\" ? buttonSize : \"lg\"];\n }\n return buttonSizeToLineLoaderSizeMapping[typeof buttonSize === \"string\" ? buttonSize : \"lg\"];\n};\nconst buttonVariantToLoaderVariantMapping = {\n default: \"secondary\",\n bright: \"secondary\",\n primary: \"primary\",\n \"primary-solid\": \"bright\",\n secondary: \"bright\",\n \"secondary-outline\": \"secondary\",\n \"secondary-ghost\": \"secondary\",\n light: \"bright\",\n error: \"negative\"\n};\nconst getLoaderVariantFromButtonVariant = ({\n color,\n variant\n}) => {\n const colorString = color;\n const variantString = variant;\n if (buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`]) {\n return buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`];\n }\n return buttonVariantToLoaderVariantMapping[colorString];\n};\nconst BUTTON_CLASSNAMES = {\n button: prefixClassName(\"button\"),\n iconContainer: prefixClassName(\"button__icon-container\"),\n iconBox: prefixClassName(\"button__icon-box\"),\n loader: prefixClassName(\"button__loader\"),\n content: prefixClassName(\"button__content\"),\n loading: prefixClassName(\"button--loading\"),\n disabled: prefixClassName(\"button--disabled\"),\n sideElement: prefixClassName(\"button__side-element\"),\n sideElementLoaderHidden: prefixClassName(\"button__side-element--loader-hidden\"),\n sideElementIconHidden: prefixClassName(\"button__side-element--icon-hidden\")\n};\n\nexport { BUTTON_CLASSNAMES, buttonVariantToLoaderVariantMapping, getLoaderIconSizeFromButtonProps, getLoaderVariantFromButtonVariant };\n//# sourceMappingURL=utils.js.map\n"],"names":["prefixClassName"],"mappings":";;;;AAEA,MAAM,iCAAiC,GAAG;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,CAAC,CAAC;AACF,MAAM,mCAAmC,GAAG;AAC5C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,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CAAC;AAChC,EAAE,IAAI,mCAAmC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE;AAC9E,IAAI,OAAO,mCAAmC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;AAClF,GAAG;AACH,EAAE,OAAO,mCAAmC,CAAC,WAAW,CAAC,CAAC;AAC1D,EAAE;AACG,MAAC,iBAAiB,GAAG;AAC1B,EAAE,MAAM,EAAEA,+BAAe,CAAC,QAAQ,CAAC;AACnC,EAAE,aAAa,EAAEA,+BAAe,CAAC,wBAAwB,CAAC;AAC1D,EAAE,OAAO,EAAEA,+BAAe,CAAC,kBAAkB,CAAC;AAC9C,EAAE,MAAM,EAAEA,+BAAe,CAAC,gBAAgB,CAAC;AAC3C,EAAE,OAAO,EAAEA,+BAAe,CAAC,iBAAiB,CAAC;AAC7C,EAAE,OAAO,EAAEA,+BAAe,CAAC,iBAAiB,CAAC;AAC7C,EAAE,QAAQ,EAAEA,+BAAe,CAAC,kBAAkB,CAAC;AAC/C,EAAE,WAAW,EAAEA,+BAAe,CAAC,sBAAsB,CAAC;AACtD,EAAE,uBAAuB,EAAEA,+BAAe,CAAC,qCAAqC,CAAC;AACjF,EAAE,qBAAqB,EAAEA,+BAAe,CAAC,mCAAmC,CAAC;AAC7E;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -26,14 +26,23 @@ var __spreadValues = (a, b) => {
|
|
|
26
26
|
return a;
|
|
27
27
|
};
|
|
28
28
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
29
|
-
const CalendarCell = ({
|
|
29
|
+
const CalendarCell = ({
|
|
30
|
+
state,
|
|
31
|
+
date,
|
|
32
|
+
currentMonth,
|
|
33
|
+
onDaySelect
|
|
34
|
+
}) => {
|
|
30
35
|
const ref = React.useRef(null);
|
|
31
36
|
const {
|
|
32
37
|
cellProps,
|
|
33
38
|
buttonProps,
|
|
34
39
|
isSelected,
|
|
35
40
|
formattedDate
|
|
36
|
-
} = _import.useCalendarCell(
|
|
41
|
+
} = _import.useCalendarCell(
|
|
42
|
+
{ date },
|
|
43
|
+
state,
|
|
44
|
+
ref
|
|
45
|
+
);
|
|
37
46
|
const calendarContext = calendarUtils.useCalendarContext();
|
|
38
47
|
const isOutsideMonth = !_import$1.isSameMonth(currentMonth, date);
|
|
39
48
|
let isSelectionStart = false;
|
|
@@ -47,8 +56,8 @@ const CalendarCell = ({ state, date, currentMonth }) => {
|
|
|
47
56
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
57
|
calendarDay.DayContainer,
|
|
49
58
|
__spreadProps(__spreadValues({}, cellProps), {
|
|
50
|
-
"data-selection-start": isSelectionStart,
|
|
51
|
-
"data-selection-end": isSelectionEnd,
|
|
59
|
+
"data-selection-start": isSelectionStart && !isOutsideMonth,
|
|
60
|
+
"data-selection-end": isSelectionEnd && !isOutsideMonth,
|
|
52
61
|
"data-in-range": isRangeCalendar && isSelected,
|
|
53
62
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
63
|
calendarDay.Day,
|
|
@@ -57,6 +66,13 @@ const CalendarCell = ({ state, date, currentMonth }) => {
|
|
|
57
66
|
isHidden: isOutsideMonth,
|
|
58
67
|
isSelected,
|
|
59
68
|
size: calendarContext.size,
|
|
69
|
+
onClick: (e) => {
|
|
70
|
+
var _a;
|
|
71
|
+
(_a = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);
|
|
72
|
+
if (onDaySelect) {
|
|
73
|
+
onDaySelect(date);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
60
76
|
children: formattedDate
|
|
61
77
|
})
|
|
62
78
|
)
|
package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-cell.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { isSameMonth as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, isSameDay as $14e0f24ef4ac5c92$export$ea39ec197993aef0 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useRef } from 'react';\nimport { DayContainer, Day } from './calendar-day.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarCell as $36a0ac60f04457c5$export$136073280381448e } from '../node_modules/@react-aria/calendar/dist/import.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarCell = ({
|
|
1
|
+
{"version":3,"file":"calendar-cell.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { isSameMonth as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, isSameDay as $14e0f24ef4ac5c92$export$ea39ec197993aef0 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useRef } from 'react';\nimport { DayContainer, Day } from './calendar-day.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarCell as $36a0ac60f04457c5$export$136073280381448e } from '../node_modules/@react-aria/calendar/dist/import.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarCell = ({\n state,\n date,\n currentMonth,\n onDaySelect\n}) => {\n const ref = useRef(null);\n const {\n cellProps,\n buttonProps,\n isSelected,\n formattedDate\n } = $36a0ac60f04457c5$export$136073280381448e(\n { date },\n state,\n ref\n );\n const calendarContext = useCalendarContext();\n const isOutsideMonth = !$14e0f24ef4ac5c92$export$a18c89cbd24170ff(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n let isRangeCalendar = false;\n if (\"highlightedRange\" in state && state.highlightedRange) {\n isSelectionStart = $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, state.highlightedRange.start);\n isSelectionEnd = $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, state.highlightedRange.end);\n isRangeCalendar = true;\n }\n return /* @__PURE__ */ jsx(\n DayContainer,\n __spreadProps(__spreadValues({}, cellProps), {\n \"data-selection-start\": isSelectionStart && !isOutsideMonth,\n \"data-selection-end\": isSelectionEnd && !isOutsideMonth,\n \"data-in-range\": isRangeCalendar && isSelected,\n children: /* @__PURE__ */ jsx(\n Day,\n __spreadProps(__spreadValues({}, buttonProps), {\n ref,\n isHidden: isOutsideMonth,\n isSelected,\n size: calendarContext.size,\n onClick: (e) => {\n var _a;\n (_a = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);\n if (onDaySelect) {\n onDaySelect(date);\n }\n },\n children: formattedDate\n })\n )\n })\n );\n};\n\nexport { CalendarCell };\n//# sourceMappingURL=calendar-cell.js.map\n"],"names":["useRef","$36a0ac60f04457c5$export$136073280381448e","useCalendarContext","$14e0f24ef4ac5c92$export$a18c89cbd24170ff","$14e0f24ef4ac5c92$export$ea39ec197993aef0","jsx","DayContainer","Day"],"mappings":";;;;;;;;;AAOA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAA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
const CalendarGrid = ({
|
|
35
35
|
state,
|
|
36
36
|
offset = {},
|
|
37
|
-
containerCSS = {}
|
|
37
|
+
containerCSS = {},
|
|
38
|
+
onDaySelect
|
|
38
39
|
}) => {
|
|
39
40
|
const { locale } = realModule.useLocale();
|
|
40
41
|
const id = React.useId();
|
|
@@ -49,7 +50,7 @@ const CalendarGrid = ({
|
|
|
49
50
|
},
|
|
50
51
|
state
|
|
51
52
|
);
|
|
52
|
-
const weeksInMonth = _import.getWeeksInMonth(
|
|
53
|
+
const weeksInMonth = _import.getWeeksInMonth(startDate, locale);
|
|
53
54
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
54
55
|
calendarCommons.GridContainer,
|
|
55
56
|
__spreadProps(__spreadValues({
|
|
@@ -76,7 +77,8 @@ const CalendarGrid = ({
|
|
|
76
77
|
{
|
|
77
78
|
state,
|
|
78
79
|
date,
|
|
79
|
-
currentMonth: startDate
|
|
80
|
+
currentMonth: startDate,
|
|
81
|
+
onDaySelect
|
|
80
82
|
},
|
|
81
83
|
`twigs-calendar-cell-${date}-${id}`
|
|
82
84
|
) : null) }, `weekIndex-${startDate}-${id}-${index}`)
|
package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-grid.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { endOfMonth as $14e0f24ef4ac5c92$export$a2258d9c4118825c, getWeeksInMonth as $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useId } from 'react';\nimport { Box } from '../box/box.js';\nimport { CalendarCell } from './calendar-cell.js';\nimport { DaysContainer } from './calendar-day.js';\nimport { WeekContainer, Week } from './calendar-week.js';\nimport { GridContainer } from './calendar-commons.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarGrid as $e3031d1f8c9d64eb$export$cb95147730a423f5 } from '../node_modules/@react-aria/calendar/dist/import.js';\nimport { useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarGrid = ({\n state,\n offset = {},\n containerCSS = {}\n}) => {\n const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();\n const id = useId();\n const calendarContext = useCalendarContext();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = $14e0f24ef4ac5c92$export$a2258d9c4118825c(startDate);\n const { gridProps, headerProps, weekDays } = $e3031d1f8c9d64eb$export$cb95147730a423f5(\n {\n startDate,\n endDate,\n weekdayStyle: \"short\"\n },\n state\n );\n const weeksInMonth = $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(
|
|
1
|
+
{"version":3,"file":"calendar-grid.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { endOfMonth as $14e0f24ef4ac5c92$export$a2258d9c4118825c, getWeeksInMonth as $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useId } from 'react';\nimport { Box } from '../box/box.js';\nimport { CalendarCell } from './calendar-cell.js';\nimport { DaysContainer } from './calendar-day.js';\nimport { WeekContainer, Week } from './calendar-week.js';\nimport { GridContainer } from './calendar-commons.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarGrid as $e3031d1f8c9d64eb$export$cb95147730a423f5 } from '../node_modules/@react-aria/calendar/dist/import.js';\nimport { useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarGrid = ({\n state,\n offset = {},\n containerCSS = {},\n onDaySelect\n}) => {\n const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();\n const id = useId();\n const calendarContext = useCalendarContext();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = $14e0f24ef4ac5c92$export$a2258d9c4118825c(startDate);\n const { gridProps, headerProps, weekDays } = $e3031d1f8c9d64eb$export$cb95147730a423f5(\n {\n startDate,\n endDate,\n weekdayStyle: \"short\"\n },\n state\n );\n const weeksInMonth = $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(startDate, locale);\n return /* @__PURE__ */ jsxs(\n GridContainer,\n __spreadProps(__spreadValues({\n calendarSize: calendarContext.size\n }, gridProps), {\n css: containerCSS,\n children: [\n /* @__PURE__ */ jsx(WeekContainer, __spreadProps(__spreadValues({}, headerProps), { calendarSize: calendarContext.size, children: weekDays.map((day, index) => (\n // eslint-disable-next-line react/no-array-index-key\n /* @__PURE__ */ jsx(Week, { children: day.substring(0, 2) }, `twigs-calendar-grid-${day}-${startDate}-${id}-${index}`)\n )) })),\n /* @__PURE__ */ jsx(\n Box,\n {\n css: __spreadValues({\n padding: \"$8 0\"\n }, calendarContext.size === \"lg\" && {\n paddingBottom: \"$4\"\n }),\n children: [...new Array(weeksInMonth).keys()].map((weekIndex, index) => (\n // eslint-disable-next-line react/no-array-index-key\n /* @__PURE__ */ jsx(DaysContainer, { children: state.getDatesInWeek(weekIndex, startDate).map((date) => date ? /* @__PURE__ */ jsx(\n CalendarCell,\n {\n state,\n date,\n currentMonth: startDate,\n onDaySelect\n },\n `twigs-calendar-cell-${date}-${id}`\n ) : null) }, `weekIndex-${startDate}-${id}-${index}`)\n ))\n }\n )\n ]\n })\n );\n};\n\nexport { CalendarGrid };\n//# sourceMappingURL=calendar-grid.js.map\n"],"names":["$18f2051aff69b9bf$export$43bb16f9c6d9e3f7","useId","useCalendarContext","$14e0f24ef4ac5c92$export$a2258d9c4118825c","$e3031d1f8c9d64eb$export$cb95147730a423f5","$14e0f24ef4ac5c92$export$ccc1b2479e7dd654","jsxs","GridContainer","jsx","WeekContainer","Week","Box","DaysContainer","CalendarCell"],"mappings":";;;;;;;;;;;;;;AAYA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG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,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAChI,SAAS,CAAC,EAAE,CAAC,CAAC;AACd,wBAAwBF,cAAG;AAC3B,UAAUG,OAAG;AACb,UAAU;AACV,YAAY,GAAG,EAAE,cAAc,CAAC;AAChC,cAAc,OAAO,EAAE,MAAM;AAC7B,aAAa,EAAE,eAAe,CAAC,IAAI,KAAK,IAAI,IAAI;AAChD,cAAc,aAAa,EAAE,IAAI;AACjC,aAAa,CAAC;AACd,YAAY,QAAQ,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK;AAC/E;AACA,8BAA8BH,cAAG,CAACI,yBAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,mBAAmBJ,cAAG;AAChJ,gBAAgBK,yBAAY;AAC5B,gBAAgB;AAChB,kBAAkB,KAAK;AACvB,kBAAkB,IAAI;AACtB,kBAAkB,YAAY,EAAE,SAAS;AACzC,kBAAkB,WAAW;AAC7B,iBAAiB;AACjB,gBAAgB,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnD,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACnE,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js
CHANGED
|
@@ -32,6 +32,7 @@ var __spreadValues = (a, b) => {
|
|
|
32
32
|
const CalendarMonthsView = ({
|
|
33
33
|
state,
|
|
34
34
|
range,
|
|
35
|
+
onMonthSelect,
|
|
35
36
|
setCurrentCalendarView
|
|
36
37
|
}) => {
|
|
37
38
|
const monthFormatter = realModule.useDateFormatter({
|
|
@@ -67,7 +68,7 @@ const CalendarMonthsView = ({
|
|
|
67
68
|
if (!containerRef.current)
|
|
68
69
|
return;
|
|
69
70
|
const currentMonth = containerRef.current.querySelector(
|
|
70
|
-
`button[data-
|
|
71
|
+
`button[data-month-id="${dateValue == null ? void 0 : dateValue.month}"]`
|
|
71
72
|
);
|
|
72
73
|
if (currentMonth) {
|
|
73
74
|
currentMonth.focus();
|
|
@@ -109,6 +110,41 @@ const CalendarMonthsView = ({
|
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
};
|
|
113
|
+
const getButtonTabIndex = (index, month) => {
|
|
114
|
+
if (dateValue == null ? void 0 : dateValue.month) {
|
|
115
|
+
return dateValue.month === month ? 0 : -1;
|
|
116
|
+
}
|
|
117
|
+
return index === 0 ? 0 : -1;
|
|
118
|
+
};
|
|
119
|
+
const isButtonDisabled = (date) => {
|
|
120
|
+
if (!state.minValue && !state.maxValue)
|
|
121
|
+
return false;
|
|
122
|
+
if (state.minValue && date.year === state.minValue.year && date.month < state.minValue.month) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
if (state.maxValue && date.year === state.maxValue.year && date.month > state.maxValue.month) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
return false;
|
|
129
|
+
};
|
|
130
|
+
const handleMonthSelect = (date) => {
|
|
131
|
+
let updatedDate = date.set({});
|
|
132
|
+
if (state.isInvalid(date)) {
|
|
133
|
+
if (state.minValue && date.day < state.minValue.day) {
|
|
134
|
+
updatedDate = updatedDate.set({ day: state.minValue.day });
|
|
135
|
+
} else if (state.maxValue && date.day > state.maxValue.day) {
|
|
136
|
+
updatedDate = updatedDate.set({ day: state.maxValue.day });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (!range) {
|
|
140
|
+
state.selectDate(updatedDate);
|
|
141
|
+
}
|
|
142
|
+
state.setFocusedDate(updatedDate);
|
|
143
|
+
if (onMonthSelect) {
|
|
144
|
+
onMonthSelect(updatedDate);
|
|
145
|
+
}
|
|
146
|
+
setCurrentCalendarView(calendar.CALENDAR_VIEW.GRID);
|
|
147
|
+
};
|
|
112
148
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
113
149
|
box.Box,
|
|
114
150
|
{
|
|
@@ -147,25 +183,19 @@ const CalendarMonthsView = ({
|
|
|
147
183
|
children: months.map((month, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
148
184
|
button.Button,
|
|
149
185
|
{
|
|
150
|
-
color: dateValue.month === month.date.month ? "default" : "bright",
|
|
151
|
-
"data-
|
|
152
|
-
tabIndex:
|
|
153
|
-
disabled:
|
|
186
|
+
color: (dateValue == null ? void 0 : dateValue.month) === month.date.month ? "default" : "bright",
|
|
187
|
+
"data-month-id": month.date.month,
|
|
188
|
+
tabIndex: getButtonTabIndex(i, month.date.month),
|
|
189
|
+
disabled: isButtonDisabled(month.date),
|
|
154
190
|
css: __spreadValues({
|
|
155
191
|
padding: "$6",
|
|
156
192
|
height: calendarUtils.CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]
|
|
157
|
-
}, dateValue.month === month.date.month && {
|
|
193
|
+
}, (dateValue == null ? void 0 : dateValue.month) === month.date.month && {
|
|
158
194
|
color: "$secondary600"
|
|
159
195
|
}),
|
|
160
196
|
onKeyDown: (e) => handleKeyDown(e, i),
|
|
161
197
|
size: calendarContext.size,
|
|
162
|
-
onClick: () =>
|
|
163
|
-
if (!range) {
|
|
164
|
-
state.selectDate(month.date);
|
|
165
|
-
}
|
|
166
|
-
state.setFocusedDate(month.date);
|
|
167
|
-
setCurrentCalendarView(calendar.CALENDAR_VIEW.GRID);
|
|
168
|
-
},
|
|
198
|
+
onClick: () => handleMonthSelect(month.date),
|
|
169
199
|
children: month.label
|
|
170
200
|
},
|
|
171
201
|
month.label
|
package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-months-view.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { useId, useMemo, useRef, useEffect } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Text } from '../text/text.js';\nimport { CALENDAR_VIEW } from './calendar.js';\nimport { MonthYearGridContainer } from './calendar-commons.js';\nimport { CalendarHeader } from './calendar-header.js';\nimport { useCalendarContext, CALENDAR_SIZE_TO_WIDTH, CALENDAR_SIZE_TO_FONT_SIZE, CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT } from './calendar-utils.js';\nimport { useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst CalendarMonthsView = ({\n state,\n range,\n setCurrentCalendarView\n}) => {\n const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({\n month: \"short\",\n timeZone: state.timeZone\n });\n const monthsContainerId = useId();\n const calendarContext = useCalendarContext();\n const dateValue = useMemo(() => {\n var _a;\n if (range && ((_a = state.value) == null ? void 0 : _a[range])) {\n return state.value[range];\n }\n return state.value;\n }, [state, range]);\n const months = useMemo(() => {\n const data = [];\n const numMonths = state.focusedDate.calendar.getMonthsInYear(\n state.focusedDate\n );\n for (let i = 1; i <= numMonths; i++) {\n const date = state.focusedDate.set({ month: i });\n data.push({\n date,\n label: monthFormatter.format(date.toDate(state.timeZone))\n });\n }\n return data;\n }, []);\n const containerRef = useRef(null);\n useEffect(() => {\n setTimeout(() => {\n if (!containerRef.current)\n return;\n const currentMonth = containerRef.current.querySelector(\n `button[data-monthId=\"${dateValue.month}\"]`\n );\n if (currentMonth) {\n currentMonth.focus();\n }\n }, 200);\n }, []);\n const handleKeyDown = (e, index) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n e.stopPropagation();\n const nextMonth = months[index + 1];\n if (nextMonth && !state.isInvalid(nextMonth.date)) {\n const date = state.focusedDate.set({\n month: nextMonth.date.month\n });\n state.setFocusedDate(date);\n const nextButton = e.currentTarget.nextElementSibling;\n if (nextButton) {\n nextButton.setAttribute(\"tabindex\", \"0\");\n nextButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n e.stopPropagation();\n const prevMonth = months[index - 1];\n if (prevMonth && !state.isInvalid(prevMonth.date)) {\n const date = state.focusedDate.set({\n month: prevMonth.date.month\n });\n state.setFocusedDate(date);\n const prevButton = e.currentTarget.previousElementSibling;\n if (prevButton) {\n prevButton.setAttribute(\"tabindex\", \"0\");\n prevButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n }\n };\n return /* @__PURE__ */ jsxs(\n Box,\n {\n css: {\n minWidth: CALENDAR_SIZE_TO_WIDTH[calendarContext.size]\n },\n children: [\n /* @__PURE__ */ jsx(\n CalendarHeader,\n {\n calendarSize: calendarContext.size,\n css: {\n borderBottom: \"1px solid $neutral100\",\n justifyContent: \"center\"\n },\n children: /* @__PURE__ */ jsx(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral800\",\n padding: \"0 $6\"\n },\n children: \"Choose Month\"\n }\n )\n }\n ),\n /* @__PURE__ */ jsx(\n MonthYearGridContainer,\n {\n ref: containerRef,\n id: monthsContainerId,\n calendarSize: calendarContext.size,\n children: months.map((month, i) => /* @__PURE__ */ jsx(\n Button,\n {\n color: dateValue.month === month.date.month ? \"default\" : \"bright\",\n \"data-monthId\": month.date.month,\n tabIndex: dateValue.month === month.date.month ? 0 : -1,\n disabled: state.isInvalid(month.date),\n css: __spreadValues({\n padding: \"$6\",\n height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]\n }, dateValue.month === month.date.month && {\n color: \"$secondary600\"\n }),\n onKeyDown: (e) => handleKeyDown(e, i),\n size: calendarContext.size,\n onClick: () => {\n if (!range) {\n state.selectDate(month.date);\n }\n state.setFocusedDate(month.date);\n setCurrentCalendarView(CALENDAR_VIEW.GRID);\n },\n children: month.label\n },\n month.label\n ))\n }\n )\n ]\n }\n );\n};\n\nexport { CalendarMonthsView };\n//# sourceMappingURL=calendar-months-view.js.map\n"],"names":["$896ba0a80a8f4d36$export$85fd5fdf27bacc79","useId","useCalendarContext","useMemo","useRef","useEffect","jsxs","Box","CALENDAR_SIZE_TO_WIDTH","jsx","CalendarHeader","Text","CALENDAR_SIZE_TO_FONT_SIZE","MonthYearGridContainer","Button","CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT","CALENDAR_VIEW"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cA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AE,eAAe;AACxC,iBAAiB,CAAC;AAClB,gBAAgB,SAAS,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,gBAAgB,IAAI,EAAE,eAAe,CAAC,IAAI;AAC1C,gBAAgB,OAAO,EAAE,MAAM;AAC/B,kBAAkB,IAAI,CAAC,KAAK,EAAE;AAC9B,oBAAoB,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACjD,mBAAmB;AACnB,kBAAkB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnD,kBAAkB,sBAAsB,CAACC,sBAAa,CAAC,IAAI,CAAC,CAAC;AAC7D,iBAAiB;AACjB,gBAAgB,QAAQ,EAAE,KAAK,CAAC,KAAK;AACrC,eAAe;AACf,cAAc,KAAK,CAAC,KAAK;AACzB,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"calendar-months-view.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { useId, useMemo, useRef, useEffect } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Text } from '../text/text.js';\nimport { CALENDAR_VIEW } from './calendar.js';\nimport { MonthYearGridContainer } from './calendar-commons.js';\nimport { CalendarHeader } from './calendar-header.js';\nimport { useCalendarContext, CALENDAR_SIZE_TO_WIDTH, CALENDAR_SIZE_TO_FONT_SIZE, CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT } from './calendar-utils.js';\nimport { useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst CalendarMonthsView = ({\n state,\n range,\n onMonthSelect,\n setCurrentCalendarView\n}) => {\n const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({\n month: \"short\",\n timeZone: state.timeZone\n });\n const monthsContainerId = useId();\n const calendarContext = useCalendarContext();\n const dateValue = useMemo(() => {\n var _a;\n if (range && ((_a = state.value) == null ? void 0 : _a[range])) {\n return state.value[range];\n }\n return state.value;\n }, [state, range]);\n const months = useMemo(() => {\n const data = [];\n const numMonths = state.focusedDate.calendar.getMonthsInYear(\n state.focusedDate\n );\n for (let i = 1; i <= numMonths; i++) {\n const date = state.focusedDate.set({ month: i });\n data.push({\n date,\n label: monthFormatter.format(date.toDate(state.timeZone))\n });\n }\n return data;\n }, []);\n const containerRef = useRef(null);\n useEffect(() => {\n setTimeout(() => {\n if (!containerRef.current)\n return;\n const currentMonth = containerRef.current.querySelector(\n `button[data-month-id=\"${dateValue == null ? void 0 : dateValue.month}\"]`\n );\n if (currentMonth) {\n currentMonth.focus();\n }\n }, 200);\n }, []);\n const handleKeyDown = (e, index) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n e.stopPropagation();\n const nextMonth = months[index + 1];\n if (nextMonth && !state.isInvalid(nextMonth.date)) {\n const date = state.focusedDate.set({\n month: nextMonth.date.month\n });\n state.setFocusedDate(date);\n const nextButton = e.currentTarget.nextElementSibling;\n if (nextButton) {\n nextButton.setAttribute(\"tabindex\", \"0\");\n nextButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n e.stopPropagation();\n const prevMonth = months[index - 1];\n if (prevMonth && !state.isInvalid(prevMonth.date)) {\n const date = state.focusedDate.set({\n month: prevMonth.date.month\n });\n state.setFocusedDate(date);\n const prevButton = e.currentTarget.previousElementSibling;\n if (prevButton) {\n prevButton.setAttribute(\"tabindex\", \"0\");\n prevButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n }\n };\n const getButtonTabIndex = (index, month) => {\n if (dateValue == null ? void 0 : dateValue.month) {\n return dateValue.month === month ? 0 : -1;\n }\n return index === 0 ? 0 : -1;\n };\n const isButtonDisabled = (date) => {\n if (!state.minValue && !state.maxValue)\n return false;\n if (state.minValue && date.year === state.minValue.year && date.month < state.minValue.month) {\n return true;\n }\n if (state.maxValue && date.year === state.maxValue.year && date.month > state.maxValue.month) {\n return true;\n }\n return false;\n };\n const handleMonthSelect = (date) => {\n let updatedDate = date.set({});\n if (state.isInvalid(date)) {\n if (state.minValue && date.day < state.minValue.day) {\n updatedDate = updatedDate.set({ day: state.minValue.day });\n } else if (state.maxValue && date.day > state.maxValue.day) {\n updatedDate = updatedDate.set({ day: state.maxValue.day });\n }\n }\n if (!range) {\n state.selectDate(updatedDate);\n }\n state.setFocusedDate(updatedDate);\n if (onMonthSelect) {\n onMonthSelect(updatedDate);\n }\n setCurrentCalendarView(CALENDAR_VIEW.GRID);\n };\n return /* @__PURE__ */ jsxs(\n Box,\n {\n css: {\n minWidth: CALENDAR_SIZE_TO_WIDTH[calendarContext.size]\n },\n children: [\n /* @__PURE__ */ jsx(\n CalendarHeader,\n {\n calendarSize: calendarContext.size,\n css: {\n borderBottom: \"1px solid $neutral100\",\n justifyContent: \"center\"\n },\n children: /* @__PURE__ */ jsx(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral800\",\n padding: \"0 $6\"\n },\n children: \"Choose Month\"\n }\n )\n }\n ),\n /* @__PURE__ */ jsx(\n MonthYearGridContainer,\n {\n ref: containerRef,\n id: monthsContainerId,\n calendarSize: calendarContext.size,\n children: months.map((month, i) => /* @__PURE__ */ jsx(\n Button,\n {\n color: (dateValue == null ? void 0 : dateValue.month) === month.date.month ? \"default\" : \"bright\",\n \"data-month-id\": month.date.month,\n tabIndex: getButtonTabIndex(i, month.date.month),\n disabled: isButtonDisabled(month.date),\n css: __spreadValues({\n padding: \"$6\",\n height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]\n }, (dateValue == null ? void 0 : dateValue.month) === month.date.month && {\n color: \"$secondary600\"\n }),\n onKeyDown: (e) => handleKeyDown(e, i),\n size: calendarContext.size,\n onClick: () => handleMonthSelect(month.date),\n children: month.label\n },\n month.label\n ))\n }\n )\n ]\n }\n );\n};\n\nexport { CalendarMonthsView };\n//# sourceMappingURL=calendar-months-view.js.map\n"],"names":["$896ba0a80a8f4d36$export$85fd5fdf27bacc79","useId","useCalendarContext","useMemo","useRef","useEffect","CALENDAR_VIEW","jsxs","Box","CALENDAR_SIZE_TO_WIDTH","jsx","CalendarHeader","Text","CALENDAR_SIZE_TO_FONT_SIZE","MonthYearGridContainer","Button","CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAA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G;AAClE,cAAcK,aAAM;AACpB,cAAc;AACd,gBAAgB,KAAK,EAAE,CAAC,SAAS,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,GAAG,QAAQ;AACjH,gBAAgB,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK;AACjD,gBAAgB,QAAQ,EAAE,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AAChE,gBAAgB,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;AACtD,gBAAgB,GAAG,EAAE,cAAc,CAAC;AACpC,kBAAkB,OAAO,EAAE,IAAI;AAC/B,kBAAkB,MAAM,EAAEC,oDAAsC,CAAC,eAAe,CAAC,IAAI,CAAC;AACtF,iBAAiB,EAAE,CAAC,SAAS,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI;AAC1F,kBAAkB,KAAK,EAAE,eAAe;AACxC,iBAAiB,CAAC;AAClB,gBAAgB,SAAS,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,gBAAgB,IAAI,EAAE,eAAe,CAAC,IAAI;AAC1C,gBAAgB,OAAO,EAAE,MAAM,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC;AAC5D,gBAAgB,QAAQ,EAAE,KAAK,CAAC,KAAK;AACrC,eAAe;AACf,cAAc,KAAK,CAAC,KAAK;AACzB,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
|
package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js
CHANGED
|
@@ -11,7 +11,6 @@ var popover = require('../popover/popover.js');
|
|
|
11
11
|
var stitches_config = require('../stitches.config.js');
|
|
12
12
|
var text = require('../text/text.js');
|
|
13
13
|
var calendarCommons = require('./calendar-commons.js');
|
|
14
|
-
var calendarUtils = require('./calendar-utils.js');
|
|
15
14
|
var chevronDown = require('../packages/react-icons/dist/es/icons/chevron-down.js');
|
|
16
15
|
|
|
17
16
|
var __defProp = Object.defineProperty;
|
|
@@ -32,21 +31,24 @@ var __spreadValues = (a, b) => {
|
|
|
32
31
|
};
|
|
33
32
|
const CalendarTimePicker = ({
|
|
34
33
|
value,
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
onChange,
|
|
35
|
+
size,
|
|
36
|
+
renderCustomTrigger
|
|
37
37
|
}) => {
|
|
38
|
+
const [localDateValue, setLocalDateValue] = React.useState(_import.today(_import.getLocalTimeZone()));
|
|
39
|
+
const dateValue = value != null ? value : localDateValue;
|
|
38
40
|
const [popoverOpen, setPopoverOpen] = React.useState(false);
|
|
39
|
-
const calendarContext = calendarUtils.useCalendarContext();
|
|
40
41
|
const timeState = React.useMemo(() => {
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
42
|
+
if (!dateValue) {
|
|
43
|
+
const calendarDate = _import.today(_import.getLocalTimeZone());
|
|
44
|
+
const timeObj = _import.toCalendarDateTime(calendarDate);
|
|
43
45
|
return timeObj;
|
|
44
46
|
}
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
47
|
+
if (dateValue instanceof _import.CalendarDateTime || dateValue instanceof _import.ZonedDateTime) {
|
|
48
|
+
return dateValue;
|
|
47
49
|
}
|
|
48
|
-
return _import.toCalendarDateTime(
|
|
49
|
-
}, [
|
|
50
|
+
return _import.toCalendarDateTime(dateValue);
|
|
51
|
+
}, [dateValue]);
|
|
50
52
|
const hoursInTwelveHourFormat = timeState.hour % 12 || 12;
|
|
51
53
|
const initialHours = hoursInTwelveHourFormat.toString().padStart(2, "0");
|
|
52
54
|
const initialMinutes = timeState.minute.toString().padStart(2, "0");
|
|
@@ -94,7 +96,7 @@ const CalendarTimePicker = ({
|
|
|
94
96
|
}
|
|
95
97
|
case "ArrowLeft": {
|
|
96
98
|
e.preventDefault();
|
|
97
|
-
if (parentColumn
|
|
99
|
+
if (parentColumn == null ? void 0 : parentColumn.previousElementSibling) {
|
|
98
100
|
const prevColumn = parentColumn.previousElementSibling.querySelector(
|
|
99
101
|
'[data-is-selected="true"]'
|
|
100
102
|
);
|
|
@@ -107,7 +109,7 @@ const CalendarTimePicker = ({
|
|
|
107
109
|
}
|
|
108
110
|
case "ArrowRight": {
|
|
109
111
|
e.preventDefault();
|
|
110
|
-
if (parentColumn
|
|
112
|
+
if (parentColumn == null ? void 0 : parentColumn.nextElementSibling) {
|
|
111
113
|
const nextColumn = parentColumn.nextElementSibling.querySelector(
|
|
112
114
|
'[data-is-selected="true"]'
|
|
113
115
|
);
|
|
@@ -122,20 +124,21 @@ const CalendarTimePicker = ({
|
|
|
122
124
|
};
|
|
123
125
|
const handleApply = () => {
|
|
124
126
|
const updatedTime = timeState.set({
|
|
125
|
-
hour: timeValue.pm ? parseInt(timeValue.hour, 10)
|
|
127
|
+
hour: timeValue.pm ? 12 + parseInt(timeValue.hour, 10) % 12 : parseInt(timeValue.hour, 10) % 12,
|
|
126
128
|
minute: parseInt(timeValue.minute, 10)
|
|
127
129
|
});
|
|
128
130
|
if (onChange) {
|
|
131
|
+
setLocalDateValue(updatedTime);
|
|
129
132
|
onChange(updatedTime);
|
|
130
133
|
}
|
|
131
134
|
setPopoverOpen(false);
|
|
132
135
|
};
|
|
133
136
|
return /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover, { open: popoverOpen, onOpenChange: (open) => setPopoverOpen(open), children: [
|
|
134
|
-
/* @__PURE__ */ jsxRuntime.jsx(popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.PopoverTrigger, { asChild: true, children: renderCustomTrigger ? renderCustomTrigger({ timeValue }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
135
138
|
button.Button,
|
|
136
139
|
{
|
|
137
140
|
color: "default",
|
|
138
|
-
size:
|
|
141
|
+
size: size === "lg" ? "md" : "sm",
|
|
139
142
|
rightIcon: /* @__PURE__ */ jsxRuntime.jsx(chevronDown.ChevronDownIcon, {}),
|
|
140
143
|
children: [
|
|
141
144
|
initialHours,
|