@revolist/ui 4.0.1-rc → 4.0.1
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/LICENSE +21 -0
- package/MIGRATION.md +36 -0
- package/OWNERSHIP.md +32 -32
- package/README.md +405 -264
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/calendar-DJqiFwFT.js +258 -0
- package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
- package/_chunks/{chevron-right-sxHQMSkq.js → check-BwI7iCAm.js} +2 -2
- package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
- package/_chunks/choice-chips-yr6Uzmof.js +126 -0
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/color-palette-DMJUChWC.js +92 -0
- package/_chunks/{color-picker-BRv-__AM.js → color-picker-CMWxQlWt.js} +61 -56
- package/_chunks/component-DyWiItBR.js +878 -0
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BKd7U8OW.js} +0 -12
- package/_chunks/configurator-actions-DCodxcUw.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/control-CbOYUakE.js +118 -0
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/controls-DD1qvPfE.js +650 -0
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-XI2cpKI_.js} +21 -21
- package/_chunks/date-time-CGJdC1Qa.js +807 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
- package/_chunks/dialog.parts-CJ3FVxC9.js +131 -0
- package/_chunks/duration-CBJWK82T.js +272 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/editor-popup-ByU7qiub.js +82 -0
- package/_chunks/field-configurator-B-qtIwx1.js +288 -0
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/framework-mount-Bk4O_T7T.js +54 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-C7i5gsKI.js +267 -0
- package/_chunks/native-Blr3byjO.js +32 -0
- package/_chunks/native-control-B9MNibfa.js +649 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-CgbZes5B.js} +89 -89
- package/_chunks/picker-DqpjDC90.js +122 -0
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
- package/_chunks/popup-C35Isk7p.js +378 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-WDrfiluf.js} +10 -10
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/reorder-list-C4HSda4n.js +59 -0
- package/_chunks/request-trail-SHynDFdM.js +762 -0
- package/_chunks/rich-text-CtjqRvv8.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
- package/_chunks/selection-list-tooltips-BtWjpP6M.js +41 -0
- package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
- package/_chunks/tooltip-D4xkio5G.js +54 -0
- package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
- package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
- package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
- package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
- package/_dialog.scss +55 -21
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_shared/data-query/index.d.ts +2 -2
- package/_shared/data-query/load-options.d.ts +2 -2
- package/_variables.scss +34 -32
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +2 -2
- package/activity-message.js +16 -16
- package/ai/_chat.scss +227 -0
- package/ai/_style.scss +170 -39
- package/ai/chat.d.ts +65 -0
- package/ai/components.d.ts +35 -6
- package/ai/index.d.ts +3 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +59 -6
- package/ai/prompt-history.d.ts +13 -0
- package/ai/request-trail.d.ts +9 -3
- package/ai/results/_style.scss +83 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +27 -0
- package/ai/translation-context.d.ts +1 -1
- package/ai/translations.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -10
- package/assignee/assignee.scss +28 -6
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +86 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +42 -41
- package/badge.d.ts +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +2 -4
- package/brush-range/component.js +19 -19
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +2 -2
- package/buttons/remove-button.js +3 -3
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +3 -2
- package/buttons/svg-button.js +23 -23
- package/calendar/_calendar.scss +27 -26
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +34 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/cell-input.scss +3 -7
- package/cell-visuals/badge.style.scss +6 -3
- package/cell-visuals/bar-chart.style.scss +2 -1
- package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
- package/cell-visuals/progress-line.style.scss +1 -4
- package/cell-visuals/sparkline.style.scss +2 -1
- package/cell-visuals/timeline.style.css +4 -2
- package/checkbox/checkbox.scss +6 -24
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +4 -2
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/color-palette/color-picker.style.scss +23 -10
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/component-catalog.d.ts +42 -29
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +63 -0
- package/configurator-drop-zone.d.ts +39 -0
- package/configurator-drop-zone.js +66 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-attributes.js +7 -7
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +31 -26
- package/controls.d.ts +23 -11
- package/controls.js +4 -3
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +5 -1
- package/core/editor-popup.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/selection-list-tooltips.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/attach.d.ts +1 -1
- package/date-time/date-control.d.ts +2 -2
- package/date-time/field.d.ts +4 -3
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/style.scss +242 -39
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +6 -2
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +53 -53
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +6 -3
- package/distribution-chart/bar-chart.js +10 -6
- package/distribution-chart/chart-frame.d.ts +3 -2
- package/distribution-chart/index.d.ts +2 -2
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +3 -2
- package/dropdown/content.js +1 -141
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/dropdown.types.d.ts +5 -1
- package/dropdown/editor-dropdown.style.scss +54 -16
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +3 -4
- package/dropdown/lookup-field.d.ts +6 -1
- package/dropdown/lookup-field.js +42 -41
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -140
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +5 -5
- package/editor-layout/index.js +43 -38
- package/editor-layout/style.scss +82 -18
- package/field-configurator.d.ts +40 -2
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/field-reorder.hook.js +32 -32
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/control.js +2 -0
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/runtime.js +49 -22
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -2
- package/filter-controls.js +29 -30
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +17 -22
- package/form-controls/presentation.d.ts +2 -2
- package/form-controls/presentation.js +59 -51
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +106 -100
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/styles.scss +14 -57
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +237 -226
- package/history-controls.d.ts +14 -0
- package/history-controls.js +27 -0
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +2 -2
- package/icons/icon.js +1 -1
- package/legend.d.ts +2 -2
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +14 -13
- package/native-control.js +3 -26
- package/native-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native-styles.scss +6 -2
- package/native.d.ts +3 -3
- package/native.js +49 -45
- package/number-input/index.d.ts +2 -2
- package/number-input/index.js +1 -1
- package/package.json +88 -15
- package/pagination.d.ts +3 -0
- package/pagination.js +50 -40
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +2 -2
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +2 -2
- package/pdf-viewer/status.d.ts +2 -2
- package/pdf-viewer/style.scss +205 -45
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +6 -2
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +2 -2
- package/preact.d.ts +15 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +5 -3
- package/react-control.d.ts +1 -0
- package/react.d.ts +20 -11
- package/react.js +72 -88
- package/reorder-list.d.ts +2 -2
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +68 -66
- package/resource-picker/resource-picker.scss +66 -35
- package/rich-text/engine.d.ts +17 -19
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +11 -7
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +6 -3
- package/rich-text/render-model.d.ts +4 -5
- package/rich-text/style.scss +295 -55
- package/rich-text/syntax.d.ts +5 -2
- package/rich-text/toolbar.d.ts +7 -7
- package/rich-text/translations.d.ts +5 -15
- package/search-input/index.js +12 -12
- package/search-input/native.d.ts +21 -2
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +22 -0
- package/select.js +1 -0
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/exit-snapshot.js +1 -1
- package/status-feedback/index.js +2 -2
- package/status-feedback/popover.js +9 -9
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +3 -44
- package/status-feedback/status-feedback.scss +130 -34
- package/status-feedback/types.d.ts +4 -0
- package/status-feedback/use-auto-dismiss.d.ts +3 -0
- package/styles/_activity-message.scss +24 -7
- package/styles/_alert.scss +78 -17
- package/styles/_cell-editor-frame.scss +11 -0
- package/styles/_compositions.scss +404 -82
- package/styles/_control.scss +42 -12
- package/styles/_disclosure.scss +15 -5
- package/styles/_editor-counter.scss +16 -6
- package/styles/_editor-slider.scss +8 -4
- package/styles/_field-configurator.scss +321 -23
- package/styles/_fields-grid.scss +49 -0
- package/styles/_filter-controls.scss +10 -2
- package/styles/_icon-action.scss +48 -15
- package/styles/_loading.scss +12 -3
- package/styles/_motion.scss +32 -9
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +376 -116
- package/styles/_theme.scss +130 -86
- package/styles/_thresholds.scss +28 -25
- package/styles/_time-grid.scss +8 -3
- package/styles/_tokens.scss +6 -1
- package/styles/configurator-actions.scss +241 -0
- package/styles/pagination.css +213 -0
- package/styles/{legacy-rating.css → rating.css} +8 -3
- package/styles.css +1 -1
- package/styles.scss +3 -5
- package/surfaces.d.ts +38 -2
- package/surfaces.js +37 -134
- package/svelte/UiComponent.server.js +1 -48
- package/svelte/UiComponent.svelte +44 -32
- package/svelte.d.ts +1 -1
- package/svelte.js +33 -68
- package/switch/index.js +3 -2
- package/time-grid.d.ts +1 -2
- package/time-grid.js +43 -42
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +91 -74
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +160 -144
- package/vue.js +149 -178
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-palette-BmZ7kH9R.js +0 -94
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/control-tooltip-BCNzQCXE.js +0 -100
- package/_chunks/controls-NEL5tDaz.js +0 -615
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/dropdown-CkGQBm1Q.js +0 -357
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/editor-popup-B7fu_A_T.js +0 -81
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
- package/_chunks/rich-text-2Rla349o.js +0 -477
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -12
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/react-native-select.d.ts +0 -6
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- package/surfaces.view.d.ts +0 -63
- package/vue-native-select.d.ts +0 -9
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { ButtonControl as e, Select as t } from "../native-control.js";
|
|
2
|
-
import { createControlId as n } from "../core/control-id.js";
|
|
3
|
-
import { DEFAULT_CALENDAR_TRANSLATIONS as r } from "../calendar/translations.js";
|
|
4
|
-
import { a as i, n as a } from "./iso-B0YHBK7m.js";
|
|
5
|
-
import { a as o, c as s, d as c, f as l, l as u, n as d, p as f, r as p, s as m, t as h, u as g } from "./model-mPO2tG2f.js";
|
|
6
|
-
import { CalendarHeader as _, CalendarWeekdays as ee } from "../calendar/header.js";
|
|
7
|
-
import { CalendarMonthGrid as te } from "../calendar/month-grid.js";
|
|
8
|
-
import { CalendarYearGrid as ne } from "../calendar/year-grid.js";
|
|
9
|
-
import { useMemo as v, useRef as y, useState as b } from "preact/hooks";
|
|
10
|
-
import { jsx as x, jsxs as S } from "preact/jsx-runtime";
|
|
11
|
-
//#region src/calendar/caption.tsx
|
|
12
|
-
function re({ month: e, system: n, locale: r, layout: i, start: a, end: o, disabled: s, labels: d, onChange: f }) {
|
|
13
|
-
let p = u(e, n), h = c(e, n), _ = v(() => {
|
|
14
|
-
let t = u(e, n)[0], r = a ? u(a, n)[0] : m(t, -600, n), i = o ? u(o, n)[0] : m(t, 120, n), s = [];
|
|
15
|
-
for (let e = r; e <= i; e = m(e, 12, n)) s.push(e);
|
|
16
|
-
return s.includes(t) || s.push(t), s.sort();
|
|
17
|
-
}, [
|
|
18
|
-
e,
|
|
19
|
-
n,
|
|
20
|
-
a,
|
|
21
|
-
o
|
|
22
|
-
]);
|
|
23
|
-
return /* @__PURE__ */ S("div", {
|
|
24
|
-
class: "revo-calendar__caption",
|
|
25
|
-
children: [i === "dropdown-years" ? /* @__PURE__ */ x("span", { children: g(e, r, { month: "long" }, n) }) : /* @__PURE__ */ x(t, {
|
|
26
|
-
"aria-label": d.chooseMonth,
|
|
27
|
-
disabled: s,
|
|
28
|
-
value: String(h.month),
|
|
29
|
-
onChange: (e) => f(p[Number(e.currentTarget.value) - 1]),
|
|
30
|
-
children: p.map((e, t) => /* @__PURE__ */ x("option", {
|
|
31
|
-
value: String(t + 1),
|
|
32
|
-
disabled: !!(a && e < l(a, n) || o && e > l(o, n)),
|
|
33
|
-
children: g(e, r, { month: "short" }, n)
|
|
34
|
-
}, e))
|
|
35
|
-
}), i === "dropdown-months" ? /* @__PURE__ */ x("span", { children: g(e, r, { year: "numeric" }, n) }) : /* @__PURE__ */ x(t, {
|
|
36
|
-
"aria-label": d.chooseYear,
|
|
37
|
-
disabled: s,
|
|
38
|
-
value: p[0],
|
|
39
|
-
onChange: (e) => {
|
|
40
|
-
let t = e.currentTarget.value, r = m(t, h.month - 1, n);
|
|
41
|
-
a && r < l(a, n) && (r = l(a, n)), o && r > l(o, n) && (r = l(o, n)), f(r);
|
|
42
|
-
},
|
|
43
|
-
children: _.map((e) => /* @__PURE__ */ x("option", {
|
|
44
|
-
value: e,
|
|
45
|
-
children: g(e, r, { year: "numeric" }, n)
|
|
46
|
-
}, e))
|
|
47
|
-
})]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/calendar/calendar.tsx
|
|
52
|
-
var ie = "2026-08-02";
|
|
53
|
-
function C({ locale: t = "en-US", weekStartsOn: c = 1, showOutsideDays: u = !1, allowOutsideMonthSelection: C = !1, fixedWeeks: ae = !0, showTodayButton: oe = !1, showHeader: se = !0, showNavigation: w = !0, showPreviousButton: ce = w, showNextButton: le = w, showMonthLabel: ue = !0, showWeekdays: de = !0, enableYearView: T = !0, translations: fe = {}, ...E }) {
|
|
54
|
-
let [D] = b(() => n("rv-calendar-feedback")), O = E.calendarSystem ?? "gregory", k = Math.max(1, Math.min(12, Math.trunc(E.numberOfMonths || 1))), A = v(() => {
|
|
55
|
-
let e = E.views ? [...new Set(E.views.filter((e) => e === "month" || e === "year"))] : T ? ["month", "year"] : ["month"];
|
|
56
|
-
return e.length ? e : ["month"];
|
|
57
|
-
}, [E.views, T]), [j, pe] = b(E.defaultView && A.includes(E.defaultView) ? E.defaultView : A[0]), M = A.includes(j) ? j : A[0], N = l(E.month, O), P = v(() => Array.from({ length: k }, (e, t) => m(N, t, O)), [
|
|
58
|
-
N,
|
|
59
|
-
k,
|
|
60
|
-
O
|
|
61
|
-
]), me = E.reverseMonths ? [...P].reverse() : P, he = v(() => Array.from({ length: 7 }, (e, t) => f(ie, (c + t) % 7)), [c]), F = E.referenceDate ?? (E.referenceInstant ? a(E.referenceInstant, E.timeZone ?? "UTC") : void 0), I = y(/* @__PURE__ */ new Map()), L = y(!1), R = {
|
|
62
|
-
...r,
|
|
63
|
-
...fe
|
|
64
|
-
}, z = (e) => p(e, {
|
|
65
|
-
minDate: E.minDate,
|
|
66
|
-
maxDate: E.maxDate,
|
|
67
|
-
isMonthDisabled: E.isMonthDisabled,
|
|
68
|
-
calendarSystem: O
|
|
69
|
-
}), B = [E.startMonth, E.minDate].filter((e) => !!e).map((e) => l(e, O)).sort().at(-1), V = [E.endMonth, E.maxDate].filter((e) => !!e).map((e) => l(e, O)).sort().at(0), H = (e) => !!(E.disableNavigation || z(e) || B && e < B || V && e > V), U = (e, t = k) => {
|
|
70
|
-
let n = V ? m(V, 1 - t, O) : void 0;
|
|
71
|
-
return n && B && n < B && (n = B), n && e > n && (e = n), B && e < B && (e = B), e;
|
|
72
|
-
}, W = /* @__PURE__ */ new Map(), G = (e) => {
|
|
73
|
-
let t = W.get(e);
|
|
74
|
-
if (t !== void 0) return t;
|
|
75
|
-
let n = z(l(e, O)) || d(e, {
|
|
76
|
-
minDate: E.minDate,
|
|
77
|
-
maxDate: E.maxDate,
|
|
78
|
-
isDisabled: E.isDateDisabled
|
|
79
|
-
});
|
|
80
|
-
return W.set(e, n), n;
|
|
81
|
-
}, ge = P.includes(l(E.focusedDate, O)) && !G(E.focusedDate) ? E.focusedDate : P.flatMap((e) => h(e, c, !1, O)).find((e) => P.includes(l(e, O)) && !G(e)) ?? E.focusedDate, K = (e) => {
|
|
82
|
-
e !== M && A.includes(e) && (pe(e), E.onViewChange?.(e));
|
|
83
|
-
}, q = (e, t = E.onSelect) => {
|
|
84
|
-
if (G(e)) return E.onInvalidSelection?.(R.invalidSelection, e), !1;
|
|
85
|
-
let n = E.validateSelection?.(e, {
|
|
86
|
-
month: N,
|
|
87
|
-
view: M,
|
|
88
|
-
selection: E.selection,
|
|
89
|
-
preview: E.preview,
|
|
90
|
-
referenceDate: F
|
|
91
|
-
});
|
|
92
|
-
return n === !1 || typeof n == "string" ? (E.onInvalidSelection?.(typeof n == "string" ? n : R.invalidSelection, e), !1) : (t(e), !0);
|
|
93
|
-
}, _e = (e, t) => {
|
|
94
|
-
t ? I.current.set(e, t) : I.current.delete(e), t && L.current && e === E.focusedDate && (L.current = !1, queueMicrotask(() => t.focus()));
|
|
95
|
-
}, ve = (e, t) => {
|
|
96
|
-
let n = E.dir ?? (e.currentTarget.ownerDocument.defaultView?.getComputedStyle(e.currentTarget).direction === "rtl" ? "rtl" : "ltr"), r = o({
|
|
97
|
-
date: t,
|
|
98
|
-
key: e.key,
|
|
99
|
-
shiftKey: e.shiftKey,
|
|
100
|
-
weekStartsOn: c,
|
|
101
|
-
minDate: E.minDate,
|
|
102
|
-
maxDate: E.maxDate,
|
|
103
|
-
isDisabled: G,
|
|
104
|
-
dir: n,
|
|
105
|
-
calendarSystem: O
|
|
106
|
-
});
|
|
107
|
-
if (!r) return;
|
|
108
|
-
e.preventDefault();
|
|
109
|
-
let i = l(r, O);
|
|
110
|
-
(P.includes(i) || !H(i)) && (L.current = !0, P.includes(i) || E.onMonthChange(U(i)), E.onFocusedDateChange(r), queueMicrotask(() => {
|
|
111
|
-
let e = I.current.get(r);
|
|
112
|
-
e && (L.current = !1, e.focus());
|
|
113
|
-
}));
|
|
114
|
-
}, J = (e) => E.formatMonth?.(e, t) ?? g(e, t, {
|
|
115
|
-
month: "long",
|
|
116
|
-
year: "numeric"
|
|
117
|
-
}, O), Y = M === "year", ye = Y ? 12 : E.pagedNavigation ? k : 1, X = U(m(N, -ye, O), Y ? 1 : k), Z = U(m(N, ye, O), Y ? 1 : k), Q = (e, t = Y ? 1 : k) => {
|
|
118
|
-
let n = U(e, t);
|
|
119
|
-
H(n) || E.onMonthChange(n);
|
|
120
|
-
}, $ = (e) => {
|
|
121
|
-
q(e, E.onPresetSelect ?? E.onSelect) && (E.onMonthChange(U(l(e, O))), E.onFocusedDateChange(e), K("month"));
|
|
122
|
-
};
|
|
123
|
-
return /* @__PURE__ */ S("div", {
|
|
124
|
-
class: `revo-calendar${E.showWeekNumber ? " revo-calendar--week-numbers" : ""}${E.className ? ` ${E.className}` : ""}`,
|
|
125
|
-
dir: E.dir,
|
|
126
|
-
style: E.cellSize ? { "--revo-calendar-cell-size": `${Math.max(24, E.cellSize)}px` } : void 0,
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ x("div", {
|
|
129
|
-
class: "revo-calendar__months",
|
|
130
|
-
children: (Y ? [N] : me).map((e, n) => /* @__PURE__ */ S("section", {
|
|
131
|
-
class: "revo-calendar__month-panel",
|
|
132
|
-
children: [se && /* @__PURE__ */ x(_, {
|
|
133
|
-
label: Y ? g(e, t, { year: "numeric" }, O) : J(e),
|
|
134
|
-
previousLabel: Y ? R.previousYear : R.previousMonth,
|
|
135
|
-
nextLabel: Y ? R.nextYear : R.nextMonth,
|
|
136
|
-
caption: !Y && E.captionLayout && E.captionLayout !== "label" ? /* @__PURE__ */ x(re, {
|
|
137
|
-
month: e,
|
|
138
|
-
system: O,
|
|
139
|
-
locale: t,
|
|
140
|
-
layout: E.captionLayout,
|
|
141
|
-
start: B,
|
|
142
|
-
end: V,
|
|
143
|
-
disabled: E.disableNavigation,
|
|
144
|
-
labels: R,
|
|
145
|
-
onChange: (t) => Q(m(t, -P.indexOf(e), O))
|
|
146
|
-
}) : void 0,
|
|
147
|
-
labelAction: !E.disableNavigation && !Y && A.includes("year") ? {
|
|
148
|
-
ariaLabel: `${R.chooseMonth}: ${J(e)}`,
|
|
149
|
-
onClick: () => K("year")
|
|
150
|
-
} : void 0,
|
|
151
|
-
showLabel: ue,
|
|
152
|
-
showPrevious: ce && n === 0,
|
|
153
|
-
showNext: le && n === (Y ? 0 : k - 1),
|
|
154
|
-
previousDisabled: X >= N || H(X),
|
|
155
|
-
nextDisabled: Z <= N || H(Z),
|
|
156
|
-
onPrevious: () => Q(X),
|
|
157
|
-
onNext: () => Q(Z)
|
|
158
|
-
}), Y ? /* @__PURE__ */ x(ne, {
|
|
159
|
-
month: N,
|
|
160
|
-
system: O,
|
|
161
|
-
referenceDate: F,
|
|
162
|
-
minDate: E.minDate,
|
|
163
|
-
maxDate: E.maxDate,
|
|
164
|
-
isMonthDisabled: E.isMonthDisabled,
|
|
165
|
-
locale: t,
|
|
166
|
-
ariaLabel: `${R.chooseMonth} ${g(N, t, { year: "numeric" }, O)}`,
|
|
167
|
-
onEscape: () => K("month"),
|
|
168
|
-
onSelect: (e) => {
|
|
169
|
-
Q(e, k), K("month");
|
|
170
|
-
}
|
|
171
|
-
}) : /* @__PURE__ */ S("div", {
|
|
172
|
-
class: "revo-calendar__calendar",
|
|
173
|
-
role: "grid",
|
|
174
|
-
"aria-label": `${J(e)} ${R.calendar}`,
|
|
175
|
-
children: [de && /* @__PURE__ */ x(ee, {
|
|
176
|
-
dates: he,
|
|
177
|
-
locale: t,
|
|
178
|
-
format: E.formatWeekday ?? ((e, t) => g(e, t, { weekday: /^(fa|ar)(-|$)/.test(t) ? "narrow" : "short" }, O)),
|
|
179
|
-
weekNumberLabel: E.showWeekNumber ? R.weekNumber : void 0
|
|
180
|
-
}), /* @__PURE__ */ x(te, {
|
|
181
|
-
dates: h(e, c, ae, O),
|
|
182
|
-
month: e,
|
|
183
|
-
system: O,
|
|
184
|
-
visibleMonths: P,
|
|
185
|
-
focusedDate: ge,
|
|
186
|
-
referenceDate: F,
|
|
187
|
-
selection: E.selection,
|
|
188
|
-
selectedDates: E.selectedDates,
|
|
189
|
-
preview: E.preview,
|
|
190
|
-
previewInvalid: E.previewInvalid,
|
|
191
|
-
previewDescriptionId: E.previewDescription ? D : void 0,
|
|
192
|
-
showOutsideDays: u,
|
|
193
|
-
allowOutsideMonthSelection: C,
|
|
194
|
-
dayClassName: E.dayClassName,
|
|
195
|
-
renderDay: E.renderDay ?? ((e) => g(e, t, { day: "numeric" }, O)),
|
|
196
|
-
isDisabled: G,
|
|
197
|
-
formatDayLabel: (e) => E.formatDayLabel?.(e, t) ?? g(e, t, {
|
|
198
|
-
weekday: "long",
|
|
199
|
-
month: "long",
|
|
200
|
-
day: "numeric",
|
|
201
|
-
year: "numeric"
|
|
202
|
-
}, O),
|
|
203
|
-
weekNumber: E.showWeekNumber ? (e) => {
|
|
204
|
-
let n = s(E.weekNumbering === "local" ? e : f(e, (4 - i(e) + 7) % 7), E.weekNumbering === "local" ? c : 1, E.weekNumbering === "local" ? 1 : 4, E.weekNumbering === "local" ? O : "gregory");
|
|
205
|
-
return E.formatWeekNumber?.(n) ?? new Intl.NumberFormat(t).format(n);
|
|
206
|
-
} : void 0,
|
|
207
|
-
weekNumberLabel: R.weekNumber,
|
|
208
|
-
setDayRef: _e,
|
|
209
|
-
onFocus: E.onFocusedDateChange,
|
|
210
|
-
onPreview: (e) => E.onPreviewDateChange?.(e),
|
|
211
|
-
onKeyDown: ve,
|
|
212
|
-
onSelect: q
|
|
213
|
-
})]
|
|
214
|
-
})]
|
|
215
|
-
}, e))
|
|
216
|
-
}),
|
|
217
|
-
E.presets?.length ? /* @__PURE__ */ x("div", {
|
|
218
|
-
class: "revo-calendar__presets",
|
|
219
|
-
children: E.presets.map((t) => /* @__PURE__ */ x(e, {
|
|
220
|
-
disabled: G(t.date),
|
|
221
|
-
onClick: () => $(t.date),
|
|
222
|
-
children: t.label
|
|
223
|
-
}, t.label))
|
|
224
|
-
}) : null,
|
|
225
|
-
oe && F && /* @__PURE__ */ x("button", {
|
|
226
|
-
type: "button",
|
|
227
|
-
class: "revo-calendar__today",
|
|
228
|
-
disabled: G(F),
|
|
229
|
-
onClick: () => $(F),
|
|
230
|
-
children: R.today
|
|
231
|
-
}),
|
|
232
|
-
E.previewDescription !== void 0 && /* @__PURE__ */ x("p", {
|
|
233
|
-
id: D,
|
|
234
|
-
class: "revo-calendar__feedback",
|
|
235
|
-
role: "status",
|
|
236
|
-
"aria-live": "polite",
|
|
237
|
-
"aria-atomic": "true",
|
|
238
|
-
children: E.previewDescription
|
|
239
|
-
}),
|
|
240
|
-
E.footer && /* @__PURE__ */ x("div", {
|
|
241
|
-
class: "revo-calendar__footer",
|
|
242
|
-
children: E.footer
|
|
243
|
-
})
|
|
244
|
-
]
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
|
-
export { C as t };
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { useRef as e, useState as t } from "preact/hooks";
|
|
2
|
-
import { Fragment as n, jsx as r, jsxs as i } from "preact/jsx-runtime";
|
|
3
|
-
//#region src/distribution-chart/geometry.ts
|
|
4
|
-
function a(e) {
|
|
5
|
-
let t = e.map(({ value: e }) => Number.isFinite(e) ? Math.max(0, e) : 0), n = Math.max(1, ...t);
|
|
6
|
-
return {
|
|
7
|
-
values: t,
|
|
8
|
-
max: n,
|
|
9
|
-
points: t.map((t, r) => ({
|
|
10
|
-
x: e.length <= 1 ? 50 : r / (e.length - 1) * 100,
|
|
11
|
-
y: 96 - t / n * 88
|
|
12
|
-
}))
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function o(e, t) {
|
|
16
|
-
return t === "step" ? `H ${e.x} V ${e.y}` : `L ${e.x} ${e.y}`;
|
|
17
|
-
}
|
|
18
|
-
function s(e, t, n = "linear") {
|
|
19
|
-
return `M ${e.x} ${e.y} ${o(t, n)}`;
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/distribution-chart/chart-frame.tsx
|
|
23
|
-
function c({ title: e, details: t = [] }) {
|
|
24
|
-
return [e, ...t].filter(Boolean).join(". ");
|
|
25
|
-
}
|
|
26
|
-
function l({ title: e, details: t = [] }) {
|
|
27
|
-
return /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("strong", { children: e }), t.map((e) => /* @__PURE__ */ r("span", { children: e }, e))] });
|
|
28
|
-
}
|
|
29
|
-
function u({ data: n, ariaLabel: o, variant: s, height: u = 72, className: d = "", showGrid: f = !1, showLabels: p = !1, showValues: m = !1, legend: h, formatValue: g = String, tooltip: _ = !0, tooltipIndicator: v = "none", renderTooltip: y, positions: b, renderDatum: x, children: S }) {
|
|
30
|
-
let { values: C, max: w } = a(n), [T, E] = t(0), D = e([]), O = Math.min(T, Math.max(0, n.length - 1)), k = (e) => {
|
|
31
|
-
if (!n.length) return;
|
|
32
|
-
let t = Math.max(0, Math.min(e, n.length - 1));
|
|
33
|
-
E(t), D.current[t]?.focus();
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ i("div", {
|
|
36
|
-
class: `rv-distribution-chart rv-distribution-chart--${s} ${d}`.trim(),
|
|
37
|
-
role: "group",
|
|
38
|
-
"aria-label": o,
|
|
39
|
-
"data-empty": n.length ? void 0 : "true",
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ i("div", {
|
|
42
|
-
class: "rv-distribution-chart__region",
|
|
43
|
-
style: { height: `${Math.max(40, Math.min(240, u))}px` },
|
|
44
|
-
children: [
|
|
45
|
-
f && /* @__PURE__ */ r("div", {
|
|
46
|
-
class: "rv-distribution-chart__grid",
|
|
47
|
-
"aria-hidden": "true",
|
|
48
|
-
children: [
|
|
49
|
-
0,
|
|
50
|
-
1,
|
|
51
|
-
2,
|
|
52
|
-
3,
|
|
53
|
-
4
|
|
54
|
-
].map((e) => /* @__PURE__ */ r("span", {}, e))
|
|
55
|
-
}),
|
|
56
|
-
S,
|
|
57
|
-
/* @__PURE__ */ r("div", {
|
|
58
|
-
class: "rv-distribution-chart__data",
|
|
59
|
-
role: "list",
|
|
60
|
-
children: n.map((e, t) => {
|
|
61
|
-
let a = b?.[t], o = !a;
|
|
62
|
-
return /* @__PURE__ */ i("span", {
|
|
63
|
-
ref: (e) => {
|
|
64
|
-
D.current[t] = e;
|
|
65
|
-
},
|
|
66
|
-
class: `rv-distribution-chart__datum${e.selected ? " is-selected" : ""}${o ? " is-bar" : " is-point"}`,
|
|
67
|
-
role: "listitem",
|
|
68
|
-
tabIndex: t === O ? 0 : -1,
|
|
69
|
-
"aria-label": c(e.tooltip),
|
|
70
|
-
style: o ? void 0 : {
|
|
71
|
-
left: `${a.x}%`,
|
|
72
|
-
top: `${a.y}%`
|
|
73
|
-
},
|
|
74
|
-
onFocus: () => E(t),
|
|
75
|
-
onKeyDown: (e) => {
|
|
76
|
-
e.key === "ArrowRight" || e.key === "ArrowDown" ? (e.preventDefault(), k(t + 1)) : e.key === "ArrowLeft" || e.key === "ArrowUp" ? (e.preventDefault(), k(t - 1)) : e.key === "Home" ? (e.preventDefault(), k(0)) : e.key === "End" && (e.preventDefault(), k(n.length - 1));
|
|
77
|
-
},
|
|
78
|
-
children: [
|
|
79
|
-
x(e, t),
|
|
80
|
-
m && /* @__PURE__ */ r("span", {
|
|
81
|
-
class: "rv-distribution-chart__value",
|
|
82
|
-
style: o ? {
|
|
83
|
-
top: `${100 - Math.max(3, C[t] / w * 100)}%`,
|
|
84
|
-
transform: "translate(-50%, -100%)"
|
|
85
|
-
} : void 0,
|
|
86
|
-
"aria-hidden": "true",
|
|
87
|
-
children: g(e.value)
|
|
88
|
-
}),
|
|
89
|
-
_ && /* @__PURE__ */ i("span", {
|
|
90
|
-
class: `rv-distribution-chart__tooltip rv-distribution-chart__tooltip--${v}`,
|
|
91
|
-
role: "tooltip",
|
|
92
|
-
children: [v !== "none" && /* @__PURE__ */ r("i", { "aria-hidden": "true" }), y ? y(e, t) : l(e.tooltip)]
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}, e.key);
|
|
96
|
-
})
|
|
97
|
-
})
|
|
98
|
-
]
|
|
99
|
-
}),
|
|
100
|
-
p && /* @__PURE__ */ r("div", {
|
|
101
|
-
class: `rv-distribution-chart__labels${s === "bar" ? " is-bar" : ""}`,
|
|
102
|
-
"aria-hidden": "true",
|
|
103
|
-
children: n.map((e) => /* @__PURE__ */ r("span", {
|
|
104
|
-
title: e.tooltip.title,
|
|
105
|
-
children: e.tooltip.title
|
|
106
|
-
}, e.key))
|
|
107
|
-
}),
|
|
108
|
-
h && /* @__PURE__ */ i("div", {
|
|
109
|
-
class: "rv-distribution-chart__legend",
|
|
110
|
-
children: [/* @__PURE__ */ r("i", { "aria-hidden": "true" }), h]
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function d({ children: e }) {
|
|
116
|
-
return /* @__PURE__ */ r("svg", {
|
|
117
|
-
class: "rv-distribution-chart__plot",
|
|
118
|
-
viewBox: "0 0 100 100",
|
|
119
|
-
preserveAspectRatio: "none",
|
|
120
|
-
"aria-hidden": "true",
|
|
121
|
-
focusable: "false",
|
|
122
|
-
children: e
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
|
-
export { s as i, d as n, a as r, u as t };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { SvgIcon as e } from "../icons/icon.js";
|
|
2
|
-
import { ButtonControl as t } from "../native-control.js";
|
|
3
|
-
import { TooltipController as n } from "../surfaces.js";
|
|
4
|
-
import { RemoveButton as r } from "../buttons/remove-button.js";
|
|
5
|
-
import { useLayoutEffect as i, useRef as a } from "preact/hooks";
|
|
6
|
-
import { jsx as o, jsxs as s } from "preact/jsx-runtime";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/circle-info.svg?raw
|
|
8
|
-
var c = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z\"/></svg>";
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/choice-chips/index.tsx
|
|
11
|
-
function l({ value: e, options: t, onChange: n, ariaLabel: r, appearance: i = "soft", size: a = "medium", className: s = "", itemClassName: c = "", disabled: l = !1, testId: u }) {
|
|
12
|
-
let f = Array.isArray(e) ? e : e === void 0 ? [] : [e];
|
|
13
|
-
return /* @__PURE__ */ o("div", {
|
|
14
|
-
class: `rv-choice-chips rv-choice-chips--${i} rv-choice-chips--${a} ${s}`.trim(),
|
|
15
|
-
role: "group",
|
|
16
|
-
"aria-label": r,
|
|
17
|
-
"data-testid": u,
|
|
18
|
-
children: t.map((e) => {
|
|
19
|
-
let t = f.includes(e.value), r = l || !!e.disabled;
|
|
20
|
-
return /* @__PURE__ */ o(d, {
|
|
21
|
-
className: `${c} ${e.className ?? ""}`.trim(),
|
|
22
|
-
style: e.style,
|
|
23
|
-
color: e.color,
|
|
24
|
-
selected: t,
|
|
25
|
-
"aria-label": e.ariaLabel,
|
|
26
|
-
title: e.title,
|
|
27
|
-
disabled: r,
|
|
28
|
-
"data-value": String(e.value),
|
|
29
|
-
"data-testid": e.testId,
|
|
30
|
-
onSelect: () => {
|
|
31
|
-
r || n(e.value, e);
|
|
32
|
-
},
|
|
33
|
-
info: e.info,
|
|
34
|
-
onRemove: e.onRemove,
|
|
35
|
-
removeLabel: e.removeLabel,
|
|
36
|
-
children: e.label
|
|
37
|
-
}, String(e.value));
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function u({ "data-tooltip": r, title: s, ref: l, ...u }) {
|
|
42
|
-
let d = a(null), f = r ?? (typeof s == "object" ? s.value : s);
|
|
43
|
-
return i(() => {
|
|
44
|
-
if (!d.current || !f) return;
|
|
45
|
-
let e = new n();
|
|
46
|
-
return e.bind(d.current, f, { trigger: "click" }), () => e.destroy();
|
|
47
|
-
}, [f]), /* @__PURE__ */ o(t, {
|
|
48
|
-
...u,
|
|
49
|
-
type: "button",
|
|
50
|
-
ref: (e) => {
|
|
51
|
-
d.current = e, typeof l == "function" ? l(e) : l && (l.current = e);
|
|
52
|
-
},
|
|
53
|
-
class: `rv-choice-chip-info ${u.className ?? u.class ?? ""}`.trim(),
|
|
54
|
-
children: /* @__PURE__ */ o(e, {
|
|
55
|
-
svg: c,
|
|
56
|
-
size: 12
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
function d({ children: e, color: t, selected: n, onSelect: i, info: a, onRemove: c, removeLabel: l, removeClassName: u = "", className: d = "", disabled: f, ...p }) {
|
|
61
|
-
let m = t ? typeof p.style == "string" ? `${p.style};--rv-choice-chip-color:${t}` : {
|
|
62
|
-
...p.style,
|
|
63
|
-
"--rv-choice-chip-color": t
|
|
64
|
-
} : p.style;
|
|
65
|
-
return !a && !c && i ? /* @__PURE__ */ o("button", {
|
|
66
|
-
...p,
|
|
67
|
-
style: m,
|
|
68
|
-
"data-color": t ? "true" : void 0,
|
|
69
|
-
type: "button",
|
|
70
|
-
class: `rv-choice-chip ${d}`.trim(),
|
|
71
|
-
"aria-pressed": n,
|
|
72
|
-
disabled: f,
|
|
73
|
-
onClick: i,
|
|
74
|
-
children: e
|
|
75
|
-
}) : /* @__PURE__ */ s("span", {
|
|
76
|
-
class: `rv-choice-chip rv-choice-chip--composite ${d}`.trim(),
|
|
77
|
-
role: p.role,
|
|
78
|
-
style: m,
|
|
79
|
-
"data-color": t ? "true" : void 0,
|
|
80
|
-
"data-selected": n ? "true" : void 0,
|
|
81
|
-
"aria-disabled": f || void 0,
|
|
82
|
-
children: [
|
|
83
|
-
i ? /* @__PURE__ */ o("button", {
|
|
84
|
-
...p,
|
|
85
|
-
type: "button",
|
|
86
|
-
class: "rv-choice-chip-label",
|
|
87
|
-
"aria-pressed": n,
|
|
88
|
-
disabled: f,
|
|
89
|
-
onClick: i,
|
|
90
|
-
children: e
|
|
91
|
-
}) : /* @__PURE__ */ o("span", {
|
|
92
|
-
class: "rv-choice-chip-label",
|
|
93
|
-
children: e
|
|
94
|
-
}),
|
|
95
|
-
a,
|
|
96
|
-
c && /* @__PURE__ */ o(r, {
|
|
97
|
-
compact: !0,
|
|
98
|
-
className: u,
|
|
99
|
-
disabled: typeof f == "object" ? f.value : f,
|
|
100
|
-
locale: {
|
|
101
|
-
title: l ?? "Remove",
|
|
102
|
-
ariaLabel: l ?? "Remove"
|
|
103
|
-
},
|
|
104
|
-
onClick: c
|
|
105
|
-
})
|
|
106
|
-
]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
//#endregion
|
|
110
|
-
export { u as n, l as r, d as t };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./control-tooltip-BCNzQCXE.js";
|
|
2
|
-
import { DEFAULT_COLOR_PALETTE_OPTIONS as t } from "../color-palette/palette.js";
|
|
3
|
-
import { jsx as n, jsxs as r } from "preact/jsx-runtime";
|
|
4
|
-
//#region src/color-palette/color-model.ts
|
|
5
|
-
function i(e) {
|
|
6
|
-
if (!e) return;
|
|
7
|
-
let t = e.trim().toLowerCase(), n = /^#([\da-f])([\da-f])([\da-f])$/i.exec(t);
|
|
8
|
-
return n ? `#${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}` : /^#[\da-f]{6}$/i.test(t) ? t : void 0;
|
|
9
|
-
}
|
|
10
|
-
function a(e) {
|
|
11
|
-
if (![
|
|
12
|
-
"ArrowRight",
|
|
13
|
-
"ArrowDown",
|
|
14
|
-
"ArrowLeft",
|
|
15
|
-
"ArrowUp",
|
|
16
|
-
"Home",
|
|
17
|
-
"End"
|
|
18
|
-
].includes(e.key)) return;
|
|
19
|
-
let t = e.target, n = t.closest(".rv-color-palette"), r = Array.from(n?.querySelectorAll("button:not(:disabled)") ?? []);
|
|
20
|
-
if (!r.length) return;
|
|
21
|
-
let i = Math.max(0, r.indexOf(t)), a = e.key === "Home" ? 0 : e.key === "End" ? r.length - 1 : (i + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + r.length) % r.length;
|
|
22
|
-
e.preventDefault(), r[a]?.focus();
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region ../../node_modules/.pnpm/@fortawesome+fontawesome-free@7.3.1/node_modules/@fortawesome/fontawesome-free/svgs/solid/check.svg?raw
|
|
26
|
-
var o = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --><path fill=\"currentColor\" d=\"M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z\"/></svg>";
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/color-palette/color-palette.tsx
|
|
29
|
-
function s({ value: e, options: i = t, ariaLabel: s, defaultLabel: l, colorAriaLabel: u, disabled: d = !1, includeDefault: f = !0, defaultDisabled: p = !1, onChange: m }) {
|
|
30
|
-
let h = i.findIndex((t) => t.value === e && !t.disabled), g = i.findIndex((e) => !e.disabled), _ = f && !p, v = a;
|
|
31
|
-
return /* @__PURE__ */ r("div", {
|
|
32
|
-
class: "rv-color-palette",
|
|
33
|
-
role: "radiogroup",
|
|
34
|
-
"aria-label": s,
|
|
35
|
-
children: [/* @__PURE__ */ n("div", {
|
|
36
|
-
class: "rv-color-palette__swatches",
|
|
37
|
-
children: i.map((t, r) => {
|
|
38
|
-
let i = t.value === e, a = u(t);
|
|
39
|
-
return /* @__PURE__ */ n(c, {
|
|
40
|
-
type: "button",
|
|
41
|
-
role: "radio",
|
|
42
|
-
class: "rv-color-palette__swatch",
|
|
43
|
-
"data-rv-color-palette-value": t.value,
|
|
44
|
-
label: a,
|
|
45
|
-
"aria-checked": i ? "true" : "false",
|
|
46
|
-
disabled: d || t.disabled,
|
|
47
|
-
tabIndex: !d && (r === h || h < 0 && (!_ || e !== null) && r === g) ? 0 : -1,
|
|
48
|
-
style: { "--rv-color-palette-color": t.value },
|
|
49
|
-
onKeyDown: v,
|
|
50
|
-
onClick: () => m(t.value),
|
|
51
|
-
children: i ? /* @__PURE__ */ n("span", {
|
|
52
|
-
class: "rv-color-palette__check",
|
|
53
|
-
"aria-hidden": "true",
|
|
54
|
-
dangerouslySetInnerHTML: { __html: o }
|
|
55
|
-
}) : null
|
|
56
|
-
}, t.value);
|
|
57
|
-
})
|
|
58
|
-
}), f ? /* @__PURE__ */ r(c, {
|
|
59
|
-
type: "button",
|
|
60
|
-
role: "radio",
|
|
61
|
-
class: "rv-color-palette__default",
|
|
62
|
-
"data-rv-color-palette-default": "",
|
|
63
|
-
"aria-checked": e === null ? "true" : "false",
|
|
64
|
-
label: l,
|
|
65
|
-
disabled: d || p,
|
|
66
|
-
tabIndex: !d && !p && (e === null || g < 0) ? 0 : -1,
|
|
67
|
-
onKeyDown: v,
|
|
68
|
-
onClick: () => m(null),
|
|
69
|
-
children: [e === null ? /* @__PURE__ */ n("span", {
|
|
70
|
-
class: "rv-color-palette__default-check",
|
|
71
|
-
"aria-hidden": "true",
|
|
72
|
-
dangerouslySetInnerHTML: { __html: o }
|
|
73
|
-
}) : null, /* @__PURE__ */ n("span", {
|
|
74
|
-
class: "rv-color-palette__default-label",
|
|
75
|
-
children: l
|
|
76
|
-
})]
|
|
77
|
-
}) : null]
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function c({ label: t, children: n, onKeyDown: i, disabled: a, ...o }) {
|
|
81
|
-
let s = e(t, !0);
|
|
82
|
-
return /* @__PURE__ */ r("button", {
|
|
83
|
-
...o,
|
|
84
|
-
disabled: a,
|
|
85
|
-
"aria-label": t,
|
|
86
|
-
...a ? {} : s.triggerProps,
|
|
87
|
-
onKeyDown: (e) => {
|
|
88
|
-
s.triggerProps.onKeyDown(e), e.defaultPrevented || i(e);
|
|
89
|
-
},
|
|
90
|
-
children: [n, s.tooltip]
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
export { i as n, s as t };
|