@janbox/storefront-ui 1.0.26 → 2.0.0
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/constants/index.d.ts +0 -3
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +0 -5
- package/dist/index.js +4 -2
- package/dist/lib/accordion/accordion/accordion.d.ts.map +1 -1
- package/dist/lib/accordion/accordion/accordion.js +11 -31
- package/dist/lib/accordion/accordion/types.d.ts +3 -3
- package/dist/lib/accordion/accordion/types.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-content/accordion-content.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-content/accordion-content.js +3 -9
- package/dist/lib/accordion/accordion-content/types.d.ts +3 -3
- package/dist/lib/accordion/accordion-content/types.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-group/accordion-group.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-group/accordion-group.js +3 -12
- package/dist/lib/accordion/accordion-group/types.d.ts +3 -3
- package/dist/lib/accordion/accordion-group/types.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-summary/accordion-summary.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-summary/accordion-summary.js +5 -11
- package/dist/lib/accordion/accordion-summary/helpers.d.ts.map +1 -1
- package/dist/lib/accordion/accordion-summary/helpers.js +3 -5
- package/dist/lib/accordion/accordion-summary/types.d.ts +6 -6
- package/dist/lib/accordion/accordion-summary/types.d.ts.map +1 -1
- package/dist/lib/box/box.d.ts +1 -1
- package/dist/lib/box/box.d.ts.map +1 -1
- package/dist/lib/box/box.js +8 -7
- package/dist/lib/box/types.d.ts +3 -3
- package/dist/lib/box/types.d.ts.map +1 -1
- package/dist/lib/button/button.d.ts.map +1 -1
- package/dist/lib/button/button.js +83 -98
- package/dist/lib/button/helpers.d.ts +2 -0
- package/dist/lib/button/helpers.d.ts.map +1 -1
- package/dist/lib/button/helpers.js +30 -54
- package/dist/lib/button/types.d.ts +5 -5
- package/dist/lib/button/types.d.ts.map +1 -1
- package/dist/lib/cascader/cascader-floating-content.d.ts +5 -15
- package/dist/lib/cascader/cascader-floating-content.d.ts.map +1 -1
- package/dist/lib/cascader/cascader-floating-content.js +3 -3
- package/dist/lib/cascader/cascader.d.ts.map +1 -1
- package/dist/lib/cascader/cascader.js +6 -11
- package/dist/lib/cascader/helpers.d.ts.map +1 -1
- package/dist/lib/cascader/helpers.js +1 -3
- package/dist/lib/cascader/types.d.ts +3 -3
- package/dist/lib/cascader/types.d.ts.map +1 -1
- package/dist/lib/checkbox/checkbox.d.ts.map +1 -1
- package/dist/lib/checkbox/checkbox.js +5 -3
- package/dist/lib/checkbox/types.d.ts +2 -4
- package/dist/lib/checkbox/types.d.ts.map +1 -1
- package/dist/lib/chip/chip.d.ts.map +1 -1
- package/dist/lib/chip/chip.js +13 -18
- package/dist/lib/chip/helpers.d.ts +8 -0
- package/dist/lib/chip/helpers.d.ts.map +1 -1
- package/dist/lib/chip/helpers.js +17 -5
- package/dist/lib/chip/types.d.ts +4 -4
- package/dist/lib/chip/types.d.ts.map +1 -1
- package/dist/lib/container/container.d.ts.map +1 -1
- package/dist/lib/container/container.js +6 -13
- package/dist/lib/container/helpers.d.ts.map +1 -1
- package/dist/lib/container/helpers.js +1 -3
- package/dist/lib/container/types.d.ts +4 -4
- package/dist/lib/container/types.d.ts.map +1 -1
- package/dist/lib/date-picker/date-picker.d.ts.map +1 -1
- package/dist/lib/date-picker/date-picker.js +52 -13
- package/dist/lib/date-picker/helpers.d.ts.map +1 -1
- package/dist/lib/date-picker/helpers.js +1 -3
- package/dist/lib/date-picker/types.d.ts +4 -7
- package/dist/lib/date-picker/types.d.ts.map +1 -1
- package/dist/lib/dialog/dialog/dialog.js +2 -2
- package/dist/lib/dialog/dialog/helpers.d.ts.map +1 -1
- package/dist/lib/dialog/dialog/helpers.js +1 -3
- package/dist/lib/dialog/dialog/types.d.ts +2 -2
- package/dist/lib/dialog/dialog/types.d.ts.map +1 -1
- package/dist/lib/dialog/dialog-header/dialog-header.d.ts.map +1 -1
- package/dist/lib/dialog/dialog-header/dialog-header.js +1 -3
- package/dist/lib/filter-panel/checkbox-filter-panel.js +1 -1
- package/dist/lib/filter-panel/filter-panel.js +2 -2
- package/dist/lib/filter-panel/input-range-filter-panel.d.ts +3 -0
- package/dist/lib/filter-panel/input-range-filter-panel.d.ts.map +1 -0
- package/dist/lib/filter-panel/input-range-filter-panel.js +77 -0
- package/dist/lib/filter-panel/radio-filter-panel.js +2 -2
- package/dist/lib/filter-panel/types.d.ts +7 -17
- package/dist/lib/filter-panel/types.d.ts.map +1 -1
- package/dist/lib/flag/helpers.d.ts.map +1 -1
- package/dist/lib/flag/helpers.js +4 -6
- package/dist/lib/flag/types.d.ts +1 -5
- package/dist/lib/flag/types.d.ts.map +1 -1
- package/dist/lib/flexbox/flex-item/flex-item.d.ts.map +1 -1
- package/dist/lib/flexbox/flex-item/flex-item.js +3 -9
- package/dist/lib/flexbox/flex-item/helpers.d.ts.map +1 -1
- package/dist/lib/flexbox/flex-item/helpers.js +1 -3
- package/dist/lib/flexbox/flex-item/types.d.ts +2 -4
- package/dist/lib/flexbox/flex-item/types.d.ts.map +1 -1
- package/dist/lib/flexbox/flexbox/flexbox.d.ts.map +1 -1
- package/dist/lib/flexbox/flexbox/flexbox.js +5 -3
- package/dist/lib/flexbox/flexbox/helpers.d.ts.map +1 -1
- package/dist/lib/flexbox/flexbox/helpers.js +4 -6
- package/dist/lib/flexbox/flexbox/types.d.ts +3 -3
- package/dist/lib/flexbox/flexbox/types.d.ts.map +1 -1
- package/dist/lib/floating/floating-close/floating-close.js +0 -2
- package/dist/lib/floating/floating-content/types.d.ts.map +1 -1
- package/dist/lib/grid/cell/cell.d.ts.map +1 -1
- package/dist/lib/grid/cell/cell.js +7 -6
- package/dist/lib/grid/cell/types.d.ts +5 -3
- package/dist/lib/grid/cell/types.d.ts.map +1 -1
- package/dist/lib/grid/grid/grid.d.ts.map +1 -1
- package/dist/lib/grid/grid/grid.js +8 -6
- package/dist/lib/grid/grid/helpers.d.ts.map +1 -1
- package/dist/lib/grid/grid/helpers.js +1 -3
- package/dist/lib/grid/grid/types.d.ts +4 -4
- package/dist/lib/grid/grid/types.d.ts.map +1 -1
- package/dist/lib/highlight-words/highlight-words.js +0 -2
- package/dist/lib/icon/helpers.d.ts.map +1 -1
- package/dist/lib/icon/helpers.js +1 -3
- package/dist/lib/icon/icon.d.ts.map +1 -1
- package/dist/lib/icon/icon.js +7 -6
- package/dist/lib/icon/types.d.ts +5 -5
- package/dist/lib/icon/types.d.ts.map +1 -1
- package/dist/lib/icon-button/helpers.d.ts.map +1 -1
- package/dist/lib/icon-button/helpers.js +8 -31
- package/dist/lib/icon-button/icon-button.d.ts.map +1 -1
- package/dist/lib/icon-button/icon-button.js +49 -56
- package/dist/lib/icon-button/types.d.ts +6 -6
- package/dist/lib/icon-button/types.d.ts.map +1 -1
- package/dist/lib/image/helpers.d.ts.map +1 -1
- package/dist/lib/image/helpers.js +2 -4
- package/dist/lib/image/image.d.ts.map +1 -1
- package/dist/lib/image/image.js +3 -9
- package/dist/lib/image/types.d.ts +3 -3
- package/dist/lib/image/types.d.ts.map +1 -1
- package/dist/lib/input/helpers.d.ts.map +1 -1
- package/dist/lib/input/helpers.js +3 -31
- package/dist/lib/input/input.d.ts.map +1 -1
- package/dist/lib/input/input.js +122 -110
- package/dist/lib/input/types.d.ts +4 -7
- package/dist/lib/input/types.d.ts.map +1 -1
- package/dist/lib/input-mask/helpers.d.ts.map +1 -1
- package/dist/lib/input-mask/helpers.js +1 -3
- package/dist/lib/input-mask/input-mask.d.ts +1 -1
- package/dist/lib/input-mask/input-mask.d.ts.map +1 -1
- package/dist/lib/input-mask/input-mask.js +9 -14
- package/dist/lib/input-mask/types.d.ts +4 -4
- package/dist/lib/input-mask/types.d.ts.map +1 -1
- package/dist/lib/input-number/input-number.d.ts.map +1 -1
- package/dist/lib/input-number/input-number.js +2 -7
- package/dist/lib/input-range/helpers.d.ts.map +1 -1
- package/dist/lib/input-range/helpers.js +1 -3
- package/dist/lib/input-range/input-range.d.ts.map +1 -1
- package/dist/lib/input-range/input-range.js +8 -19
- package/dist/lib/input-range/types.d.ts +4 -4
- package/dist/lib/input-range/types.d.ts.map +1 -1
- package/dist/lib/lightbox/lightbox.d.ts.map +1 -1
- package/dist/lib/lightbox/lightbox.js +13 -15
- package/dist/lib/linear-progress/helpers.d.ts.map +1 -1
- package/dist/lib/linear-progress/helpers.js +2 -4
- package/dist/lib/linear-progress/linear-progress.d.ts.map +1 -1
- package/dist/lib/linear-progress/linear-progress.js +9 -8
- package/dist/lib/linear-progress/types.d.ts +3 -3
- package/dist/lib/linear-progress/types.d.ts.map +1 -1
- package/dist/lib/link/link.d.ts.map +1 -1
- package/dist/lib/link/link.js +17 -7
- package/dist/lib/link/types.d.ts +4 -4
- package/dist/lib/link/types.d.ts.map +1 -1
- package/dist/lib/loading/block-skeleton/block-skeleton.d.ts +3 -3
- package/dist/lib/loading/block-skeleton/block-skeleton.d.ts.map +1 -1
- package/dist/lib/loading/block-skeleton/block-skeleton.js +4 -8
- package/dist/lib/loading/image-skeleton/image-skeleton.d.ts +1 -1
- package/dist/lib/loading/image-skeleton/image-skeleton.d.ts.map +1 -1
- package/dist/lib/loading/image-skeleton/image-skeleton.js +4 -8
- package/dist/lib/loading/image-skeleton/types.d.ts +2 -2
- package/dist/lib/loading/image-skeleton/types.d.ts.map +1 -1
- package/dist/lib/loading/loading-overlay/loading-overlay.d.ts +1 -1
- package/dist/lib/loading/loading-overlay/loading-overlay.d.ts.map +1 -1
- package/dist/lib/loading/loading-overlay/loading-overlay.js +3 -12
- package/dist/lib/loading/loading-overlay/types.d.ts +3 -3
- package/dist/lib/loading/loading-overlay/types.d.ts.map +1 -1
- package/dist/lib/loading/text-skeleton/text-skeleton.d.ts +1 -1
- package/dist/lib/loading/text-skeleton/text-skeleton.d.ts.map +1 -1
- package/dist/lib/loading/text-skeleton/text-skeleton.js +4 -8
- package/dist/lib/loading/text-skeleton/types.d.ts +2 -2
- package/dist/lib/loading/text-skeleton/types.d.ts.map +1 -1
- package/dist/lib/marquee/marquee/marquee.d.ts +1 -1
- package/dist/lib/marquee/marquee/marquee.d.ts.map +1 -1
- package/dist/lib/marquee/marquee/marquee.js +14 -9
- package/dist/lib/marquee/marquee/types.d.ts +4 -4
- package/dist/lib/marquee/marquee/types.d.ts.map +1 -1
- package/dist/lib/menu/menu-item/helpers.d.ts.map +1 -1
- package/dist/lib/menu/menu-item/helpers.js +2 -4
- package/dist/lib/multiple-select/helpers.d.ts.map +1 -1
- package/dist/lib/multiple-select/helpers.js +1 -3
- package/dist/lib/multiple-select/multiple-select.d.ts.map +1 -1
- package/dist/lib/multiple-select/multiple-select.js +8 -8
- package/dist/lib/multiple-select/types.d.ts +2 -2
- package/dist/lib/multiple-select/types.d.ts.map +1 -1
- package/dist/lib/otp-input/otp-input.d.ts +1 -1
- package/dist/lib/otp-input/otp-input.d.ts.map +1 -1
- package/dist/lib/otp-input/otp-input.js +9 -2
- package/dist/lib/otp-input/types.d.ts +4 -6
- package/dist/lib/otp-input/types.d.ts.map +1 -1
- package/dist/lib/pagination/helpers.d.ts.map +1 -1
- package/dist/lib/pagination/helpers.js +1 -3
- package/dist/lib/pagination/pagination.d.ts.map +1 -1
- package/dist/lib/pagination/pagination.js +19 -35
- package/dist/lib/pagination/types.d.ts +2 -2
- package/dist/lib/pagination/types.d.ts.map +1 -1
- package/dist/lib/phone-input/phone-input.d.ts.map +1 -1
- package/dist/lib/phone-input/phone-input.js +13 -17
- package/dist/lib/phone-input/types.d.ts +2 -2
- package/dist/lib/phone-input/types.d.ts.map +1 -1
- package/dist/lib/primitive/primitive.d.ts +1 -1
- package/dist/lib/primitive/primitive.d.ts.map +1 -1
- package/dist/lib/primitive/primitive.js +10 -18
- package/dist/lib/primitive/types.d.ts +4 -7
- package/dist/lib/primitive/types.d.ts.map +1 -1
- package/dist/lib/radio-button/radio-button.js +1 -1
- package/dist/lib/select/helpers.d.ts.map +1 -1
- package/dist/lib/select/helpers.js +1 -3
- package/dist/lib/select/select.d.ts.map +1 -1
- package/dist/lib/select/select.js +15 -23
- package/dist/lib/select/types.d.ts +4 -4
- package/dist/lib/select/types.d.ts.map +1 -1
- package/dist/lib/swiper/swiper/swiper.d.ts.map +1 -1
- package/dist/lib/swiper/swiper/swiper.js +11 -13
- package/dist/lib/swiper/swiper/types.d.ts +7 -7
- package/dist/lib/swiper/swiper/types.d.ts.map +1 -1
- package/dist/lib/swiper/swiper-slide/swiper-slide.d.ts +1 -1
- package/dist/lib/swiper/swiper-slide/swiper-slide.d.ts.map +1 -1
- package/dist/lib/swiper/swiper-slide/swiper-slide.js +3 -9
- package/dist/lib/swiper/swiper-slide/types.d.ts +2 -5
- package/dist/lib/swiper/swiper-slide/types.d.ts.map +1 -1
- package/dist/lib/switch/switch.js +0 -2
- package/dist/lib/table/table/table.d.ts +1 -1
- package/dist/lib/table/table/table.d.ts.map +1 -1
- package/dist/lib/table/table/table.js +6 -4
- package/dist/lib/table/table/types.d.ts +2 -1
- package/dist/lib/table/table/types.d.ts.map +1 -1
- package/dist/lib/table/table-body/table-body.d.ts +1 -1
- package/dist/lib/table/table-body/table-body.d.ts.map +1 -1
- package/dist/lib/table/table-body/table-body.js +4 -8
- package/dist/lib/table/table-body/types.d.ts +2 -2
- package/dist/lib/table/table-body/types.d.ts.map +1 -1
- package/dist/lib/table/table-cell/table-cell.d.ts +1 -1
- package/dist/lib/table/table-cell/table-cell.d.ts.map +1 -1
- package/dist/lib/table/table-cell/table-cell.js +15 -2
- package/dist/lib/table/table-cell/types.d.ts +2 -1
- package/dist/lib/table/table-cell/types.d.ts.map +1 -1
- package/dist/lib/table/table-footer/table-footer.d.ts +1 -1
- package/dist/lib/table/table-footer/table-footer.d.ts.map +1 -1
- package/dist/lib/table/table-footer/table-footer.js +3 -2
- package/dist/lib/table/table-footer/types.d.ts +2 -1
- package/dist/lib/table/table-footer/types.d.ts.map +1 -1
- package/dist/lib/table/table-head/table-head.d.ts +1 -1
- package/dist/lib/table/table-head/table-head.d.ts.map +1 -1
- package/dist/lib/table/table-head/table-head.js +4 -8
- package/dist/lib/table/table-head/types.d.ts +2 -2
- package/dist/lib/table/table-head/types.d.ts.map +1 -1
- package/dist/lib/table/table-row/table-row.d.ts +1 -1
- package/dist/lib/table/table-row/table-row.d.ts.map +1 -1
- package/dist/lib/table/table-row/table-row.js +3 -2
- package/dist/lib/table/table-row/types.d.ts +2 -1
- package/dist/lib/table/table-row/types.d.ts.map +1 -1
- package/dist/lib/tabs/tab/tab.d.ts.map +1 -1
- package/dist/lib/tabs/tab/tab.js +1 -1
- package/dist/lib/tabs/tab/types.d.ts +3 -3
- package/dist/lib/tabs/tab/types.d.ts.map +1 -1
- package/dist/lib/tabs/tab-indicator/tab-indicator.d.ts.map +1 -1
- package/dist/lib/tabs/tab-indicator/tab-indicator.js +2 -10
- package/dist/lib/tabs/tab-indicator/types.d.ts +2 -3
- package/dist/lib/tabs/tab-indicator/types.d.ts.map +1 -1
- package/dist/lib/tabs/tab-list/tab-list.d.ts.map +1 -1
- package/dist/lib/tabs/tab-list/tab-list.js +3 -9
- package/dist/lib/tabs/tab-list/types.d.ts +3 -6
- package/dist/lib/tabs/tab-list/types.d.ts.map +1 -1
- package/dist/lib/tabs/tab-panel/tab-panel.d.ts.map +1 -1
- package/dist/lib/tabs/tab-panel/tab-panel.js +3 -12
- package/dist/lib/tabs/tab-panel/types.d.ts +2 -5
- package/dist/lib/tabs/tab-panel/types.d.ts.map +1 -1
- package/dist/lib/tabs/tabs/helpers.js +2 -2
- package/dist/lib/tabs/tabs/tabs.d.ts +1 -1
- package/dist/lib/tabs/tabs/tabs.d.ts.map +1 -1
- package/dist/lib/tabs/tabs/tabs.js +5 -25
- package/dist/lib/tabs/tabs/types.d.ts +4 -5
- package/dist/lib/tabs/tabs/types.d.ts.map +1 -1
- package/dist/lib/text/helpers.js +1 -1
- package/dist/lib/text/text.d.ts +1 -1
- package/dist/lib/text/text.d.ts.map +1 -1
- package/dist/lib/text/text.js +9 -8
- package/dist/lib/text/types.d.ts +7 -8
- package/dist/lib/text/types.d.ts.map +1 -1
- package/dist/lib/textarea/helpers.d.ts.map +1 -1
- package/dist/lib/textarea/helpers.js +1 -3
- package/dist/lib/textarea/textarea.d.ts.map +1 -1
- package/dist/lib/textarea/textarea.js +36 -26
- package/dist/lib/textarea/types.d.ts +6 -7
- package/dist/lib/textarea/types.d.ts.map +1 -1
- package/dist/lib/time-picker/time-picker.d.ts +1 -1
- package/dist/lib/time-picker/time-picker.d.ts.map +1 -1
- package/dist/lib/time-picker/time-picker.js +52 -67
- package/dist/lib/time-picker/types.d.ts +5 -5
- package/dist/lib/time-picker/types.d.ts.map +1 -1
- package/dist/lib/unordered-list/list-item/helpers.d.ts.map +1 -1
- package/dist/lib/unordered-list/list-item/helpers.js +2 -4
- package/dist/lib/unordered-list/list-item/list-item.d.ts.map +1 -1
- package/dist/lib/unordered-list/list-item/list-item.js +3 -11
- package/dist/lib/unordered-list/list-item/types.d.ts +2 -3
- package/dist/lib/unordered-list/list-item/types.d.ts.map +1 -1
- package/dist/lib/unordered-list/unordered-list/helpers.js +2 -2
- package/dist/lib/unordered-list/unordered-list/types.d.ts +2 -3
- package/dist/lib/unordered-list/unordered-list/types.d.ts.map +1 -1
- package/dist/lib/unordered-list/unordered-list/unordered-list.d.ts.map +1 -1
- package/dist/lib/unordered-list/unordered-list/unordered-list.js +13 -17
- package/dist/lib/video/types.d.ts +3 -3
- package/dist/lib/video/types.d.ts.map +1 -1
- package/dist/lib/video/video.d.ts.map +1 -1
- package/dist/lib/video/video.js +3 -14
- package/dist/locales/en/ui__translation.json +1 -1
- package/dist/locales/vi/ui__translation.json +1 -3
- package/dist/style.css +17 -17
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +2 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -8
- package/dist/utils/stylesheet.d.ts +2 -0
- package/dist/utils/stylesheet.d.ts.map +1 -1
- package/dist/utils/stylesheet.js +15 -1
- package/package.json +1 -1
- package/dist/lib/filter-panel/price-range-filter-panel.d.ts +0 -3
- package/dist/lib/filter-panel/price-range-filter-panel.d.ts.map +0 -1
- package/dist/lib/filter-panel/price-range-filter-panel.js +0 -126
package/dist/lib/chip/chip.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { getChipProps } from "./helpers.js";
|
|
3
|
-
import { getColorShadesByVariant
|
|
2
|
+
import { getChipProps, getChipSizeState } from "./helpers.js";
|
|
3
|
+
import { getColorShadesByVariant } from "../../utils/index.js";
|
|
4
4
|
import { mediaQuery } from "../../theme/screens.js";
|
|
5
5
|
import "../../theme/palette.js";
|
|
6
6
|
import { getTypographyVar } from "../../theme/typography.js";
|
|
7
|
+
import { createSxInterpolation } from "../../utils/stylesheet.js";
|
|
7
8
|
const Chip = ({ children, ..._props }) => {
|
|
8
|
-
const {
|
|
9
|
+
const { sx, size, sm, md, lg, color = "green", ...rest } = getChipProps(_props);
|
|
9
10
|
const { light, main } = getColorShadesByVariant(color);
|
|
10
11
|
return /* @__PURE__ */ jsx(
|
|
11
12
|
"div",
|
|
@@ -18,39 +19,33 @@ const Chip = ({ children, ..._props }) => {
|
|
|
18
19
|
display: "flex",
|
|
19
20
|
alignItems: "center",
|
|
20
21
|
backgroundColor: light,
|
|
21
|
-
|
|
22
|
-
borderRightWidth: 1,
|
|
23
|
-
borderBottomWidth: 1,
|
|
24
|
-
borderLeftWidth: 1,
|
|
25
|
-
borderTopLeftRadius: 8,
|
|
26
|
-
borderTopRightRadius: 8,
|
|
27
|
-
borderBottomLeftRadius: 8,
|
|
28
|
-
borderBottomRightRadius: 8,
|
|
22
|
+
borderWidth: 1,
|
|
29
23
|
borderColor: main,
|
|
30
24
|
color: main
|
|
31
25
|
},
|
|
32
|
-
createStyle(
|
|
26
|
+
createStyle({ size }),
|
|
33
27
|
{
|
|
34
28
|
[mediaQuery("sm")]: createStyle(sm),
|
|
35
29
|
[mediaQuery("md")]: createStyle(md),
|
|
36
30
|
[mediaQuery("lg")]: createStyle(lg)
|
|
37
|
-
}
|
|
31
|
+
},
|
|
32
|
+
createSxInterpolation(sx)
|
|
38
33
|
],
|
|
39
34
|
children
|
|
40
35
|
}
|
|
41
36
|
);
|
|
42
37
|
};
|
|
43
|
-
const createStyle = ({
|
|
44
|
-
const { inputSize, inputPaddingX, textVariant } =
|
|
38
|
+
const createStyle = ({ size } = {}) => {
|
|
39
|
+
const { inputSize, inputPaddingX, textVariant, rounded } = getChipSizeState(size);
|
|
45
40
|
return [
|
|
46
41
|
{
|
|
47
42
|
paddingLeft: inputPaddingX,
|
|
48
43
|
paddingRight: inputPaddingX,
|
|
49
44
|
minHeight: inputSize,
|
|
50
45
|
fontSize: textVariant ? getTypographyVar(textVariant).fontSize : void 0,
|
|
51
|
-
lineHeight: textVariant ? getTypographyVar(textVariant).lineHeight : void 0
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
lineHeight: textVariant ? getTypographyVar(textVariant).lineHeight : void 0,
|
|
47
|
+
borderRadius: rounded
|
|
48
|
+
}
|
|
54
49
|
];
|
|
55
50
|
};
|
|
56
51
|
export {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { SizeVariant } from '../../types';
|
|
2
|
+
import { TypographySizeVariant } from '../../theme';
|
|
1
3
|
import { ChipProps } from './types';
|
|
4
|
+
export declare const getChipSizeState: (size?: SizeVariant) => Partial<{
|
|
5
|
+
inputSize: number;
|
|
6
|
+
inputPaddingX: number;
|
|
7
|
+
textVariant: TypographySizeVariant;
|
|
8
|
+
rounded: number;
|
|
9
|
+
}>;
|
|
2
10
|
export declare const getChipProps: (extended: ChipProps) => ChipProps;
|
|
3
11
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/chip/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/chip/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AASpC,eAAO,MAAM,gBAAgB,UACpB,WAAW,KACjB,OAAO,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB,CAaA,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,SAAS,cAE/C,CAAC"}
|
package/dist/lib/chip/helpers.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import { mergeComponentProps } from "../../utils/index.js";
|
|
2
2
|
const defaultProps = {
|
|
3
|
-
|
|
4
|
-
css: {},
|
|
5
|
-
size: "md"
|
|
6
|
-
},
|
|
3
|
+
size: "md",
|
|
7
4
|
color: "primary"
|
|
8
5
|
};
|
|
6
|
+
const getChipSizeState = (size) => {
|
|
7
|
+
switch (size) {
|
|
8
|
+
case "xs":
|
|
9
|
+
return { inputSize: 20, inputPaddingX: 6, textVariant: "xs", rounded: 4 };
|
|
10
|
+
case "sm":
|
|
11
|
+
return { inputSize: 24, inputPaddingX: 8, textVariant: "xs", rounded: 6 };
|
|
12
|
+
case "md":
|
|
13
|
+
return { inputSize: 28, inputPaddingX: 10, textVariant: "sm", rounded: 8 };
|
|
14
|
+
case "lg":
|
|
15
|
+
return { inputSize: 32, inputPaddingX: 12, textVariant: "sm", rounded: 8 };
|
|
16
|
+
default:
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
9
20
|
const getChipProps = (extended) => {
|
|
10
21
|
return mergeComponentProps(defaultProps, extended);
|
|
11
22
|
};
|
|
12
23
|
export {
|
|
13
|
-
getChipProps
|
|
24
|
+
getChipProps,
|
|
25
|
+
getChipSizeState
|
|
14
26
|
};
|
package/dist/lib/chip/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { ColorVariant,
|
|
3
|
-
export interface ChipResponsiveProps
|
|
2
|
+
import { ColorVariant, PropsWithSx, ShallowMerge, SizeVariant, ToResponsiveProps } from '../../types';
|
|
3
|
+
export interface ChipResponsiveProps {
|
|
4
4
|
size?: SizeVariant;
|
|
5
5
|
}
|
|
6
|
-
type ChipExtendedProps =
|
|
6
|
+
type ChipExtendedProps = PropsWithSx<ToResponsiveProps<ChipResponsiveProps> & {
|
|
7
7
|
color?: ColorVariant;
|
|
8
|
-
}
|
|
8
|
+
}>;
|
|
9
9
|
export type ChipProps = ShallowMerge<JSX.IntrinsicElements['div'], ChipExtendedProps>;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/chip/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAElG,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,KAAK,iBAAiB,GAAG,WAAW,CAClC,iBAAiB,CAAC,mBAAmB,CAAC,GAAG;IACvC,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../src/lib/container/container.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,cAAc,
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../src/lib/container/container.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,cAAc,EAAE,MAAM,SAAS,CAAC;AA4B5D,eAAO,MAAM,SAAS,iCAAkC,cAAc,qDAsErE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { isNil } from "lodash-es";
|
|
3
3
|
import { getContainerProps } from "./helpers.js";
|
|
4
|
-
import {
|
|
4
|
+
import { breakpoint, mediaQuery } from "../../theme/screens.js";
|
|
5
5
|
import "../../theme/palette.js";
|
|
6
|
+
import { createSxInterpolation } from "../../utils/stylesheet.js";
|
|
6
7
|
const CONTAINER_PADDING_VAR_NAME = "--container-padding";
|
|
7
8
|
const CONTAINER_PADDING_VAR = `var(${CONTAINER_PADDING_VAR_NAME})`;
|
|
8
9
|
const getContainerPaddingCSS = (position) => {
|
|
@@ -20,17 +21,12 @@ const getContainerContentPaddingCSS = (position) => {
|
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
const Container = ({ children, ref, ..._props }) => {
|
|
23
|
-
const {
|
|
24
|
+
const { position, sm, md, lg, sx, ...rest } = getContainerProps(_props);
|
|
24
25
|
const css = [
|
|
25
26
|
{
|
|
26
27
|
width: "100%"
|
|
27
28
|
},
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
[mediaQuery("sm")]: createStyle(sm),
|
|
31
|
-
[mediaQuery("md")]: createStyle(md),
|
|
32
|
-
[mediaQuery("lg")]: createStyle(lg)
|
|
33
|
-
}
|
|
29
|
+
createSxInterpolation(sx)
|
|
34
30
|
];
|
|
35
31
|
return /* @__PURE__ */ jsx("div", { css, ...rest, ref, children: /* @__PURE__ */ jsx(
|
|
36
32
|
"div",
|
|
@@ -39,7 +35,7 @@ const Container = ({ children, ref, ..._props }) => {
|
|
|
39
35
|
{
|
|
40
36
|
width: "100%",
|
|
41
37
|
[CONTAINER_PADDING_VAR_NAME]: "0px",
|
|
42
|
-
...getContainerPaddingCSS(
|
|
38
|
+
...getContainerPaddingCSS(position)
|
|
43
39
|
},
|
|
44
40
|
{
|
|
45
41
|
[mediaQuery("sm")]: {
|
|
@@ -64,7 +60,7 @@ const Container = ({ children, ref, ..._props }) => {
|
|
|
64
60
|
{
|
|
65
61
|
width: "100%",
|
|
66
62
|
[CONTAINER_CONTENT_PADDING_VAR_NAME]: `${breakpoint.xs.padding}px`,
|
|
67
|
-
...getContainerContentPaddingCSS(
|
|
63
|
+
...getContainerContentPaddingCSS(position)
|
|
68
64
|
},
|
|
69
65
|
{
|
|
70
66
|
[mediaQuery("sm")]: [
|
|
@@ -93,9 +89,6 @@ const Container = ({ children, ref, ..._props }) => {
|
|
|
93
89
|
}
|
|
94
90
|
) });
|
|
95
91
|
};
|
|
96
|
-
const createStyle = ({ css } = {}) => {
|
|
97
|
-
return [css];
|
|
98
|
-
};
|
|
99
92
|
export {
|
|
100
93
|
Container
|
|
101
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/container/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/container/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQzC,eAAO,MAAM,iBAAiB,aAAc,cAAc,KAAG,cAE5D,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PropsWithSx, ShallowMerge, ToResponsiveProps } from '../../types';
|
|
3
3
|
export type ContainerPosition = 'center' | 'start' | 'end';
|
|
4
|
-
export
|
|
4
|
+
export type ContainerResponsiveProps = {
|
|
5
5
|
position?: ContainerPosition;
|
|
6
|
-
}
|
|
7
|
-
type ContainerExtendedProps =
|
|
6
|
+
};
|
|
7
|
+
type ContainerExtendedProps = PropsWithSx<ToResponsiveProps<ContainerResponsiveProps>>;
|
|
8
8
|
export type ContainerProps = ShallowMerge<JSX.IntrinsicElements['div'], ContainerExtendedProps>;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/container/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/container/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE3D,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF,KAAK,sBAAsB,GAAG,WAAW,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEvF,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/lib/date-picker/date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAkC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/lib/date-picker/date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,OAAO,KAAkC,MAAM,OAAO,CAAC;AAOvD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmB1C,QAAA,MAAM,UAAU,WAAY,eAAe,QAAQ,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,qDA6MvF,CAAC;AAEF,QAAA,MAAM,oBAAoB,EAAwC,OAAO,UAAU,CAAC;AAEpF,OAAO,EAAE,oBAAoB,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -2,14 +2,15 @@ import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { forwardRef, useRef } from "react";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
|
-
import { isNil } from "lodash-es";
|
|
6
5
|
import { Calendar } from "react-date-range";
|
|
7
6
|
import { getDatePickerProps } from "./helpers.js";
|
|
8
7
|
import CalendarIcon from "../../assets/svg/calendar.svg.js";
|
|
9
8
|
import { getSizeVariantState } from "../../utils/index.js";
|
|
10
9
|
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
10
|
+
import "lodash-es";
|
|
11
11
|
import { getColorVar } from "../../theme/palette.js";
|
|
12
12
|
import CloseIcon from "../../assets/svg/times-close-delete.svg.js";
|
|
13
|
+
import { createSxInterpolation } from "../../utils/stylesheet.js";
|
|
13
14
|
import { TimePicker } from "../time-picker/time-picker.js";
|
|
14
15
|
import { Floating } from "../floating/floating/floating.js";
|
|
15
16
|
import { FloatingTrigger } from "../floating/floating-trigger/floating-trigger.js";
|
|
@@ -34,10 +35,15 @@ const DatePicker = (_props, ref) => {
|
|
|
34
35
|
onClear,
|
|
35
36
|
helperText,
|
|
36
37
|
error,
|
|
38
|
+
sx,
|
|
37
39
|
containerProps,
|
|
38
40
|
open,
|
|
39
41
|
onOpenChange,
|
|
40
42
|
placement = "bottom-end",
|
|
43
|
+
size,
|
|
44
|
+
sm,
|
|
45
|
+
md,
|
|
46
|
+
lg,
|
|
41
47
|
...rest
|
|
42
48
|
} = getDatePickerProps(_props);
|
|
43
49
|
const floatingRef = useRef(null);
|
|
@@ -73,10 +79,6 @@ const DatePicker = (_props, ref) => {
|
|
|
73
79
|
setSelectedDate(preset);
|
|
74
80
|
onChange == null ? void 0 : onChange(preset);
|
|
75
81
|
};
|
|
76
|
-
const getCss = (sizeVariant) => {
|
|
77
|
-
if (isNil(sizeVariant)) return {};
|
|
78
|
-
return getSizeVariantState(sizeVariant);
|
|
79
|
-
};
|
|
80
82
|
const portalContentRenderer = () => /* @__PURE__ */ jsxs(
|
|
81
83
|
"div",
|
|
82
84
|
{
|
|
@@ -101,7 +103,18 @@ const DatePicker = (_props, ref) => {
|
|
|
101
103
|
css: { paddingLeft: 12, paddingRight: 12, paddingBottom: 12, display: "flex", alignItems: "center", gap: 8 },
|
|
102
104
|
children: [
|
|
103
105
|
/* @__PURE__ */ jsx("span", { css: { fontSize: "0.75rem", lineHeight: "1rem" }, children: "Time:" }),
|
|
104
|
-
/* @__PURE__ */ jsx(
|
|
106
|
+
/* @__PURE__ */ jsx(
|
|
107
|
+
TimePicker,
|
|
108
|
+
{
|
|
109
|
+
onChange: onChangeTime,
|
|
110
|
+
placement: "top",
|
|
111
|
+
size,
|
|
112
|
+
sm: { size: sm == null ? void 0 : sm.size },
|
|
113
|
+
md: { size: md == null ? void 0 : md.size },
|
|
114
|
+
lg: { size: lg == null ? void 0 : lg.size },
|
|
115
|
+
value: selectedDate
|
|
116
|
+
}
|
|
117
|
+
)
|
|
105
118
|
]
|
|
106
119
|
}
|
|
107
120
|
)
|
|
@@ -113,7 +126,6 @@ const DatePicker = (_props, ref) => {
|
|
|
113
126
|
onClear == null ? void 0 : onClear();
|
|
114
127
|
};
|
|
115
128
|
const getSuffix = () => {
|
|
116
|
-
var _a, _b;
|
|
117
129
|
if (icon) {
|
|
118
130
|
return icon;
|
|
119
131
|
}
|
|
@@ -122,8 +134,17 @@ const DatePicker = (_props, ref) => {
|
|
|
122
134
|
Icon,
|
|
123
135
|
{
|
|
124
136
|
source: CloseIcon,
|
|
125
|
-
|
|
126
|
-
|
|
137
|
+
sx: { color: rest.disabled ? "var(--ic-ink-4s)" : "var(--ic-ink-5s)" },
|
|
138
|
+
size: getSizeVariantState(size).iconSize,
|
|
139
|
+
sm: {
|
|
140
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize
|
|
141
|
+
},
|
|
142
|
+
md: {
|
|
143
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize
|
|
144
|
+
},
|
|
145
|
+
lg: {
|
|
146
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize
|
|
147
|
+
},
|
|
127
148
|
onClick: handleClear
|
|
128
149
|
}
|
|
129
150
|
);
|
|
@@ -132,16 +153,34 @@ const DatePicker = (_props, ref) => {
|
|
|
132
153
|
Icon,
|
|
133
154
|
{
|
|
134
155
|
source: CalendarIcon,
|
|
135
|
-
|
|
136
|
-
|
|
156
|
+
size: getSizeVariantState(size).iconSize,
|
|
157
|
+
sm: {
|
|
158
|
+
size: getSizeVariantState(sm == null ? void 0 : sm.size).iconSize
|
|
159
|
+
},
|
|
160
|
+
md: {
|
|
161
|
+
size: getSizeVariantState(md == null ? void 0 : md.size).iconSize
|
|
162
|
+
},
|
|
163
|
+
lg: {
|
|
164
|
+
size: getSizeVariantState(lg == null ? void 0 : lg.size).iconSize
|
|
165
|
+
},
|
|
166
|
+
sx: { color: rest.disabled ? "var(--ic-ink-4s)" : "var(--ic-ink-5s)" }
|
|
137
167
|
}
|
|
138
168
|
);
|
|
139
169
|
};
|
|
170
|
+
const { sx: containerSx, ...restContainerProps } = containerProps ?? {};
|
|
140
171
|
return /* @__PURE__ */ jsxs(
|
|
141
172
|
"div",
|
|
142
173
|
{
|
|
143
|
-
...
|
|
144
|
-
css:
|
|
174
|
+
...restContainerProps,
|
|
175
|
+
css: [
|
|
176
|
+
{
|
|
177
|
+
display: "flex",
|
|
178
|
+
flexDirection: "column",
|
|
179
|
+
width: "100%"
|
|
180
|
+
},
|
|
181
|
+
createSxInterpolation(sx),
|
|
182
|
+
createSxInterpolation(containerSx)
|
|
183
|
+
],
|
|
145
184
|
children: [
|
|
146
185
|
/* @__PURE__ */ jsxs(
|
|
147
186
|
Floating,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/date-picker/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/date-picker/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ1C,eAAO,MAAM,kBAAkB,aAAc,eAAe,oBAE3D,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { Interpolation } from '@emotion/react';
|
|
3
2
|
import { Placement, UseFloatingOptions } from '@floating-ui/react';
|
|
4
3
|
import { InputRange } from 'react-date-range';
|
|
5
|
-
import {
|
|
4
|
+
import { PropsWithSx, SizeVariant, ToResponsiveProps } from '../../types';
|
|
6
5
|
export type PickerStaticRange = StaticRange;
|
|
7
6
|
export type PickerInputRange = InputRange;
|
|
8
|
-
export interface DateResponsiveProps
|
|
7
|
+
export interface DateResponsiveProps {
|
|
9
8
|
size?: Exclude<SizeVariant, 'xs'>;
|
|
10
9
|
}
|
|
11
10
|
type DatePickerBaseProps = {
|
|
@@ -27,13 +26,11 @@ type DatePickerBaseProps = {
|
|
|
27
26
|
timePicker?: boolean;
|
|
28
27
|
clearable?: boolean;
|
|
29
28
|
onClear?: () => void;
|
|
30
|
-
containerProps?: JSX.IntrinsicElements['div']
|
|
31
|
-
css?: Interpolation;
|
|
32
|
-
};
|
|
29
|
+
containerProps?: PropsWithSx<JSX.IntrinsicElements['div']>;
|
|
33
30
|
error?: boolean;
|
|
34
31
|
helperText?: string;
|
|
35
32
|
disabled?: boolean;
|
|
36
33
|
};
|
|
37
|
-
export type DatePickerProps = DatePickerBaseProps &
|
|
34
|
+
export type DatePickerProps = PropsWithSx<DatePickerBaseProps & ToResponsiveProps<DateResponsiveProps>>;
|
|
38
35
|
export {};
|
|
39
36
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/date-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/date-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEtE,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CACnC;AAED,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { FloatingContent } from "../../floating/floating-content/floating-conten
|
|
|
6
6
|
import { getColorVar } from "../../../theme/palette.js";
|
|
7
7
|
import { mediaQuery } from "../../../theme/screens.js";
|
|
8
8
|
const Dialog = (_props) => {
|
|
9
|
-
const {
|
|
9
|
+
const { size, sm, md, lg, children, ...props } = getDialogProps(_props);
|
|
10
10
|
return /* @__PURE__ */ jsx(
|
|
11
11
|
Floating,
|
|
12
12
|
{
|
|
@@ -56,7 +56,7 @@ const Dialog = (_props) => {
|
|
|
56
56
|
{
|
|
57
57
|
css: [
|
|
58
58
|
{
|
|
59
|
-
width: getDialogSizeInNumber(
|
|
59
|
+
width: getDialogSizeInNumber(size),
|
|
60
60
|
backgroundColor: getColorVar("surface.default"),
|
|
61
61
|
maxWidth: "100%",
|
|
62
62
|
overflow: "hidden",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAWlD,eAAO,MAAM,cAAc,aAAc,WAAW,gBAEnD,CAAC;AAEF,eAAO,MAAM,qBAAqB,UAAW,UAAU,uBAKtD,CAAC;AAEF,eAAO,MAAM,gBAAgB,qDAE5B,CAAC"}
|
|
@@ -4,9 +4,7 @@ import "../../../theme/palette.js";
|
|
|
4
4
|
import { mergeComponentProps } from "../../../utils/index.js";
|
|
5
5
|
import { useFloatingContext } from "../../floating/floating/helpers.js";
|
|
6
6
|
const defaultProps = {
|
|
7
|
-
|
|
8
|
-
size: "sm"
|
|
9
|
-
}
|
|
7
|
+
size: "sm"
|
|
10
8
|
};
|
|
11
9
|
const getDialogProps = (extended) => {
|
|
12
10
|
return mergeComponentProps(defaultProps, extended);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FloatingProps } from '../../floating';
|
|
2
2
|
import { breakpoint } from '../../../theme';
|
|
3
|
-
import {
|
|
3
|
+
import { ShallowMerge, ToResponsiveProps } from '../../../types';
|
|
4
4
|
export type DialogSize = keyof typeof breakpoint | number;
|
|
5
|
-
export type DialogProps = ShallowMerge<FloatingProps,
|
|
5
|
+
export type DialogProps = ShallowMerge<FloatingProps, ToResponsiveProps<{
|
|
6
6
|
size?: DialogSize;
|
|
7
7
|
}>>;
|
|
8
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,UAAU,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,YAAY,CACpC,aAAa,EACb,iBAAiB,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC,CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-header.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog-header/dialog-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQ5C,eAAO,MAAM,YAAY,sCAA8C,iBAAiB,
|
|
1
|
+
{"version":3,"file":"dialog-header.d.ts","sourceRoot":"","sources":["../../../../src/lib/dialog/dialog-header/dialog-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAQ5C,eAAO,MAAM,YAAY,sCAA8C,iBAAiB,qDAiDvF,CAAC"}
|
|
@@ -82,7 +82,7 @@ const CheckboxFilterPanel = ({
|
|
|
82
82
|
) });
|
|
83
83
|
};
|
|
84
84
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
85
|
-
searchEnabled && /* @__PURE__ */ jsx("div", { css: { marginBottom: 8 }, children: /* @__PURE__ */ jsx(Input, {
|
|
85
|
+
searchEnabled && /* @__PURE__ */ jsx("div", { css: { marginBottom: 8 }, children: /* @__PURE__ */ jsx(Input, { value: inputValue, ...inputSearchProps, onChange: onSearchChange }) }),
|
|
86
86
|
/* @__PURE__ */ jsx(
|
|
87
87
|
VirtualizedList,
|
|
88
88
|
{
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { isValidElement } from "react";
|
|
3
3
|
import { useToggle } from "../../hooks/use-toggle/index.js";
|
|
4
4
|
import { CheckboxFilterPanel } from "./checkbox-filter-panel.js";
|
|
5
|
-
import {
|
|
5
|
+
import { InputRangeFilterPanel } from "./input-range-filter-panel.js";
|
|
6
6
|
import { InputTextFilterPanel } from "./input-text-filter-panel.js";
|
|
7
7
|
import { RadioFilterPanel } from "./radio-filter-panel.js";
|
|
8
8
|
import ArrowDownIcon from "../../assets/svg/arrow-down.svg.js";
|
|
@@ -27,7 +27,7 @@ const FilterPanel = ({ label, defaultOpen = true, ...props }) => {
|
|
|
27
27
|
/* @__PURE__ */ jsx(Collapse, { open, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
28
|
props.fieldType === "checkbox" && /* @__PURE__ */ jsx(CheckboxFilterPanel, { ...props }),
|
|
29
29
|
props.fieldType === "radio" && /* @__PURE__ */ jsx(RadioFilterPanel, { ...props }),
|
|
30
|
-
props.fieldType === "
|
|
30
|
+
props.fieldType === "input-range" && /* @__PURE__ */ jsx(InputRangeFilterPanel, { ...props }),
|
|
31
31
|
props.fieldType === "input-text" && /* @__PURE__ */ jsx(InputTextFilterPanel, { ...props })
|
|
32
32
|
] }) })
|
|
33
33
|
] });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputRangeFilterPanelProps } from './types';
|
|
2
|
+
export declare const InputRangeFilterPanel: ({ value, queryParam, placeholder, onChange }: InputRangeFilterPanelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=input-range-filter-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-range-filter-panel.d.ts","sourceRoot":"","sources":["../../../src/lib/filter-panel/input-range-filter-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AASrD,eAAO,MAAM,qBAAqB,iDAAkD,0BAA0B,qDAuE7G,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { TYPING_DEBOUNCE } from "../../constants/index.js";
|
|
3
|
+
import { useQueryParams } from "../../hooks/use-query-params.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "lodash-es";
|
|
6
|
+
import "../../theme/palette.js";
|
|
7
|
+
import { NumberParamParser } from "../../utils/query-params.js";
|
|
8
|
+
import { InputRange } from "../input-range/input-range.js";
|
|
9
|
+
const InputRangeFilterPanel = ({ value, queryParam, placeholder, onChange }) => {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
const { queryParams, setQueryParams } = useQueryParams({
|
|
12
|
+
...((_a = queryParam == null ? void 0 : queryParam.from) == null ? void 0 : _a.key) ? {
|
|
13
|
+
[queryParam.from.key]: {
|
|
14
|
+
parser(value2) {
|
|
15
|
+
return new NumberParamParser(value2).parse();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
} : {},
|
|
19
|
+
...((_b = queryParam == null ? void 0 : queryParam.to) == null ? void 0 : _b.key) ? {
|
|
20
|
+
[queryParam.to.key]: {
|
|
21
|
+
parser(value2) {
|
|
22
|
+
return new NumberParamParser(value2).parse();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
} : {}
|
|
26
|
+
});
|
|
27
|
+
const finalValue = {
|
|
28
|
+
from: (value == null ? void 0 : value.from) ?? (((_c = queryParam == null ? void 0 : queryParam.from) == null ? void 0 : _c.key) ? queryParams[queryParam.from.key] : void 0),
|
|
29
|
+
to: (value == null ? void 0 : value.to) ?? (((_d = queryParam == null ? void 0 : queryParam.to) == null ? void 0 : _d.key) ? queryParams[queryParam.to.key] : void 0)
|
|
30
|
+
};
|
|
31
|
+
const onInputRangeChange = (event, edge) => {
|
|
32
|
+
var _a2, _b2;
|
|
33
|
+
const valueAsNumber = event.target.valueAsNumber;
|
|
34
|
+
if (edge === "from" && ((_a2 = queryParam == null ? void 0 : queryParam.from) == null ? void 0 : _a2.key)) {
|
|
35
|
+
setQueryParams(
|
|
36
|
+
{
|
|
37
|
+
[queryParam.from.key]: isNaN(valueAsNumber) ? void 0 : valueAsNumber
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
preventScrollReset: true
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
if (edge === "to" && ((_b2 = queryParam == null ? void 0 : queryParam.to) == null ? void 0 : _b2.key)) {
|
|
45
|
+
setQueryParams(
|
|
46
|
+
{
|
|
47
|
+
[queryParam.to.key]: isNaN(valueAsNumber) ? void 0 : valueAsNumber
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
preventScrollReset: true
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
onChange == null ? void 0 : onChange(event, edge);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
InputRange,
|
|
58
|
+
{
|
|
59
|
+
onChange: onInputRangeChange,
|
|
60
|
+
inputs: [
|
|
61
|
+
{
|
|
62
|
+
debounce: TYPING_DEBOUNCE,
|
|
63
|
+
value: finalValue.from ?? "",
|
|
64
|
+
placeholder: placeholder == null ? void 0 : placeholder.from
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
debounce: TYPING_DEBOUNCE,
|
|
68
|
+
value: finalValue.to ?? "",
|
|
69
|
+
placeholder: placeholder == null ? void 0 : placeholder.to
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
InputRangeFilterPanel
|
|
77
|
+
};
|
|
@@ -6,8 +6,8 @@ import { useQueryParams } from "../../hooks/use-query-params.js";
|
|
|
6
6
|
import "../../theme/palette.js";
|
|
7
7
|
import { matchSearch } from "../../utils/common.js";
|
|
8
8
|
import { StringParamParser } from "../../utils/query-params.js";
|
|
9
|
-
import { Input } from "../input/input.js";
|
|
10
9
|
import { RadioButton } from "../radio-button/radio-button.js";
|
|
10
|
+
import { Input } from "../input/input.js";
|
|
11
11
|
const ROW_HEIGHT = 32;
|
|
12
12
|
const DISPLAY_ROW_COUNT = 5;
|
|
13
13
|
const RadioFilterPanel = ({
|
|
@@ -72,7 +72,7 @@ const RadioFilterPanel = ({
|
|
|
72
72
|
) });
|
|
73
73
|
};
|
|
74
74
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
75
|
-
searchEnabled && /* @__PURE__ */ jsx("div", { css: { marginBottom: "0.5rem" }, children: /* @__PURE__ */ jsx(Input, {
|
|
75
|
+
searchEnabled && /* @__PURE__ */ jsx("div", { css: { marginBottom: "0.5rem" }, children: /* @__PURE__ */ jsx(Input, { value: inputValue, ...inputSearchProps, onChange: onInputChange }) }),
|
|
76
76
|
/* @__PURE__ */ jsx(
|
|
77
77
|
VirtualizedList,
|
|
78
78
|
{
|