@for-the-people-initiative/design-system 1.3.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/README.md +80 -0
- package/dist/css/theme-dark.css +7 -0
- package/dist/css/tokens.css +2315 -0
- package/dist/scss/_tokens.scss +2521 -0
- package/dist/ts/tokens.ts +2441 -0
- package/package.json +80 -0
- package/src/components/Accordion/Accordion.scss +118 -0
- package/src/components/Accordion/Accordion.vue +105 -0
- package/src/components/Accordion/AccordionTab.vue +79 -0
- package/src/components/Alert/Alert.scss +109 -0
- package/src/components/Alert/Alert.vue +79 -0
- package/src/components/AppBar/AppBar.scss +73 -0
- package/src/components/AppBar/AppBar.vue +49 -0
- package/src/components/AtmosphericBackground/AtmosphericBackground.vue +198 -0
- package/src/components/AutoComplete/AutoComplete.scss +282 -0
- package/src/components/AutoComplete/AutoComplete.vue +398 -0
- package/src/components/Avatar/Avatar.scss +191 -0
- package/src/components/Avatar/Avatar.vue +44 -0
- package/src/components/Badge/Badge.scss +84 -0
- package/src/components/Badge/Badge.vue +41 -0
- package/src/components/BlockUI/BlockUI.scss +85 -0
- package/src/components/BlockUI/BlockUI.vue +90 -0
- package/src/components/Breadcrumb/Breadcrumb.scss +84 -0
- package/src/components/Breadcrumb/Breadcrumb.vue +141 -0
- package/src/components/Button/Button.scss +254 -0
- package/src/components/Button/Button.vue +68 -0
- package/src/components/CTA/CTA.scss +92 -0
- package/src/components/CTA/CTA.vue +33 -0
- package/src/components/Calendar/Calendar.scss +330 -0
- package/src/components/Calendar/Calendar.vue +455 -0
- package/src/components/Card/Card.scss +66 -0
- package/src/components/Card/Card.vue +48 -0
- package/src/components/Carousel/Carousel.scss +121 -0
- package/src/components/Carousel/Carousel.vue +191 -0
- package/src/components/Chart/Chart.scss +109 -0
- package/src/components/Chart/Chart.vue +209 -0
- package/src/components/Checkbox/Checkbox.scss +148 -0
- package/src/components/Checkbox/Checkbox.vue +75 -0
- package/src/components/Chip/Chip.scss +83 -0
- package/src/components/Chip/Chip.vue +73 -0
- package/src/components/ColorPicker/ColorPicker.scss +244 -0
- package/src/components/ColorPicker/ColorPicker.vue +411 -0
- package/src/components/Column/Column.scss +87 -0
- package/src/components/Column/Column.vue +45 -0
- package/src/components/ColumnGroup/ColumnGroup.scss +41 -0
- package/src/components/ColumnGroup/ColumnGroup.vue +27 -0
- package/src/components/ColumnGroup/ColumnGroupRow.vue +18 -0
- package/src/components/CommandPalette/CommandPalette.scss +143 -0
- package/src/components/CommandPalette/CommandPalette.vue +165 -0
- package/src/components/ConfirmDialog/ConfirmDialog.scss +177 -0
- package/src/components/ConfirmDialog/ConfirmDialog.vue +162 -0
- package/src/components/ConfirmPopup/ConfirmPopup.scss +180 -0
- package/src/components/ConfirmPopup/ConfirmPopup.vue +185 -0
- package/src/components/ContextMenu/ContextMenu.scss +171 -0
- package/src/components/ContextMenu/ContextMenu.vue +383 -0
- package/src/components/DataTable/DataTable.scss +162 -0
- package/src/components/DataTable/DataTable.vue +225 -0
- package/src/components/DataView/DataView.scss +149 -0
- package/src/components/DataView/DataView.vue +172 -0
- package/src/components/DatePicker/DatePicker.scss +71 -0
- package/src/components/DatePicker/DatePicker.vue +121 -0
- package/src/components/Dialog/Dialog.scss +161 -0
- package/src/components/Dialog/Dialog.vue +245 -0
- package/src/components/Divider/Divider.scss +147 -0
- package/src/components/Divider/Divider.vue +49 -0
- package/src/components/Dock/Dock.scss +221 -0
- package/src/components/Dock/Dock.vue +107 -0
- package/src/components/Drawer/Drawer.scss +220 -0
- package/src/components/Drawer/Drawer.vue +137 -0
- package/src/components/Dropdown/Dropdown.scss +218 -0
- package/src/components/Dropdown/Dropdown.vue +313 -0
- package/src/components/Editor/Editor.scss +156 -0
- package/src/components/Editor/Editor.vue +253 -0
- package/src/components/FAQ/FAQ.scss +24 -0
- package/src/components/FAQ/FAQ.vue +28 -0
- package/src/components/FeatureGrid/FeatureGrid.scss +92 -0
- package/src/components/FeatureGrid/FeatureGrid.vue +39 -0
- package/src/components/FieldSet/FieldSet.scss +97 -0
- package/src/components/FieldSet/FieldSet.vue +70 -0
- package/src/components/FileUpload/FileUpload.scss +137 -0
- package/src/components/FileUpload/FileUpload.vue +183 -0
- package/src/components/Footer/Footer.scss +95 -0
- package/src/components/Footer/Footer.vue +59 -0
- package/src/components/Form/Form.scss +72 -0
- package/src/components/Form/Form.vue +30 -0
- package/src/components/Form/FormField.vue +42 -0
- package/src/components/Galleria/Galleria.scss +295 -0
- package/src/components/Galleria/Galleria.vue +274 -0
- package/src/components/Hero/Hero.scss +116 -0
- package/src/components/Hero/Hero.vue +57 -0
- package/src/components/Image/Image.scss +129 -0
- package/src/components/Image/Image.vue +117 -0
- package/src/components/ImageCompare/ImageCompare.scss +97 -0
- package/src/components/ImageCompare/ImageCompare.vue +66 -0
- package/src/components/InPlace/InPlace.scss +97 -0
- package/src/components/InPlace/InPlace.vue +107 -0
- package/src/components/InlineMessage/InlineMessage.scss +69 -0
- package/src/components/InlineMessage/InlineMessage.vue +47 -0
- package/src/components/InputChips/InputChips.scss +165 -0
- package/src/components/InputChips/InputChips.vue +169 -0
- package/src/components/InputGroup/InputGroup.scss +57 -0
- package/src/components/InputGroup/InputGroup.vue +22 -0
- package/src/components/InputGroupAddon/InputGroupAddon.scss +28 -0
- package/src/components/InputGroupAddon/InputGroupAddon.vue +22 -0
- package/src/components/InputIcon/InputIcon.scss +58 -0
- package/src/components/InputIcon/InputIcon.vue +28 -0
- package/src/components/InputMask/InputMask.scss +65 -0
- package/src/components/InputMask/InputMask.vue +268 -0
- package/src/components/InputNumber/InputNumber.scss +122 -0
- package/src/components/InputNumber/InputNumber.vue +150 -0
- package/src/components/InputOtp/InputOtp.scss +88 -0
- package/src/components/InputOtp/InputOtp.vue +230 -0
- package/src/components/InputSwitch/InputSwitch.scss +131 -0
- package/src/components/InputSwitch/InputSwitch.vue +49 -0
- package/src/components/InputText/InputText.scss +61 -0
- package/src/components/InputText/InputText.vue +71 -0
- package/src/components/Knob/Knob.scss +92 -0
- package/src/components/Knob/Knob.vue +252 -0
- package/src/components/ListBox/ListBox.scss +152 -0
- package/src/components/ListBox/ListBox.vue +198 -0
- package/src/components/LogoCloud/LogoCloud.scss +64 -0
- package/src/components/LogoCloud/LogoCloud.vue +35 -0
- package/src/components/MegaMenu/MegaMenu.scss +280 -0
- package/src/components/MegaMenu/MegaMenu.vue +218 -0
- package/src/components/Menu/Menu.scss +102 -0
- package/src/components/Menu/Menu.vue +221 -0
- package/src/components/MenuBar/MenuBar.scss +208 -0
- package/src/components/MenuBar/MenuBar.vue +306 -0
- package/src/components/Message/Message.scss +126 -0
- package/src/components/Message/Message.vue +99 -0
- package/src/components/MeterGroup/MeterGroup.scss +105 -0
- package/src/components/MeterGroup/MeterGroup.vue +73 -0
- package/src/components/MultiSelect/MultiSelect.scss +239 -0
- package/src/components/MultiSelect/MultiSelect.vue +296 -0
- package/src/components/OrderList/OrderList.scss +133 -0
- package/src/components/OrderList/OrderList.vue +267 -0
- package/src/components/OrganizationChart/OrganizationChart.scss +145 -0
- package/src/components/OrganizationChart/OrganizationChart.vue +220 -0
- package/src/components/OverlayPanel/OverlayPanel.scss +69 -0
- package/src/components/OverlayPanel/OverlayPanel.vue +180 -0
- package/src/components/Paginator/Paginator.scss +130 -0
- package/src/components/Paginator/Paginator.vue +212 -0
- package/src/components/Panel/Panel.scss +113 -0
- package/src/components/Panel/Panel.vue +89 -0
- package/src/components/PanelMenu/PanelMenu.scss +211 -0
- package/src/components/PanelMenu/PanelMenu.vue +295 -0
- package/src/components/ParticleBackground/ParticleBackground.vue +310 -0
- package/src/components/PickList/PickList.scss +126 -0
- package/src/components/PickList/PickList.vue +249 -0
- package/src/components/PopOver/PopOver.scss +112 -0
- package/src/components/PopOver/PopOver.vue +254 -0
- package/src/components/PricingTable/PricingCard.vue +33 -0
- package/src/components/PricingTable/PricingTable.scss +133 -0
- package/src/components/PricingTable/PricingTable.vue +21 -0
- package/src/components/ProgressBar/ProgressBar.scss +58 -0
- package/src/components/ProgressBar/ProgressBar.vue +48 -0
- package/src/components/ProgressSpinner/ProgressSpinner.scss +48 -0
- package/src/components/ProgressSpinner/ProgressSpinner.vue +53 -0
- package/src/components/RadioButton/RadioButton.scss +148 -0
- package/src/components/RadioButton/RadioButton.vue +52 -0
- package/src/components/Rating/Rating.scss +109 -0
- package/src/components/Rating/Rating.vue +136 -0
- package/src/components/Row/Row.scss +38 -0
- package/src/components/Row/Row.vue +30 -0
- package/src/components/ScrollPanel/ScrollPanel.scss +90 -0
- package/src/components/ScrollPanel/ScrollPanel.vue +284 -0
- package/src/components/ScrollTop/ScrollTop.scss +59 -0
- package/src/components/ScrollTop/ScrollTop.vue +99 -0
- package/src/components/Section/Section.scss +58 -0
- package/src/components/Section/Section.vue +39 -0
- package/src/components/Select/Select.scss +98 -0
- package/src/components/Select/Select.vue +92 -0
- package/src/components/SelectButton/SelectButton.scss +65 -0
- package/src/components/SelectButton/SelectButton.vue +144 -0
- package/src/components/Sidebar/Sidebar.scss +170 -0
- package/src/components/Sidebar/Sidebar.vue +137 -0
- package/src/components/Skeleton/Skeleton.scss +43 -0
- package/src/components/Skeleton/Skeleton.vue +57 -0
- package/src/components/Slider/Slider.scss +103 -0
- package/src/components/Slider/Slider.vue +65 -0
- package/src/components/SpeedDial/SpeedDial.scss +217 -0
- package/src/components/SpeedDial/SpeedDial.vue +196 -0
- package/src/components/SplitButton/SplitButton.scss +264 -0
- package/src/components/SplitButton/SplitButton.vue +172 -0
- package/src/components/Splitter/Splitter.scss +95 -0
- package/src/components/Splitter/Splitter.vue +191 -0
- package/src/components/Splitter/SplitterPanel.vue +125 -0
- package/src/components/Stats/Stats.scss +54 -0
- package/src/components/Stats/Stats.vue +28 -0
- package/src/components/Steps/Steps.scss +164 -0
- package/src/components/Steps/Steps.vue +100 -0
- package/src/components/TabMenu/TabMenu.scss +106 -0
- package/src/components/TabMenu/TabMenu.vue +174 -0
- package/src/components/Tabs/TabPanel.vue +41 -0
- package/src/components/Tabs/Tabs.scss +82 -0
- package/src/components/Tabs/Tabs.vue +162 -0
- package/src/components/Tag/Tag.scss +73 -0
- package/src/components/Tag/Tag.vue +37 -0
- package/src/components/Terminal/Terminal.scss +80 -0
- package/src/components/Terminal/Terminal.vue +113 -0
- package/src/components/Testimonial/Testimonial.scss +80 -0
- package/src/components/Testimonial/Testimonial.vue +29 -0
- package/src/components/Textarea/Textarea.scss +65 -0
- package/src/components/Textarea/Textarea.vue +101 -0
- package/src/components/TieredMenu/TieredMenu.scss +146 -0
- package/src/components/TieredMenu/TieredMenu.vue +270 -0
- package/src/components/TieredMenu/TieredMenuSub.vue +132 -0
- package/src/components/Timeline/Timeline.scss +190 -0
- package/src/components/Timeline/Timeline.vue +79 -0
- package/src/components/Toast/Toast.scss +284 -0
- package/src/components/Toast/Toast.vue +162 -0
- package/src/components/ToggleButton/ToggleButton.scss +99 -0
- package/src/components/ToggleButton/ToggleButton.vue +65 -0
- package/src/components/ToggleSwitch/ToggleSwitch.scss +68 -0
- package/src/components/ToggleSwitch/ToggleSwitch.vue +44 -0
- package/src/components/Toolbar/Toolbar.scss +37 -0
- package/src/components/Toolbar/Toolbar.vue +23 -0
- package/src/components/Tooltip/Tooltip.scss +114 -0
- package/src/components/Tooltip/Tooltip.vue +169 -0
- package/src/components/Tree/Tree.scss +164 -0
- package/src/components/Tree/Tree.vue +273 -0
- package/src/components/TreeSelect/TreeSelect.scss +238 -0
- package/src/components/TreeSelect/TreeSelect.vue +401 -0
- package/src/components/TreeTable/TreeTable.scss +172 -0
- package/src/components/TreeTable/TreeTable.vue +285 -0
- package/src/components/VirtualScroller/VirtualScroller.scss +107 -0
- package/src/components/VirtualScroller/VirtualScroller.vue +234 -0
- package/src/scss/fonts.scss +63 -0
- package/src/scss/mixins/accent-gradient.scss +43 -0
- package/src/scss/mixins/border.scss +28 -0
- package/src/scss/mixins/breakpoint.scss +80 -0
- package/src/scss/mixins/container.scss +33 -0
- package/src/scss/mixins/elevation.scss +43 -0
- package/src/scss/mixins/grid.scss +23 -0
- package/src/scss/mixins/levitation.scss +15 -0
- package/src/scss/mixins/list.scss +5 -0
- package/src/scss/mixins/surface-atmospheric.scss +93 -0
- package/src/scss/mixins/surface.scss +19 -0
- package/src/scss/mixins/typography.scss +91 -0
- package/src/scss/utility-classes/utility-classes-spacing.scss +34 -0
- package/src/scss/utility-classes/utility-classes-typography.scss +114 -0
- package/tokens/components/accordion.json +127 -0
- package/tokens/components/autocomplete.json +238 -0
- package/tokens/components/avatar.json +220 -0
- package/tokens/components/badge.json +119 -0
- package/tokens/components/block-ui.json +40 -0
- package/tokens/components/breadcrumb.json +57 -0
- package/tokens/components/button.json +395 -0
- package/tokens/components/calendar.json +260 -0
- package/tokens/components/card.json +157 -0
- package/tokens/components/carousel.json +154 -0
- package/tokens/components/chart.json +132 -0
- package/tokens/components/checkbox.json +130 -0
- package/tokens/components/chip.json +100 -0
- package/tokens/components/color-picker.json +196 -0
- package/tokens/components/column-group.json +45 -0
- package/tokens/components/column.json +109 -0
- package/tokens/components/confirm-dialog.json +141 -0
- package/tokens/components/confirm-popup.json +101 -0
- package/tokens/components/context-menu.json +168 -0
- package/tokens/components/data-table.json +157 -0
- package/tokens/components/data-view.json +172 -0
- package/tokens/components/dialog.json +151 -0
- package/tokens/components/divider.json +45 -0
- package/tokens/components/dock.json +173 -0
- package/tokens/components/drawer.json +163 -0
- package/tokens/components/dropdown.json +230 -0
- package/tokens/components/editor.json +170 -0
- package/tokens/components/field-set.json +115 -0
- package/tokens/components/file-upload.json +193 -0
- package/tokens/components/galleria.json +235 -0
- package/tokens/components/image-compare.json +74 -0
- package/tokens/components/image.json +71 -0
- package/tokens/components/in-place.json +100 -0
- package/tokens/components/inline-message.json +107 -0
- package/tokens/components/input-chips.json +187 -0
- package/tokens/components/input-group-addon.json +47 -0
- package/tokens/components/input-group.json +21 -0
- package/tokens/components/input-icon.json +38 -0
- package/tokens/components/input-mask.json +136 -0
- package/tokens/components/input-number.json +144 -0
- package/tokens/components/input-otp.json +138 -0
- package/tokens/components/input-switch.json +108 -0
- package/tokens/components/input-text.json +136 -0
- package/tokens/components/knob.json +119 -0
- package/tokens/components/listbox.json +166 -0
- package/tokens/components/mega-menu.json +283 -0
- package/tokens/components/menu.json +145 -0
- package/tokens/components/menubar.json +152 -0
- package/tokens/components/message.json +151 -0
- package/tokens/components/meter-group.json +108 -0
- package/tokens/components/multi-select.json +244 -0
- package/tokens/components/order-list.json +193 -0
- package/tokens/components/organization-chart.json +188 -0
- package/tokens/components/overlay-panel.json +94 -0
- package/tokens/components/paginator.json +186 -0
- package/tokens/components/panel.json +120 -0
- package/tokens/components/panelmenu.json +190 -0
- package/tokens/components/picklist.json +187 -0
- package/tokens/components/popover.json +65 -0
- package/tokens/components/progress-bar.json +33 -0
- package/tokens/components/progress-spinner.json +38 -0
- package/tokens/components/radio.json +125 -0
- package/tokens/components/rating.json +76 -0
- package/tokens/components/row.json +62 -0
- package/tokens/components/scroll-panel.json +69 -0
- package/tokens/components/scroll-top.json +84 -0
- package/tokens/components/select-button.json +145 -0
- package/tokens/components/select.json +190 -0
- package/tokens/components/sidebar.json +146 -0
- package/tokens/components/skeleton.json +26 -0
- package/tokens/components/slider.json +82 -0
- package/tokens/components/speed-dial.json +144 -0
- package/tokens/components/split-button.json +316 -0
- package/tokens/components/splitter.json +88 -0
- package/tokens/components/steps.json +154 -0
- package/tokens/components/tabmenu.json +103 -0
- package/tokens/components/tabs.json +97 -0
- package/tokens/components/tag.json +122 -0
- package/tokens/components/terminal.json +100 -0
- package/tokens/components/textarea.json +96 -0
- package/tokens/components/tieredmenu.json +142 -0
- package/tokens/components/timeline.json +129 -0
- package/tokens/components/toast.json +281 -0
- package/tokens/components/toggle-button.json +220 -0
- package/tokens/components/toggle-switch.json +95 -0
- package/tokens/components/toolbar.json +41 -0
- package/tokens/components/tooltip.json +60 -0
- package/tokens/components/tree-select.json +224 -0
- package/tokens/components/tree.json +153 -0
- package/tokens/components/treetable.json +155 -0
- package/tokens/components/virtualscroller.json +95 -0
- package/tokens/primitives/color.json +137 -0
- package/tokens/primitives/radius.json +12 -0
- package/tokens/primitives/shadow.json +29 -0
- package/tokens/primitives/spacing.json +15 -0
- package/tokens/semantics/color.json +81 -0
- package/tokens/semantics/radius.json +10 -0
- package/tokens/semantics/shadow.json +9 -0
- package/tokens/semantics/spacing.json +24 -0
- package/tokens/themes/dark.json +7 -0
- package/tokens/themes/light.json +7 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
|
|
3
|
+
$c: picklist;
|
|
4
|
+
|
|
5
|
+
.#{$c} {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
gap: var(--picklist-gap, $picklist-gap);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.#{$c}--disabled {
|
|
12
|
+
opacity: 0.6;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// List panels (source and target)
|
|
17
|
+
.#{$c}__list {
|
|
18
|
+
flex: 1;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
min-width: 200px;
|
|
22
|
+
background-color: var(--picklist-background-default, $picklist-background-default);
|
|
23
|
+
border: var(--picklist-border-width, $picklist-border-width) solid var(--picklist-border-color-default, $picklist-border-color-default);
|
|
24
|
+
border-radius: var(--picklist-radius, $picklist-radius);
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.#{$c}__header {
|
|
29
|
+
padding: var(--picklist-header-padding-y, $picklist-header-padding-y) var(--picklist-header-padding-x, $picklist-header-padding-x);
|
|
30
|
+
background-color: var(--picklist-header-background, $picklist-header-background);
|
|
31
|
+
color: var(--picklist-header-text, $picklist-header-text);
|
|
32
|
+
border-bottom: 1px solid var(--picklist-header-borderColor, $picklist-header-borderColor);
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.#{$c}__items {
|
|
38
|
+
flex: 1;
|
|
39
|
+
min-height: var(--picklist-list-minHeight, $picklist-list-minHeight);
|
|
40
|
+
max-height: var(--picklist-list-maxHeight, $picklist-list-maxHeight);
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
padding: var(--picklist-list-padding, $picklist-list-padding);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.#{$c}__item {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: var(--picklist-item-padding-y, $picklist-item-padding-y) var(--picklist-item-padding-x, $picklist-item-padding-x);
|
|
49
|
+
background-color: var(--picklist-item-background-default, $picklist-item-background-default);
|
|
50
|
+
color: var(--picklist-item-text-default, $picklist-item-text-default);
|
|
51
|
+
border-radius: var(--picklist-item-radius, $picklist-item-radius);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
user-select: none;
|
|
54
|
+
transition: background-color 0.15s ease;
|
|
55
|
+
|
|
56
|
+
&:hover {
|
|
57
|
+
background-color: var(--picklist-item-background-hover, $picklist-item-background-hover);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:focus {
|
|
61
|
+
outline: none;
|
|
62
|
+
background-color: var(--picklist-item-background-hover, $picklist-item-background-hover);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus-visible {
|
|
66
|
+
outline: var(--picklist-focus-ringWidth, $picklist-focus-ringWidth) solid var(--picklist-focus-ringColor, $picklist-focus-ringColor);
|
|
67
|
+
outline-offset: -2px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.#{$c}__item--selected {
|
|
72
|
+
background-color: var(--picklist-item-background-selected, $picklist-item-background-selected);
|
|
73
|
+
color: var(--picklist-item-text-selected, $picklist-item-text-selected);
|
|
74
|
+
|
|
75
|
+
&:hover {
|
|
76
|
+
background-color: var(--picklist-item-background-selected, $picklist-item-background-selected);
|
|
77
|
+
filter: brightness(0.95);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.#{$c}__empty {
|
|
82
|
+
padding: var(--picklist-item-padding-y, $picklist-item-padding-y) var(--picklist-item-padding-x, $picklist-item-padding-x);
|
|
83
|
+
color: var(--picklist-item-text-default, $picklist-item-text-default);
|
|
84
|
+
opacity: 0.6;
|
|
85
|
+
text-align: center;
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Transfer controls
|
|
90
|
+
.#{$c}__controls {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
gap: var(--picklist-controls-gap, $picklist-controls-gap);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.#{$c}__button {
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
width: var(--picklist-controls-button-size, $picklist-controls-button-size);
|
|
102
|
+
height: var(--picklist-controls-button-size, $picklist-controls-button-size);
|
|
103
|
+
padding: 0;
|
|
104
|
+
background-color: var(--picklist-controls-button-background-default, $picklist-controls-button-background-default);
|
|
105
|
+
border: 1px solid var(--picklist-controls-button-border, $picklist-controls-button-border);
|
|
106
|
+
border-radius: var(--picklist-controls-button-radius, $picklist-controls-button-radius);
|
|
107
|
+
color: var(--picklist-controls-button-icon-default, $picklist-controls-button-icon-default);
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
transition: all 0.15s ease;
|
|
110
|
+
|
|
111
|
+
&:hover:not(:disabled) {
|
|
112
|
+
background-color: var(--picklist-controls-button-background-hover, $picklist-controls-button-background-hover);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&:focus-visible {
|
|
116
|
+
outline: var(--picklist-focus-ringWidth, $picklist-focus-ringWidth) solid var(--picklist-focus-ringColor, $picklist-focus-ringColor);
|
|
117
|
+
outline-offset: var(--picklist-focus-ringOffset, $picklist-focus-ringOffset);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:disabled {
|
|
121
|
+
cursor: not-allowed;
|
|
122
|
+
background-color: var(--picklist-controls-button-background-disabled, $picklist-controls-button-background-disabled);
|
|
123
|
+
color: var(--picklist-controls-button-icon-disabled, $picklist-controls-button-icon-disabled);
|
|
124
|
+
border-color: var(--picklist-controls-button-icon-disabled, $picklist-controls-button-icon-disabled);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="picklist" :class="additionalClasses">
|
|
3
|
+
<!-- Source List -->
|
|
4
|
+
<div class="picklist__list picklist__list--source">
|
|
5
|
+
<div v-if="sourceHeader" class="picklist__header">
|
|
6
|
+
<slot name="sourceHeader">{{ sourceHeader }}</slot>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="picklist__items" role="listbox" aria-label="Source list">
|
|
9
|
+
<div
|
|
10
|
+
v-for="(item, index) in sourceItems"
|
|
11
|
+
:key="getItemKey(item, index)"
|
|
12
|
+
class="picklist__item"
|
|
13
|
+
:class="{
|
|
14
|
+
'picklist__item--selected': isSourceSelected(item)
|
|
15
|
+
}"
|
|
16
|
+
role="option"
|
|
17
|
+
:aria-selected="isSourceSelected(item)"
|
|
18
|
+
:tabindex="0"
|
|
19
|
+
@click="toggleSourceSelection(item)"
|
|
20
|
+
@keydown.enter="toggleSourceSelection(item)"
|
|
21
|
+
@keydown.space.prevent="toggleSourceSelection(item)"
|
|
22
|
+
>
|
|
23
|
+
<slot name="item" :item="item">
|
|
24
|
+
{{ getItemLabel(item) }}
|
|
25
|
+
</slot>
|
|
26
|
+
</div>
|
|
27
|
+
<div v-if="sourceItems.length === 0" class="picklist__empty">
|
|
28
|
+
<slot name="sourceEmpty">No items</slot>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<!-- Transfer Controls -->
|
|
34
|
+
<div class="picklist__controls">
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
class="picklist__button"
|
|
38
|
+
:disabled="sourceSelection.length === 0"
|
|
39
|
+
aria-label="Move to target"
|
|
40
|
+
@click="moveToTarget"
|
|
41
|
+
>
|
|
42
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
43
|
+
<path d="M6 4L10 8L6 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
44
|
+
</svg>
|
|
45
|
+
</button>
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
class="picklist__button"
|
|
49
|
+
:disabled="sourceItems.length === 0"
|
|
50
|
+
aria-label="Move all to target"
|
|
51
|
+
@click="moveAllToTarget"
|
|
52
|
+
>
|
|
53
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
54
|
+
<path d="M4 4L8 8L4 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
55
|
+
<path d="M8 4L12 8L8 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
56
|
+
</svg>
|
|
57
|
+
</button>
|
|
58
|
+
<button
|
|
59
|
+
type="button"
|
|
60
|
+
class="picklist__button"
|
|
61
|
+
:disabled="targetSelection.length === 0"
|
|
62
|
+
aria-label="Move to source"
|
|
63
|
+
@click="moveToSource"
|
|
64
|
+
>
|
|
65
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
66
|
+
<path d="M10 4L6 8L10 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
67
|
+
</svg>
|
|
68
|
+
</button>
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
class="picklist__button"
|
|
72
|
+
:disabled="targetItems.length === 0"
|
|
73
|
+
aria-label="Move all to source"
|
|
74
|
+
@click="moveAllToSource"
|
|
75
|
+
>
|
|
76
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
77
|
+
<path d="M12 4L8 8L12 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
78
|
+
<path d="M8 4L4 8L8 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
79
|
+
</svg>
|
|
80
|
+
</button>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- Target List -->
|
|
84
|
+
<div class="picklist__list picklist__list--target">
|
|
85
|
+
<div v-if="targetHeader" class="picklist__header">
|
|
86
|
+
<slot name="targetHeader">{{ targetHeader }}</slot>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="picklist__items" role="listbox" aria-label="Target list">
|
|
89
|
+
<div
|
|
90
|
+
v-for="(item, index) in targetItems"
|
|
91
|
+
:key="getItemKey(item, index)"
|
|
92
|
+
class="picklist__item"
|
|
93
|
+
:class="{
|
|
94
|
+
'picklist__item--selected': isTargetSelected(item)
|
|
95
|
+
}"
|
|
96
|
+
role="option"
|
|
97
|
+
:aria-selected="isTargetSelected(item)"
|
|
98
|
+
:tabindex="0"
|
|
99
|
+
@click="toggleTargetSelection(item)"
|
|
100
|
+
@keydown.enter="toggleTargetSelection(item)"
|
|
101
|
+
@keydown.space.prevent="toggleTargetSelection(item)"
|
|
102
|
+
>
|
|
103
|
+
<slot name="item" :item="item">
|
|
104
|
+
{{ getItemLabel(item) }}
|
|
105
|
+
</slot>
|
|
106
|
+
</div>
|
|
107
|
+
<div v-if="targetItems.length === 0" class="picklist__empty">
|
|
108
|
+
<slot name="targetEmpty">No items</slot>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
114
|
+
|
|
115
|
+
<style src="./PickList.scss"></style>
|
|
116
|
+
|
|
117
|
+
<script setup lang="ts">
|
|
118
|
+
import type { PickListProps, PickListEmits } from '../../types';
|
|
119
|
+
import { ref, computed } from "vue";
|
|
120
|
+
|
|
121
|
+
defineOptions({ name: 'FtpPickList' });
|
|
122
|
+
|
|
123
|
+
const props = withDefaults(defineProps<PickListProps>(), {
|
|
124
|
+
source: () => [],
|
|
125
|
+
target: () => [],
|
|
126
|
+
sourceHeader: "",
|
|
127
|
+
targetHeader: "",
|
|
128
|
+
dataKey: null,
|
|
129
|
+
labelKey: "label",
|
|
130
|
+
isDisabled: false,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const emit = defineEmits(["update:source", "update:target", "move-to-target", "move-to-source"]);
|
|
134
|
+
|
|
135
|
+
const sourceSelection = ref<any[]>([]);
|
|
136
|
+
const targetSelection = ref<any[]>([]);
|
|
137
|
+
|
|
138
|
+
const sourceItems = computed(() => props.source);
|
|
139
|
+
const targetItems = computed(() => props.target);
|
|
140
|
+
|
|
141
|
+
const getItemKey = (item: any, index: any) => {
|
|
142
|
+
if (props.dataKey && typeof item === "object") {
|
|
143
|
+
return item[props.dataKey];
|
|
144
|
+
}
|
|
145
|
+
return index;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const getItemLabel = (item: any) => {
|
|
149
|
+
if (typeof item === "string" || typeof item === "number") {
|
|
150
|
+
return item;
|
|
151
|
+
}
|
|
152
|
+
return item[props.labelKey];
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const getItemValue = (item: any) => {
|
|
156
|
+
if (props.dataKey && typeof item === "object") {
|
|
157
|
+
return item[props.dataKey];
|
|
158
|
+
}
|
|
159
|
+
return item;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const isSourceSelected = (item: any) => {
|
|
163
|
+
const value = getItemValue(item);
|
|
164
|
+
return sourceSelection.value.some((s) => getItemValue(s) === value);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const isTargetSelected = (item: any) => {
|
|
168
|
+
const value = getItemValue(item);
|
|
169
|
+
return targetSelection.value.some((s) => getItemValue(s) === value);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const toggleSourceSelection = (item: any) => {
|
|
173
|
+
if (props.isDisabled) return;
|
|
174
|
+
const value = getItemValue(item);
|
|
175
|
+
const index = sourceSelection.value.findIndex((s) => getItemValue(s) === value);
|
|
176
|
+
if (index > -1) {
|
|
177
|
+
sourceSelection.value.splice(index, 1);
|
|
178
|
+
} else {
|
|
179
|
+
sourceSelection.value.push(item);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const toggleTargetSelection = (item: any) => {
|
|
184
|
+
if (props.isDisabled) return;
|
|
185
|
+
const value = getItemValue(item);
|
|
186
|
+
const index = targetSelection.value.findIndex((s) => getItemValue(s) === value);
|
|
187
|
+
if (index > -1) {
|
|
188
|
+
targetSelection.value.splice(index, 1);
|
|
189
|
+
} else {
|
|
190
|
+
targetSelection.value.push(item);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const moveToTarget = () => {
|
|
195
|
+
if (props.isDisabled || sourceSelection.value.length === 0) return;
|
|
196
|
+
|
|
197
|
+
const newSource = sourceItems.value.filter(
|
|
198
|
+
(item) => !sourceSelection.value.some((s) => getItemValue(s) === getItemValue(item))
|
|
199
|
+
);
|
|
200
|
+
const newTarget = [...targetItems.value, ...sourceSelection.value];
|
|
201
|
+
|
|
202
|
+
emit("update:source", newSource);
|
|
203
|
+
emit("update:target", newTarget);
|
|
204
|
+
emit("move-to-target", { items: sourceSelection.value });
|
|
205
|
+
sourceSelection.value = [];
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const moveAllToTarget = () => {
|
|
209
|
+
if (props.isDisabled || sourceItems.value.length === 0) return;
|
|
210
|
+
|
|
211
|
+
const movedItems = [...sourceItems.value];
|
|
212
|
+
const newTarget = [...targetItems.value, ...movedItems];
|
|
213
|
+
|
|
214
|
+
emit("update:source", []);
|
|
215
|
+
emit("update:target", newTarget);
|
|
216
|
+
emit("move-to-target", { items: movedItems });
|
|
217
|
+
sourceSelection.value = [];
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const moveToSource = () => {
|
|
221
|
+
if (props.isDisabled || targetSelection.value.length === 0) return;
|
|
222
|
+
|
|
223
|
+
const newTarget = targetItems.value.filter(
|
|
224
|
+
(item) => !targetSelection.value.some((s) => getItemValue(s) === getItemValue(item))
|
|
225
|
+
);
|
|
226
|
+
const newSource = [...sourceItems.value, ...targetSelection.value];
|
|
227
|
+
|
|
228
|
+
emit("update:source", newSource);
|
|
229
|
+
emit("update:target", newTarget);
|
|
230
|
+
emit("move-to-source", { items: targetSelection.value });
|
|
231
|
+
targetSelection.value = [];
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const moveAllToSource = () => {
|
|
235
|
+
if (props.isDisabled || targetItems.value.length === 0) return;
|
|
236
|
+
|
|
237
|
+
const movedItems = [...targetItems.value];
|
|
238
|
+
const newSource = [...sourceItems.value, ...movedItems];
|
|
239
|
+
|
|
240
|
+
emit("update:source", newSource);
|
|
241
|
+
emit("update:target", []);
|
|
242
|
+
emit("move-to-source", { items: movedItems });
|
|
243
|
+
targetSelection.value = [];
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
const additionalClasses = computed(() =>
|
|
247
|
+
[props.isDisabled && "picklist--disabled"].filter(Boolean).join(" ")
|
|
248
|
+
);
|
|
249
|
+
</script>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
@use "../../scss/mixins/elevation" as *;
|
|
3
|
+
|
|
4
|
+
$c: popover;
|
|
5
|
+
|
|
6
|
+
.#{$c}-wrapper {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.#{$c} {
|
|
12
|
+
@include elevation(3);
|
|
13
|
+
position: fixed;
|
|
14
|
+
z-index: var(--popover-zIndex, $popover-zIndex);
|
|
15
|
+
padding: var(--popover-padding-y, $popover-padding-y) var(--popover-padding-x, $popover-padding-x);
|
|
16
|
+
// Component token overrides
|
|
17
|
+
background-color: var(--popover-background, $popover-background);
|
|
18
|
+
border-radius: var(--popover-radius, $popover-radius);
|
|
19
|
+
box-shadow: var(--popover-shadow, $popover-shadow);
|
|
20
|
+
border-color: var(--popover-border-color, $popover-border-color);
|
|
21
|
+
border-width: var(--popover-border-width, $popover-border-width);
|
|
22
|
+
max-width: var(--popover-maxWidth, $popover-maxWidth);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.#{$c}__content {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Arrow
|
|
30
|
+
.#{$c}__arrow {
|
|
31
|
+
position: absolute;
|
|
32
|
+
width: 0;
|
|
33
|
+
height: 0;
|
|
34
|
+
border-style: solid;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
$arrow-size: var(--popover-arrow-size, $popover-arrow-size);
|
|
38
|
+
|
|
39
|
+
// Position: Top (arrow points down)
|
|
40
|
+
.#{$c}--top {
|
|
41
|
+
.#{$c}__arrow {
|
|
42
|
+
bottom: calc(-1 * #{$arrow-size});
|
|
43
|
+
left: 50%;
|
|
44
|
+
transform: translateX(-50%);
|
|
45
|
+
border-width: #{$arrow-size} #{$arrow-size} 0 #{$arrow-size};
|
|
46
|
+
border-color: var(--popover-background, $popover-background) transparent transparent transparent;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Position: Bottom (arrow points up)
|
|
51
|
+
.#{$c}--bottom {
|
|
52
|
+
.#{$c}__arrow {
|
|
53
|
+
top: calc(-1 * #{$arrow-size});
|
|
54
|
+
left: 50%;
|
|
55
|
+
transform: translateX(-50%);
|
|
56
|
+
border-width: 0 #{$arrow-size} #{$arrow-size} #{$arrow-size};
|
|
57
|
+
border-color: transparent transparent var(--popover-background, $popover-background) transparent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Position: Left (arrow points right)
|
|
62
|
+
.#{$c}--left {
|
|
63
|
+
.#{$c}__arrow {
|
|
64
|
+
right: calc(-1 * #{$arrow-size});
|
|
65
|
+
top: 50%;
|
|
66
|
+
transform: translateY(-50%);
|
|
67
|
+
border-width: #{$arrow-size} 0 #{$arrow-size} #{$arrow-size};
|
|
68
|
+
border-color: transparent transparent transparent var(--popover-background, $popover-background);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Position: Right (arrow points left)
|
|
73
|
+
.#{$c}--right {
|
|
74
|
+
.#{$c}__arrow {
|
|
75
|
+
left: calc(-1 * #{$arrow-size});
|
|
76
|
+
top: 50%;
|
|
77
|
+
transform: translateY(-50%);
|
|
78
|
+
border-width: #{$arrow-size} #{$arrow-size} #{$arrow-size} 0;
|
|
79
|
+
border-color: transparent var(--popover-background, $popover-background) transparent transparent;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Transition animation
|
|
84
|
+
.#{$c}-fade-enter-active,
|
|
85
|
+
.#{$c}-fade-leave-active {
|
|
86
|
+
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.#{$c}-fade-enter-from,
|
|
90
|
+
.#{$c}-fade-leave-to {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.#{$c}-fade-enter-from.#{$c}--top,
|
|
95
|
+
.#{$c}-fade-leave-to.#{$c}--top {
|
|
96
|
+
transform: translateY(4px);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.#{$c}-fade-enter-from.#{$c}--bottom,
|
|
100
|
+
.#{$c}-fade-leave-to.#{$c}--bottom {
|
|
101
|
+
transform: translateY(-4px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.#{$c}-fade-enter-from.#{$c}--left,
|
|
105
|
+
.#{$c}-fade-leave-to.#{$c}--left {
|
|
106
|
+
transform: translateX(4px);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.#{$c}-fade-enter-from.#{$c}--right,
|
|
110
|
+
.#{$c}-fade-leave-to.#{$c}--right {
|
|
111
|
+
transform: translateX(-4px);
|
|
112
|
+
}
|