@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,106 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
|
|
3
|
+
$c: tabmenu;
|
|
4
|
+
|
|
5
|
+
.#{$c} {
|
|
6
|
+
position: relative;
|
|
7
|
+
background-color: var(--tabmenu-background, $tabmenu-background);
|
|
8
|
+
border-bottom: var(--tabmenu-border-width, $tabmenu-border-width) solid var(--tabmenu-border-color, $tabmenu-border-color);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.#{$c}__list {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: stretch;
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
list-style: none;
|
|
17
|
+
gap: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.#{$c}__item {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.#{$c}__link {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--tabmenu-item-gap, $tabmenu-item-gap);
|
|
28
|
+
padding: var(--tabmenu-item-padding, $tabmenu-item-padding);
|
|
29
|
+
background-color: var(--tabmenu-item-background-default, $tabmenu-item-background-default);
|
|
30
|
+
color: var(--tabmenu-item-color-default, $tabmenu-item-color-default);
|
|
31
|
+
border: none;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
font-family: inherit;
|
|
34
|
+
font-size: inherit;
|
|
35
|
+
font-weight: 500;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
transition: background-color var(--tabmenu-transition-duration, $tabmenu-transition-duration) ease,
|
|
38
|
+
color var(--tabmenu-transition-duration, $tabmenu-transition-duration) ease;
|
|
39
|
+
|
|
40
|
+
&:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
41
|
+
background-color: var(--tabmenu-item-background-hover, $tabmenu-item-background-hover);
|
|
42
|
+
color: var(--tabmenu-item-color-hover, $tabmenu-item-color-hover);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
outline: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
outline: 2px solid var(--tabmenu-item-color-active, $tabmenu-item-color-active);
|
|
51
|
+
outline-offset: -2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:disabled,
|
|
55
|
+
&[aria-disabled="true"] {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
color: var(--tabmenu-item-color-disabled, $tabmenu-item-color-disabled);
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.#{$c}__item--active .#{$c}__link {
|
|
63
|
+
background-color: var(--tabmenu-item-background-active, $tabmenu-item-background-active);
|
|
64
|
+
color: var(--tabmenu-item-color-active, $tabmenu-item-color-active);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.#{$c}__item--disabled .#{$c}__link {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
color: var(--tabmenu-item-color-disabled, $tabmenu-item-color-disabled);
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.#{$c}__icon {
|
|
74
|
+
width: var(--tabmenu-icon-size, $tabmenu-icon-size);
|
|
75
|
+
height: var(--tabmenu-icon-size, $tabmenu-icon-size);
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.#{$c}__label {
|
|
80
|
+
white-space: nowrap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.#{$c}__badge {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
min-width: 18px;
|
|
88
|
+
height: 18px;
|
|
89
|
+
padding: 0 6px;
|
|
90
|
+
font-size: 11px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
color: white;
|
|
93
|
+
background-color: var(--tabmenu-item-color-active, $tabmenu-item-color-active);
|
|
94
|
+
border-radius: 9999px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.#{$c}__inkbar {
|
|
98
|
+
position: absolute;
|
|
99
|
+
bottom: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
height: var(--tabmenu-inkbar-height, $tabmenu-inkbar-height);
|
|
102
|
+
background-color: var(--tabmenu-inkbar-color, $tabmenu-inkbar-color);
|
|
103
|
+
border-radius: var(--tabmenu-inkbar-borderRadius, $tabmenu-inkbar-borderRadius);
|
|
104
|
+
transition: transform var(--tabmenu-transition-duration, $tabmenu-transition-duration) ease,
|
|
105
|
+
width var(--tabmenu-transition-duration, $tabmenu-transition-duration) ease;
|
|
106
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav class="tabmenu" role="navigation">
|
|
3
|
+
<ul class="tabmenu__list" role="menubar">
|
|
4
|
+
<li
|
|
5
|
+
v-for="(item, index) in model"
|
|
6
|
+
:key="item.key || index"
|
|
7
|
+
class="tabmenu__item"
|
|
8
|
+
:class="{
|
|
9
|
+
'tabmenu__item--active': index === activeIndex,
|
|
10
|
+
'tabmenu__item--disabled': item.disabled
|
|
11
|
+
}"
|
|
12
|
+
role="none"
|
|
13
|
+
>
|
|
14
|
+
<a
|
|
15
|
+
v-if="item.url"
|
|
16
|
+
:href="item.url"
|
|
17
|
+
:target="item.target"
|
|
18
|
+
class="tabmenu__link"
|
|
19
|
+
role="menuitem"
|
|
20
|
+
:tabindex="item.disabled ? -1 : 0"
|
|
21
|
+
:aria-disabled="item.disabled || undefined"
|
|
22
|
+
:aria-current="index === activeIndex ? 'page' : undefined"
|
|
23
|
+
@click="onTabClick($event, item, index)"
|
|
24
|
+
@keydown="onTabKeydown($event, index)"
|
|
25
|
+
>
|
|
26
|
+
<i v-if="item.icon" :class="item.icon" class="tabmenu__icon"></i>
|
|
27
|
+
<span class="tabmenu__label">{{ item.label }}</span>
|
|
28
|
+
<span v-if="item.badge" class="tabmenu__badge">{{ item.badge }}</span>
|
|
29
|
+
</a>
|
|
30
|
+
<button
|
|
31
|
+
v-else
|
|
32
|
+
type="button"
|
|
33
|
+
class="tabmenu__link"
|
|
34
|
+
role="menuitem"
|
|
35
|
+
:tabindex="item.disabled ? -1 : 0"
|
|
36
|
+
:disabled="item.disabled"
|
|
37
|
+
:aria-current="index === activeIndex ? 'page' : undefined"
|
|
38
|
+
@click="onTabClick($event, item, index)"
|
|
39
|
+
@keydown="onTabKeydown($event, index)"
|
|
40
|
+
>
|
|
41
|
+
<i v-if="item.icon" :class="item.icon" class="tabmenu__icon"></i>
|
|
42
|
+
<span class="tabmenu__label">{{ item.label }}</span>
|
|
43
|
+
<span v-if="item.badge" class="tabmenu__badge">{{ item.badge }}</span>
|
|
44
|
+
</button>
|
|
45
|
+
</li>
|
|
46
|
+
</ul>
|
|
47
|
+
<div class="tabmenu__inkbar" :style="inkbarStyle"></div>
|
|
48
|
+
</nav>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<style src="./TabMenu.scss"></style>
|
|
52
|
+
|
|
53
|
+
<script setup lang="ts">
|
|
54
|
+
import type { TabMenuProps, TabMenuEmits } from '../../types';
|
|
55
|
+
import { ref, computed, watch, onMounted, nextTick } from "vue";
|
|
56
|
+
|
|
57
|
+
defineOptions({ name: 'FtpTabMenu' });
|
|
58
|
+
|
|
59
|
+
const props = withDefaults(defineProps<TabMenuProps>(), {
|
|
60
|
+
model: () => [],
|
|
61
|
+
activeIndex: 0,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const emit = defineEmits(["update:activeIndex", "tab-change"]);
|
|
65
|
+
|
|
66
|
+
const tabRefs = ref([]);
|
|
67
|
+
const inkbarStyle = ref({});
|
|
68
|
+
|
|
69
|
+
const updateInkbar = async () => {
|
|
70
|
+
await nextTick();
|
|
71
|
+
const activeTab = document.querySelector(".tabmenu__item--active .tabmenu__link");
|
|
72
|
+
if (activeTab) {
|
|
73
|
+
const tabmenu = activeTab.closest(".tabmenu");
|
|
74
|
+
const tabmenuRect = tabmenu?.getBoundingClientRect();
|
|
75
|
+
const tabRect = activeTab.getBoundingClientRect();
|
|
76
|
+
|
|
77
|
+
if (tabmenuRect) {
|
|
78
|
+
inkbarStyle.value = {
|
|
79
|
+
width: `${tabRect.width}px`,
|
|
80
|
+
transform: `translateX(${tabRect.left - tabmenuRect.left}px)`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
onMounted(() => {
|
|
87
|
+
updateInkbar();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
watch(() => props.activeIndex, () => {
|
|
91
|
+
updateInkbar();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const onTabClick = (event: MouseEvent | KeyboardEvent, item: any, index: any) => {
|
|
95
|
+
if (item.disabled) {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (item.command) {
|
|
101
|
+
item.command({ originalEvent: event, item, index });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
emit("update:activeIndex", index);
|
|
105
|
+
emit("tab-change", { originalEvent: event, item, index });
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const onTabKeydown = (event: KeyboardEvent, index: any) => {
|
|
109
|
+
const itemCount = props.model.length;
|
|
110
|
+
|
|
111
|
+
switch (event.key) {
|
|
112
|
+
case "ArrowRight":
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
{
|
|
115
|
+
let nextIndex = index + 1;
|
|
116
|
+
while (nextIndex < itemCount && props.model[nextIndex].disabled) {
|
|
117
|
+
nextIndex++;
|
|
118
|
+
}
|
|
119
|
+
if (nextIndex < itemCount) {
|
|
120
|
+
focusTab(nextIndex);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
case "ArrowLeft":
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
{
|
|
127
|
+
let prevIndex = index - 1;
|
|
128
|
+
while (prevIndex >= 0 && props.model[prevIndex].disabled) {
|
|
129
|
+
prevIndex--;
|
|
130
|
+
}
|
|
131
|
+
if (prevIndex >= 0) {
|
|
132
|
+
focusTab(prevIndex);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
case "Home":
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
{
|
|
139
|
+
let firstIndex = 0;
|
|
140
|
+
while (firstIndex < itemCount && props.model[firstIndex].disabled) {
|
|
141
|
+
firstIndex++;
|
|
142
|
+
}
|
|
143
|
+
if (firstIndex < itemCount) {
|
|
144
|
+
focusTab(firstIndex);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
case "End":
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
{
|
|
151
|
+
let lastIndex = itemCount - 1;
|
|
152
|
+
while (lastIndex >= 0 && props.model[lastIndex].disabled) {
|
|
153
|
+
lastIndex--;
|
|
154
|
+
}
|
|
155
|
+
if (lastIndex >= 0) {
|
|
156
|
+
focusTab(lastIndex);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
case "Enter":
|
|
161
|
+
case " ":
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
onTabClick(event, props.model[index], index);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const focusTab = (index: any) => {
|
|
169
|
+
const tabs = document.querySelectorAll(".tabmenu__link");
|
|
170
|
+
if (tabs[index]) {
|
|
171
|
+
(tabs[index] as HTMLElement).focus();
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="isActive"
|
|
4
|
+
class="tabs__panel"
|
|
5
|
+
role="tabpanel"
|
|
6
|
+
:id="`${tabsContext.tabsId}-panel-${panelIndex}`"
|
|
7
|
+
:aria-labelledby="`${tabsContext.tabsId}-tab-${panelIndex}`"
|
|
8
|
+
:tabindex="0"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import type { TabPanelProps } from '../../types';
|
|
16
|
+
import { computed, inject, onMounted, onBeforeUnmount, ref } from "vue";
|
|
17
|
+
|
|
18
|
+
defineOptions({ name: 'FtpTabPanel' });
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<TabPanelProps>(), {
|
|
21
|
+
disabled: false,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const tabsContext = inject("tabs") as any;
|
|
25
|
+
const panelIndex = ref(-1);
|
|
26
|
+
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
panelIndex.value = tabsContext.registerTab({
|
|
29
|
+
header: props.header,
|
|
30
|
+
disabled: props.disabled,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
onBeforeUnmount(() => {
|
|
35
|
+
if (panelIndex.value !== -1) {
|
|
36
|
+
tabsContext.unregisterTab(panelIndex.value);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const isActive = computed(() => tabsContext.activeIndex.value === panelIndex.value);
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
@use "../../scss/mixins/accent-gradient.scss" as *;
|
|
3
|
+
|
|
4
|
+
$c: tabs;
|
|
5
|
+
|
|
6
|
+
.#{$c} {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
width: 100%;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.#{$c}__nav {
|
|
13
|
+
display: flex;
|
|
14
|
+
position: relative;
|
|
15
|
+
border-bottom: var(--tabs-nav-borderWidth, $tabs-nav-borderWidth) solid var(--tabs-nav-borderColor, $tabs-nav-borderColor);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.#{$c}__tab {
|
|
19
|
+
position: relative;
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
padding: var(--tabs-tab-padding-y, $tabs-tab-padding-y) var(--tabs-tab-padding-x, $tabs-tab-padding-x);
|
|
23
|
+
background: var(--tabs-tab-background-default, $tabs-tab-background-default);
|
|
24
|
+
border: none;
|
|
25
|
+
color: var(--tabs-tab-text-default, $tabs-tab-text-default);
|
|
26
|
+
font-family: inherit;
|
|
27
|
+
font-size: 15px;
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
transition: color 0.15s ease, background-color 0.15s ease;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
|
|
33
|
+
&:hover:not(.#{$c}__tab--disabled) {
|
|
34
|
+
color: var(--tabs-tab-text-hover, $tabs-tab-text-hover);
|
|
35
|
+
background: var(--tabs-tab-background-hover, $tabs-tab-background-hover);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:focus-visible {
|
|
39
|
+
outline: var(--tabs-focus-ringWidth, $tabs-focus-ringWidth) solid var(--tabs-focus-ringColor, $tabs-focus-ringColor);
|
|
40
|
+
outline-offset: var(--tabs-focus-ringOffset, $tabs-focus-ringOffset);
|
|
41
|
+
z-index: 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.#{$c}__tab--active {
|
|
46
|
+
background: linear-gradient(
|
|
47
|
+
90deg,
|
|
48
|
+
var(--accent-gradient-start, $accent-gradient-start),
|
|
49
|
+
var(--accent-gradient-end, $accent-gradient-end)
|
|
50
|
+
);
|
|
51
|
+
-webkit-background-clip: text;
|
|
52
|
+
background-clip: text;
|
|
53
|
+
-webkit-text-fill-color: transparent;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.#{$c}__tab--disabled {
|
|
57
|
+
color: var(--tabs-tab-text-disabled, $tabs-tab-text-disabled);
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
opacity: 0.7;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.#{$c}__indicator {
|
|
63
|
+
position: absolute;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
height: var(--tabs-indicator-height, $tabs-indicator-height);
|
|
67
|
+
@include accent-gradient($angle: 90deg);
|
|
68
|
+
transition: transform 0.2s ease, width 0.2s ease;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.#{$c}__panels {
|
|
72
|
+
flex: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.#{$c}__panel {
|
|
76
|
+
padding: var(--tabs-content-padding, $tabs-content-padding);
|
|
77
|
+
|
|
78
|
+
&:focus-visible {
|
|
79
|
+
outline: var(--tabs-focus-ringWidth, $tabs-focus-ringWidth) solid var(--tabs-focus-ringColor, $tabs-focus-ringColor);
|
|
80
|
+
outline-offset: calc(-1 * var(--tabs-focus-ringOffset, $tabs-focus-ringOffset));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tabs" :class="additionalClasses">
|
|
3
|
+
<div class="tabs__nav" role="tablist" :aria-label="ariaLabel">
|
|
4
|
+
<button
|
|
5
|
+
v-for="(tab, index) in tabs"
|
|
6
|
+
:key="tab.id"
|
|
7
|
+
type="button"
|
|
8
|
+
role="tab"
|
|
9
|
+
class="tabs__tab"
|
|
10
|
+
:class="{
|
|
11
|
+
'tabs__tab--active': index === activeIndex,
|
|
12
|
+
'tabs__tab--disabled': tab.disabled
|
|
13
|
+
}"
|
|
14
|
+
:id="`${tabsId}-tab-${index}`"
|
|
15
|
+
:aria-selected="index === activeIndex"
|
|
16
|
+
:aria-controls="`${tabsId}-panel-${index}`"
|
|
17
|
+
:tabindex="index === activeIndex ? 0 : -1"
|
|
18
|
+
:disabled="tab.disabled"
|
|
19
|
+
@click="onTabClick(index, $event)"
|
|
20
|
+
@keydown="onKeydown($event, index)"
|
|
21
|
+
>
|
|
22
|
+
{{ tab.header }}
|
|
23
|
+
</button>
|
|
24
|
+
<span
|
|
25
|
+
class="tabs__indicator"
|
|
26
|
+
:style="indicatorStyle"
|
|
27
|
+
></span>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="tabs__panels">
|
|
30
|
+
<slot></slot>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<style src="./Tabs.scss"></style>
|
|
36
|
+
|
|
37
|
+
<script setup lang="ts">
|
|
38
|
+
import type { TabsProps, TabsEmits } from '../../types';
|
|
39
|
+
import { ref, computed, provide, onMounted, nextTick, watch } from "vue";
|
|
40
|
+
|
|
41
|
+
defineOptions({ name: 'FtpTabs' });
|
|
42
|
+
|
|
43
|
+
const props = withDefaults(defineProps<TabsProps>(), {
|
|
44
|
+
activeIndex: 0,
|
|
45
|
+
ariaLabel: "Tabs",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const emit = defineEmits(["update:activeIndex", "tabChange", "tabClick"]);
|
|
49
|
+
|
|
50
|
+
// Generate unique ID for accessibility
|
|
51
|
+
const tabsId = `tabs-${Math.random().toString(36).substring(2, 9)}`;
|
|
52
|
+
|
|
53
|
+
// Tab registration
|
|
54
|
+
const tabs = ref<any[]>([]);
|
|
55
|
+
const tabElements = ref([]);
|
|
56
|
+
const navRef = ref(null);
|
|
57
|
+
|
|
58
|
+
const registerTab = (tab: any) => {
|
|
59
|
+
const id = `tab-${tabs.value.length}`;
|
|
60
|
+
tabs.value.push({ ...tab, id });
|
|
61
|
+
return tabs.value.length - 1;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const unregisterTab = (index: any) => {
|
|
65
|
+
tabs.value.splice(index, 1);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Provide context to TabPanel children
|
|
69
|
+
provide("tabs", {
|
|
70
|
+
registerTab,
|
|
71
|
+
unregisterTab,
|
|
72
|
+
activeIndex: computed(() => props.activeIndex),
|
|
73
|
+
tabsId,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Indicator positioning
|
|
77
|
+
const indicatorStyle = ref({});
|
|
78
|
+
|
|
79
|
+
const updateIndicator = async () => {
|
|
80
|
+
await nextTick();
|
|
81
|
+
const activeTab = document.querySelector(`#${tabsId}-tab-${props.activeIndex}`);
|
|
82
|
+
if (activeTab) {
|
|
83
|
+
indicatorStyle.value = {
|
|
84
|
+
width: `${(activeTab as HTMLElement).offsetWidth}px`,
|
|
85
|
+
transform: `translateX(${(activeTab as HTMLElement).offsetLeft}px)`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
onMounted(() => {
|
|
91
|
+
updateIndicator();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
watch(() => props.activeIndex, updateIndicator);
|
|
95
|
+
watch(() => tabs.value.length, updateIndicator);
|
|
96
|
+
|
|
97
|
+
// Event handlers
|
|
98
|
+
const onTabClick = (index: any, event: any) => {
|
|
99
|
+
if (tabs.value[index]?.disabled) return;
|
|
100
|
+
|
|
101
|
+
emit("tabClick", { originalEvent: event, index });
|
|
102
|
+
|
|
103
|
+
if (index !== props.activeIndex) {
|
|
104
|
+
emit("update:activeIndex", index);
|
|
105
|
+
emit("tabChange", { originalEvent: event, index });
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const onKeydown = (event: KeyboardEvent, currentIndex: any) => {
|
|
110
|
+
const tabCount = tabs.value.length;
|
|
111
|
+
let newIndex = currentIndex;
|
|
112
|
+
|
|
113
|
+
switch (event.key) {
|
|
114
|
+
case "ArrowLeft":
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
newIndex = currentIndex - 1;
|
|
117
|
+
if (newIndex < 0) newIndex = tabCount - 1;
|
|
118
|
+
while (tabs.value[newIndex]?.disabled && newIndex !== currentIndex) {
|
|
119
|
+
newIndex = newIndex - 1;
|
|
120
|
+
if (newIndex < 0) newIndex = tabCount - 1;
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case "ArrowRight":
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
newIndex = currentIndex + 1;
|
|
126
|
+
if (newIndex >= tabCount) newIndex = 0;
|
|
127
|
+
while (tabs.value[newIndex]?.disabled && newIndex !== currentIndex) {
|
|
128
|
+
newIndex = newIndex + 1;
|
|
129
|
+
if (newIndex >= tabCount) newIndex = 0;
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
case "Home":
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
newIndex = 0;
|
|
135
|
+
while (tabs.value[newIndex]?.disabled && newIndex < tabCount - 1) {
|
|
136
|
+
newIndex++;
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
case "End":
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
newIndex = tabCount - 1;
|
|
142
|
+
while (tabs.value[newIndex]?.disabled && newIndex > 0) {
|
|
143
|
+
newIndex--;
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
default:
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (newIndex !== currentIndex && !tabs.value[newIndex]?.disabled) {
|
|
151
|
+
emit("update:activeIndex", newIndex);
|
|
152
|
+
emit("tabChange", { originalEvent: event, index: newIndex });
|
|
153
|
+
// Focus the new tab
|
|
154
|
+
nextTick(() => {
|
|
155
|
+
const newTab = document.querySelector(`#${tabsId}-tab-${newIndex}`);
|
|
156
|
+
(newTab as HTMLElement)?.focus();
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const additionalClasses = computed(() => [].filter(Boolean).join(" "));
|
|
162
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use "../../../dist/scss/tokens" as *;
|
|
2
|
+
@use "../../scss/mixins/accent-gradient.scss" as *;
|
|
3
|
+
|
|
4
|
+
$c: tag;
|
|
5
|
+
|
|
6
|
+
.#{$c} {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: var(--tag-gap, $tag-gap);
|
|
10
|
+
padding: var(--tag-padding-y, $tag-padding-y) var(--tag-padding-x, $tag-padding-x);
|
|
11
|
+
font-size: var(--tag-fontSize, $tag-fontSize);
|
|
12
|
+
font-weight: var(--tag-fontWeight, $tag-fontWeight);
|
|
13
|
+
line-height: 1;
|
|
14
|
+
border-radius: var(--tag-radius-default, $tag-radius-default);
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
user-select: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.#{$c}__icon {
|
|
20
|
+
display: inline-flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
font-size: var(--tag-iconSize, $tag-iconSize);
|
|
24
|
+
width: var(--tag-iconSize, $tag-iconSize);
|
|
25
|
+
height: var(--tag-iconSize, $tag-iconSize);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.#{$c}__value {
|
|
29
|
+
display: inline;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Rounded (pill) variant
|
|
33
|
+
.#{$c}--rounded {
|
|
34
|
+
border-radius: var(--tag-radius-rounded, $tag-radius-rounded);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Brand colors
|
|
38
|
+
.#{$c}--color-brand {
|
|
39
|
+
background-color: var(--tag-background-brand, $tag-background-brand);
|
|
40
|
+
color: var(--tag-text-brand, $tag-text-brand);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.#{$c}--color-accent {
|
|
44
|
+
@include accent-gradient();
|
|
45
|
+
color: var(--tag-text-accent, $tag-text-accent);
|
|
46
|
+
text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.#{$c}--color-neutral {
|
|
50
|
+
background-color: var(--tag-background-neutral, $tag-background-neutral);
|
|
51
|
+
color: var(--tag-text-neutral, $tag-text-neutral);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Status colors
|
|
55
|
+
.#{$c}--color-success {
|
|
56
|
+
background-color: var(--tag-background-success, $tag-background-success);
|
|
57
|
+
color: var(--tag-text-success, $tag-text-success);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.#{$c}--color-warning {
|
|
61
|
+
background-color: var(--tag-background-warning, $tag-background-warning);
|
|
62
|
+
color: var(--tag-text-warning, $tag-text-warning);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.#{$c}--color-danger {
|
|
66
|
+
background-color: var(--tag-background-danger, $tag-background-danger);
|
|
67
|
+
color: var(--tag-text-danger, $tag-text-danger);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.#{$c}--color-info {
|
|
71
|
+
background-color: var(--tag-background-info, $tag-background-info);
|
|
72
|
+
color: var(--tag-text-info, $tag-text-info);
|
|
73
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="tag" :class="additionalClasses">
|
|
3
|
+
<slot name="icon">
|
|
4
|
+
<i v-if="icon" :class="icon" class="tag__icon"></i>
|
|
5
|
+
</slot>
|
|
6
|
+
<span v-if="value || $slots.default" class="tag__value">
|
|
7
|
+
<slot>{{ value }}</slot>
|
|
8
|
+
</span>
|
|
9
|
+
</span>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<style src="./Tag.scss"></style>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import type { TagProps } from '../../types';
|
|
16
|
+
import { computed, useSlots } from "vue";
|
|
17
|
+
|
|
18
|
+
defineOptions({ name: 'FtpTag' });
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<TagProps>(), {
|
|
21
|
+
value: null,
|
|
22
|
+
color: "neutral",
|
|
23
|
+
icon: null,
|
|
24
|
+
rounded: false,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const $slots = useSlots();
|
|
28
|
+
|
|
29
|
+
const additionalClasses = computed(() =>
|
|
30
|
+
[
|
|
31
|
+
`tag--color-${props.color}`,
|
|
32
|
+
props.rounded ? "tag--rounded" : "",
|
|
33
|
+
]
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join(" ")
|
|
36
|
+
);
|
|
37
|
+
</script>
|