@leaflink/stash 42.8.1 → 43.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/README.md +1 -1
  2. package/dist/AddressSelect.js +9 -10
  3. package/dist/AddressSelect.js.map +1 -1
  4. package/dist/Alert.js +9 -9
  5. package/dist/Alert.js.map +1 -1
  6. package/dist/AppSidebar.js +11 -11
  7. package/dist/AppSidebar.js.map +1 -1
  8. package/dist/Avatar.js +33 -32
  9. package/dist/Avatar.js.map +1 -1
  10. package/dist/Avatar.vue.d.ts +16 -95
  11. package/dist/Badge.js +2 -2
  12. package/dist/Badge.js.map +1 -1
  13. package/dist/Checkbox.js +4 -4
  14. package/dist/Checkbox.js.map +1 -1
  15. package/dist/{Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js → Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js} +1 -1
  16. package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js.map +1 -0
  17. package/dist/Chip.js +32 -30
  18. package/dist/Chip.js.map +1 -1
  19. package/dist/Chip.vue.d.ts +16 -95
  20. package/dist/ConfirmationCodeInput.js +23 -23
  21. package/dist/ConfirmationCodeInput.js.map +1 -1
  22. package/dist/ContextSwitcher.js +2 -2
  23. package/dist/ContextSwitcher.js.map +1 -1
  24. package/dist/Copy.js +1 -1
  25. package/dist/Copy.js.map +1 -1
  26. package/dist/DataView.js +1 -1
  27. package/dist/DataViewFilters.js +23 -24
  28. package/dist/DataViewFilters.js.map +1 -1
  29. package/dist/DataViewSortButton.js +11 -11
  30. package/dist/DataViewSortButton.js.map +1 -1
  31. package/dist/DataViewToolbar.js +1 -1
  32. package/dist/Dialog.js +10 -10
  33. package/dist/Dialog.js.map +1 -1
  34. package/dist/Dropdown.js +7 -7
  35. package/dist/Dropdown.js.map +1 -1
  36. package/dist/FilterChip.js +2 -3
  37. package/dist/FilterChip.js.map +1 -1
  38. package/dist/FilterDrawerItem.js +5 -6
  39. package/dist/FilterDrawerItem.js.map +1 -1
  40. package/dist/FilterDropdown.js +3 -4
  41. package/dist/FilterDropdown.js.map +1 -1
  42. package/dist/FilterSelect.js +26 -27
  43. package/dist/FilterSelect.js.map +1 -1
  44. package/dist/Filters.js +3 -4
  45. package/dist/Filters.js.map +1 -1
  46. package/dist/HttpError.js +18 -18
  47. package/dist/HttpError.js.map +1 -1
  48. package/dist/IconLabel.js +12 -13
  49. package/dist/IconLabel.js.map +1 -1
  50. package/dist/IconLabel.vue.d.ts +9 -75
  51. package/dist/Illustration.js +1 -1
  52. package/dist/Illustration.js.map +1 -1
  53. package/dist/Illustration.vue.d.ts +19 -14
  54. package/dist/InputOptions.js +7 -8
  55. package/dist/InputOptions.js.map +1 -1
  56. package/dist/LicenseChip.js +32 -26
  57. package/dist/LicenseChip.js.map +1 -1
  58. package/dist/LicenseChip.vue.d.ts +2 -4
  59. package/dist/ListItem.js +1 -1
  60. package/dist/ListView.js +30 -31
  61. package/dist/ListView.js.map +1 -1
  62. package/dist/MenuItem.js +4 -4
  63. package/dist/MenuItem.js.map +1 -1
  64. package/dist/Metric.js +1 -1
  65. package/dist/Metric.js.map +1 -1
  66. package/dist/Metric.vue.d.ts +8 -74
  67. package/dist/Modal.js +13 -13
  68. package/dist/Modal.js.map +1 -1
  69. package/dist/Module.js +1 -1
  70. package/dist/Module.js.map +1 -1
  71. package/dist/ModuleFooter.js +1 -1
  72. package/dist/ModuleFooter.js.map +1 -1
  73. package/dist/ModuleHeader.js +1 -1
  74. package/dist/ModuleHeader.js.map +1 -1
  75. package/dist/PageNavigation.js +28 -29
  76. package/dist/PageNavigation.js.map +1 -1
  77. package/dist/Paginate.js +1 -1
  78. package/dist/Paginate.js.map +1 -1
  79. package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js +11 -0
  80. package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js.map +1 -0
  81. package/dist/QuickAction.js +14 -14
  82. package/dist/QuickAction.js.map +1 -1
  83. package/dist/RadioNew.js +14 -14
  84. package/dist/SearchBar.js +15 -15
  85. package/dist/SearchBar.js.map +1 -1
  86. package/dist/Select.js +92 -93
  87. package/dist/Select.js.map +1 -1
  88. package/dist/SelectStatus.js +53 -51
  89. package/dist/SelectStatus.js.map +1 -1
  90. package/dist/SelectStatus.vue.d.ts +52 -1
  91. package/dist/Step.js +28 -28
  92. package/dist/Step.js.map +1 -1
  93. package/dist/Tab.js +1 -1
  94. package/dist/Table.js +2 -2
  95. package/dist/TableCell.js +2 -2
  96. package/dist/TableHeaderCell.js +2 -2
  97. package/dist/TableHeaderRow.js +2 -2
  98. package/dist/TableRow.js +2 -2
  99. package/dist/Tabs.js +2 -2
  100. package/dist/{Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js → Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js} +3 -3
  101. package/dist/Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js.map +1 -0
  102. package/dist/Textarea.js +1 -1
  103. package/dist/Textarea.js.map +1 -1
  104. package/dist/Toast.js +1 -1
  105. package/dist/Toasts.js +1 -1
  106. package/dist/ToastsPlugin.js +1 -1
  107. package/dist/colorScheme.d.ts +3 -16
  108. package/dist/components.css +1 -1
  109. package/dist/index.d.ts +64 -25
  110. package/dist/index.js +188 -186
  111. package/dist/index.js.map +1 -1
  112. package/dist/statusLevels-a8b041f4.js +7 -0
  113. package/dist/statusLevels-a8b041f4.js.map +1 -0
  114. package/dist/tailwind-base.d.ts +0 -10
  115. package/dist/tailwind-base.js +22 -20
  116. package/dist/tailwind-base.js.map +1 -1
  117. package/dist/utils/colorScheme.js +1 -1
  118. package/dist/utils/colorScheme.js.map +1 -1
  119. package/package.json +1 -1
  120. package/styles/base.css +2 -2
  121. package/tailwind-base.ts +22 -21
  122. package/types/colors.ts +84 -26
  123. package/types/statusLevels.ts +4 -4
  124. package/dist/Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js.map +0 -1
  125. package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js +0 -11
  126. package/dist/Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js.map +0 -1
  127. package/dist/Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js.map +0 -1
  128. package/dist/colors-13e95ebf.js +0 -6
  129. package/dist/colors-13e95ebf.js.map +0 -1
  130. package/dist/statusLevels-aabf1e3c.js +0 -7
  131. package/dist/statusLevels-aabf1e3c.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent as k, useAttrs as S, useCssModule as b, computed as n, openBlock as o, createBlock as C, normalizeClass as l, unref as g, withCtx as d, createElementBlock as i, createElementVNode as a, toDisplayString as c, createVNode as u, normalizeStyle as m } from "vue";
2
- import p from "./Icon.js";
3
- import O from "./Select.js";
4
- import { _ as V } from "./_plugin-vue_export-helper-dad06003.js";
1
+ import { defineComponent as S, useAttrs as b, useCssModule as g, computed as u, openBlock as o, createBlock as C, normalizeClass as l, unref as O, withCtx as d, createElementBlock as i, createElementVNode as a, toDisplayString as c, createVNode as m, normalizeStyle as p } from "vue";
2
+ import f from "./Icon.js";
3
+ import V from "./Select.js";
4
+ import { _ as $ } from "./_plugin-vue_export-helper-dad06003.js";
5
5
  import "lodash-es/uniqueId";
6
6
  import "./index-79ce320f.js";
7
7
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
@@ -20,7 +20,6 @@ import "./constants.js";
20
20
  import "./clickoutside.js";
21
21
  import "./MenusPlugin-5e93f0a5.js";
22
22
  import "./Chip.js";
23
- import "./colors-13e95ebf.js";
24
23
  import "./utils/colorScheme.js";
25
24
  import "./Field.vue_vue_type_script_setup_true_lang-475832fe.js";
26
25
  import "./Label.vue_vue_type_script_setup_true_lang-1d29d98a.js";
@@ -29,7 +28,7 @@ const E = { class: "tw-truncate tw-mr-6" }, N = {
29
28
  key: 1,
30
29
  class: "tw-flex tw-items-center",
31
30
  "data-test": "select-status|value"
32
- }, $ = { class: "tw-truncate tw-ml-1.5 tw-mr-6" }, D = { class: "tw-flex tw-min-w-0" }, I = /* @__PURE__ */ k({
31
+ }, D = { class: "tw-truncate tw-ml-1.5 tw-mr-6" }, I = { class: "tw-flex tw-min-w-0" }, L = /* @__PURE__ */ S({
33
32
  name: "ll-select-status",
34
33
  __name: "SelectStatus",
35
34
  props: {
@@ -44,89 +43,92 @@ const E = { class: "tw-truncate tw-mr-6" }, N = {
44
43
  value: { type: [Number, String, Boolean, null], default: null }
45
44
  },
46
45
  emits: ["update:model-value"],
47
- setup(f, { emit: w }) {
48
- const t = f, y = ["green", "teal", "ice", "yellow", "seafoam", "seafoam-700"], _ = S(), h = b();
49
- if (t.value)
46
+ setup(w, { emit: y }) {
47
+ const e = w, _ = ["green", "teal", "ice", "yellow", "seafoam", "seafoam-700"], h = b(), v = g();
48
+ if (e.value)
50
49
  throw new Error("ll-select-status: use :model-value or v-model instead of :value.");
51
- if (_.onInput)
50
+ if (h.onInput)
52
51
  throw new Error("ll-select-status: use the @update:model-value event instead of @input");
53
- const r = n(() => t.statusOptions.find((s) => s[t.trackBy] === t.modelValue)), v = n(() => {
54
- const { color: s = "" } = r.value || {};
55
- return y.includes(s);
52
+ const r = u(() => e.statusOptions.find((t) => t[e.trackBy] === e.modelValue)), x = u(() => {
53
+ const { color: t = "" } = r.value || {};
54
+ return _.includes(t);
56
55
  });
57
- function B(s) {
58
- return `tw-bg-${s}`;
56
+ function B(t) {
57
+ return t != null && t.includes("-") ? `tw-bg-${t}` : `tw-bg-${t}-500`;
59
58
  }
60
- function x(s) {
61
- w("update:model-value", (s == null ? void 0 : s[t.trackBy]) ?? "");
59
+ function n(t) {
60
+ return t != null && t.includes("-") ? `tw-text-${t}` : `tw-text-${t}-500`;
62
61
  }
63
- return (s, A) => (o(), C(O, {
62
+ function k(t) {
63
+ y("update:model-value", (t == null ? void 0 : t[e.trackBy]) ?? "");
64
+ }
65
+ return (t, A) => (o(), C(V, {
64
66
  ref: "select",
65
67
  "hide-search": "",
66
68
  single: "",
67
69
  class: l([[
68
- g(h).select,
70
+ O(v).select,
69
71
  {
70
- "stash-select-status--filled": t.secondary,
71
- "stash-select-status--filled-dark": t.secondary && v.value
72
+ "stash-select-status--filled": e.secondary,
73
+ "stash-select-status--filled-dark": e.secondary && x.value
72
74
  }
73
75
  ], "stash-select-status"]),
74
- disabled: t.disabled,
75
- icon: !t.disabled && "caret-down",
76
- options: t.statusOptions,
77
- placeholder: t.placeholder,
78
- "track-by": t.trackBy,
76
+ disabled: e.disabled,
77
+ icon: !e.disabled && "caret-down",
78
+ options: e.statusOptions,
79
+ placeholder: e.placeholder,
80
+ "track-by": e.trackBy,
79
81
  "model-value": r.value,
80
82
  "data-test": "stash-select-status",
81
- "onUpdate:modelValue": x
83
+ "onUpdate:modelValue": k
82
84
  }, {
83
- selected: d(({ option: e }) => [
84
- t.secondary ? (o(), i("div", {
85
+ selected: d(({ option: s }) => [
86
+ e.secondary ? (o(), i("div", {
85
87
  key: 0,
86
- class: l(["stash-select-status--selected tw-absolute tw-flex tw-items-center tw-pl-3 tw-rounded tw-h-full tw-inset-0 tw-w-full", [B(e.color)]]),
88
+ class: l(["stash-select-status--selected tw-absolute tw-flex tw-items-center tw-pl-3 tw-rounded tw-h-full tw-inset-0 tw-w-full", [B(s.color)]]),
87
89
  "data-test": "select-status|value"
88
90
  }, [
89
- a("span", E, c(e[t.displayBy]), 1)
91
+ a("span", E, c(s[e.displayBy]), 1)
90
92
  ], 2)) : (o(), i("div", N, [
91
- u(p, {
93
+ m(f, {
92
94
  "data-test": "select-status|value-icon",
93
- name: e.icon || "circle-status",
95
+ name: s.icon || "circle-status",
94
96
  class: l([
95
- { [`tw-text-${e.color}`]: e.color },
96
- { "tw-text-ice-700": !e.color && !e.hexCode }
97
+ { [n(s.color)]: s.color },
98
+ { "tw-text-ice-700": !s.color && !s.hexCode }
97
99
  ]),
98
- style: m({ color: e.hexCode })
100
+ style: p({ color: s.hexCode })
99
101
  }, null, 8, ["name", "class", "style"]),
100
- a("span", $, c(e[t.displayBy]), 1)
102
+ a("span", D, c(s[e.displayBy]), 1)
101
103
  ]))
102
104
  ]),
103
- option: d(({ option: e }) => [
104
- a("div", D, [
105
- u(p, {
105
+ option: d(({ option: s }) => [
106
+ a("div", I, [
107
+ m(f, {
106
108
  "data-test": "svg|status-color",
107
- name: e.icon || "circle-status",
109
+ name: s.icon || "circle-status",
108
110
  class: l([[
109
- { [`tw-text-${e.color}`]: e.color },
110
- { "tw-text-ice-700": !e.color && !e.hexCode }
111
+ { [n(s.color)]: s.color },
112
+ { "tw-text-ice-700": !s.color && !s.hexCode }
111
113
  ], "!tw-shrink-0"]),
112
- style: m({ color: e.hexCode })
114
+ style: p({ color: s.hexCode })
113
115
  }, null, 8, ["name", "class", "style"]),
114
116
  a("span", {
115
117
  "data-test": "span|option-text",
116
- class: l(["tw-ml-1.5", !t.noTruncate && "tw-truncate"])
117
- }, c(e[t.displayBy]), 3)
118
+ class: l(["tw-ml-1.5", !e.noTruncate && "tw-truncate"])
119
+ }, c(s[e.displayBy]), 3)
118
120
  ])
119
121
  ]),
120
122
  _: 1
121
123
  }, 8, ["class", "disabled", "icon", "options", "placeholder", "track-by", "model-value"]));
122
124
  }
123
- }), L = "_select_1wypi_25", M = {
124
- select: L,
125
+ }), M = "_select_1wypi_25", T = {
126
+ select: M,
125
127
  "stash-select__chips": "_stash-select__chips_1wypi_30"
126
128
  }, z = {
127
- $style: M
128
- }, ut = /* @__PURE__ */ V(I, [["__cssModules", z]]);
129
+ $style: T
130
+ }, it = /* @__PURE__ */ $(L, [["__cssModules", z]]);
129
131
  export {
130
- ut as default
132
+ it as default
131
133
  };
132
134
  //# sourceMappingURL=SelectStatus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectStatus.js","sources":["../src/components/SelectStatus/SelectStatus.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useAttrs, useCssModule } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n import Select from '../Select/Select.vue';\n\n defineOptions({\n name: 'll-select-status',\n });\n\n export type SelectStatusOption = {\n id: number | string;\n name: string;\n color?: string;\n };\n\n export interface SelectStatusProps {\n /**\n * Disables the component, if true\n */\n disabled?: boolean;\n /**\n * Which key of the prop option to use for display\n */\n displayBy?: string;\n /**\n * Sets the background color of the component to the color of the selected option\n */\n secondary?: boolean;\n /**\n * Allows option text to wrap to next line when set to true\n */\n noTruncate?: boolean;\n /**\n * Placeholder text\n */\n placeholder?: string;\n /**\n * The list of all options to select the status from\n * each object must have the following structure: { id: number | string, name: string, color?: string }\n */\n statusOptions: Array<SelectStatusOption>;\n /**\n * Default field to track the selected status by\n */\n trackBy?: string;\n /**\n * Sets the currently-selected option for the component\n */\n modelValue: number | string | boolean;\n /**\n * @deprecated Use `:model-value` or `v-model` instead of `:value`.\n */\n value?: number | string | boolean | null;\n }\n\n /**\n * Array containing the available dark fill colors that need a different text color.\n */\n const DARK_FILL_COLORS = ['green', 'teal', 'ice', 'yellow', 'seafoam', 'seafoam-700'];\n\n const attrs = useAttrs();\n const classes = useCssModule();\n\n const props = withDefaults(defineProps<SelectStatusProps>(), {\n disabled: false,\n displayBy: 'name',\n secondary: false,\n noTruncate: false,\n placeholder: 'Select Status',\n trackBy: 'id',\n value: null,\n });\n\n if (props.value) {\n throw new Error('ll-select-status: use :model-value or v-model instead of :value.');\n }\n\n if (attrs.onInput) {\n throw new Error('ll-select-status: use the @update:model-value event instead of @input');\n }\n\n const emit =\n defineEmits<{\n /**\n * Emitted when the model value changes\n */\n (e: 'update:model-value', value: unknown): void;\n }>();\n\n const valueOption = computed(() => {\n return props.statusOptions.find((status) => status[props.trackBy] === props.modelValue);\n });\n\n const hasDarkFill = computed(() => {\n const { color = '' } = valueOption.value || {};\n return DARK_FILL_COLORS.includes(color);\n });\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getBgColor(color: string): string {\n return `tw-bg-${color}`;\n }\n\n function onSelect(value?: SelectStatusOption): void {\n emit('update:model-value', value?.[props.trackBy] ?? '');\n }\n</script>\n\n<template>\n <Select\n ref=\"select\"\n hide-search\n single\n :class=\"[\n classes.select,\n {\n 'stash-select-status--filled': props.secondary,\n 'stash-select-status--filled-dark': props.secondary && hasDarkFill,\n },\n ]\"\n :disabled=\"props.disabled\"\n :icon=\"!props.disabled && 'caret-down'\"\n :options=\"props.statusOptions\"\n :placeholder=\"props.placeholder\"\n :track-by=\"props.trackBy\"\n :model-value=\"valueOption\"\n data-test=\"stash-select-status\"\n class=\"stash-select-status\"\n @update:model-value=\"onSelect\"\n >\n <template #selected=\"{ option }\">\n <div\n v-if=\"props.secondary\"\n class=\"\n stash-select-status--selected\n tw-absolute tw-flex tw-items-center tw-pl-3 tw-rounded tw-h-full tw-inset-0 tw-w-full\n \"\n data-test=\"select-status|value\"\n :class=\"[getBgColor(option.color)]\"\n >\n <span class=\"tw-truncate tw-mr-6\">{{ option[props.displayBy] }}</span>\n </div>\n\n <div v-else class=\"tw-flex tw-items-center\" data-test=\"select-status|value\">\n <Icon\n data-test=\"select-status|value-icon\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [`tw-text-${option.color}`]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n :style=\"{ color: option.hexCode }\"\n />\n <span class=\"tw-truncate tw-ml-1.5 tw-mr-6\">{{ option[props.displayBy] }}</span>\n </div>\n </template>\n\n <template #option=\"{ option }\">\n <div class=\"tw-flex tw-min-w-0\">\n <Icon\n data-test=\"svg|status-color\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [`tw-text-${option.color}`]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n class=\"!tw-shrink-0\"\n :style=\"{ color: option.hexCode }\"\n />\n <span data-test=\"span|option-text\" class=\"tw-ml-1.5\" :class=\"!props.noTruncate && 'tw-truncate'\">\n {{ option[props.displayBy] }}\n </span>\n </div>\n </template>\n </Select>\n</template>\n\n<style module>\n :global(.stash-select-status--filled .stash-select__content) {\n border: none;\n padding: 0;\n }\n\n :global(.stash-select-status--filled\n .stash-select--active\n .stash-select__content:focus-within\n .stash-select__border-selector) {\n box-sizing: content-box;\n max-width: calc(100% - 2px);\n }\n\n :global(.stash-select-status--filled .stash-select-status--selected),\n :global(.stash-select-status--filled :has(.stash-select-status--selected) .icon--caret-down) {\n color: theme('colors.white');\n }\n\n :global(.stash-select-status--filled-dark .stash-select-status--selected),\n :global(.stash-select-status--filled-dark :has(.stash-select-status--selected) .icon--caret-down) {\n color: theme('colors.ice.900');\n }\n\n .select :global(.stash-select--disabled > .stash-select__content) {\n background-color: transparent;\n border-color: transparent;\n }\n\n .select :deep(.stash-select__chips) {\n margin: 0;\n }\n\n .select :global(.stash-select__options) {\n margin: 0;\n padding: 0;\n }\n\n .select ul {\n position: relative;\n }\n</style>\n"],"names":["DARK_FILL_COLORS","attrs","useAttrs","classes","useCssModule","props","valueOption","computed","status","hasDarkFill","color","getBgColor","onSelect","value","emit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2DQA,IAAmB,CAAC,SAAS,QAAQ,OAAO,UAAU,WAAW,aAAa,GAE9EC,IAAQC,KACRC,IAAUC;AAYhB,QAAIC,EAAM;AACF,YAAA,IAAI,MAAM,kEAAkE;AAGpF,QAAIJ,EAAM;AACF,YAAA,IAAI,MAAM,uEAAuE;AAWnF,UAAAK,IAAcC,EAAS,MACpBF,EAAM,cAAc,KAAK,CAACG,MAAWA,EAAOH,EAAM,OAAO,MAAMA,EAAM,UAAU,CACvF,GAEKI,IAAcF,EAAS,MAAM;AACjC,YAAM,EAAE,OAAAG,IAAQ,GAAA,IAAOJ,EAAY,SAAS,CAAA;AACrC,aAAAN,EAAiB,SAASU,CAAK;AAAA,IAAA,CACvC;AAMD,aAASC,EAAWD,GAAuB;AACzC,aAAO,SAASA,CAAK;AAAA,IACvB;AAEA,aAASE,EAASC,GAAkC;AAClD,MAAAC,EAAK,uBAAsBD,KAAA,gBAAAA,EAAQR,EAAM,aAAY,EAAE;AAAA,IACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SelectStatus.js","sources":["../src/components/SelectStatus/SelectStatus.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, useAttrs, useCssModule } from 'vue';\n\n import { StashCommonColor, StashPrimaryColorGroup } from '../../../types';\n import { IconName } from '../Icon/Icon.types';\n import Icon from '../Icon/Icon.vue';\n import Select from '../Select/Select.vue';\n\n defineOptions({\n name: 'll-select-status',\n });\n\n export type SelectStatusOption = {\n id: number | string;\n name: string;\n color?: StashPrimaryColorGroup | StashCommonColor; // todo: just `StashPrimaryColor`?.\n icon?: IconName;\n };\n\n export interface SelectStatusProps {\n /**\n * Disables the component, if true\n */\n disabled?: boolean;\n /**\n * Which key of the prop option to use for display\n */\n displayBy?: string;\n /**\n * Sets the background color of the component to the color of the selected option\n */\n secondary?: boolean;\n /**\n * Allows option text to wrap to next line when set to true\n */\n noTruncate?: boolean;\n /**\n * Placeholder text\n */\n placeholder?: string;\n /**\n * The list of all options to select the status from\n * each object must have the following structure: { id: number | string, name: string, color?: string }\n */\n statusOptions: Array<SelectStatusOption>;\n /**\n * Default field to track the selected status by\n */\n trackBy?: string;\n /**\n * Sets the currently-selected option for the component\n */\n modelValue: number | string | boolean;\n /**\n * @deprecated Use `:model-value` or `v-model` instead of `:value`.\n */\n value?: number | string | boolean | null;\n }\n\n /**\n * Array containing the available dark fill colors that need a different text color.\n */\n const DARK_FILL_COLORS = ['green', 'teal', 'ice', 'yellow', 'seafoam', 'seafoam-700'];\n\n const attrs = useAttrs();\n const classes = useCssModule();\n\n const props = withDefaults(defineProps<SelectStatusProps>(), {\n disabled: false,\n displayBy: 'name',\n secondary: false,\n noTruncate: false,\n placeholder: 'Select Status',\n trackBy: 'id',\n value: null,\n });\n\n if (props.value) {\n throw new Error('ll-select-status: use :model-value or v-model instead of :value.');\n }\n\n if (attrs.onInput) {\n throw new Error('ll-select-status: use the @update:model-value event instead of @input');\n }\n\n const emit =\n defineEmits<{\n /**\n * Emitted when the model value changes\n */\n (e: 'update:model-value', value: unknown): void;\n }>();\n\n const valueOption = computed(() => {\n return props.statusOptions.find((status) => status[props.trackBy] === props.modelValue);\n });\n\n const hasDarkFill = computed(() => {\n const { color = '' } = valueOption.value || {};\n return DARK_FILL_COLORS.includes(color);\n });\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getBgColor(color: SelectStatusOption['color']): string {\n // if there's no hyphen then it's a color name and has no shade, so we default to 500\n return color?.includes('-') ? `tw-bg-${color}` : `tw-bg-${color}-500`;\n }\n\n /**\n * @param {string} color Valid color name\n * @return {string} tailwind class for given color\n */\n function getTextColor(color: SelectStatusOption['color']): string {\n // if there's no hyphen then it's a color name and has no shade, so we default to 500\n return color?.includes('-') ? `tw-text-${color}` : `tw-text-${color}-500`;\n }\n\n function onSelect(value?: SelectStatusOption): void {\n emit('update:model-value', value?.[props.trackBy] ?? '');\n }\n</script>\n\n<template>\n <Select\n ref=\"select\"\n hide-search\n single\n :class=\"[\n classes.select,\n {\n 'stash-select-status--filled': props.secondary,\n 'stash-select-status--filled-dark': props.secondary && hasDarkFill,\n },\n ]\"\n :disabled=\"props.disabled\"\n :icon=\"!props.disabled && 'caret-down'\"\n :options=\"props.statusOptions\"\n :placeholder=\"props.placeholder\"\n :track-by=\"props.trackBy\"\n :model-value=\"valueOption\"\n data-test=\"stash-select-status\"\n class=\"stash-select-status\"\n @update:model-value=\"onSelect\"\n >\n <template #selected=\"{ option }\">\n <div\n v-if=\"props.secondary\"\n class=\"\n stash-select-status--selected\n tw-absolute tw-flex tw-items-center tw-pl-3 tw-rounded tw-h-full tw-inset-0 tw-w-full\n \"\n data-test=\"select-status|value\"\n :class=\"[getBgColor(option.color)]\"\n >\n <span class=\"tw-truncate tw-mr-6\">{{ option[props.displayBy] }}</span>\n </div>\n\n <div v-else class=\"tw-flex tw-items-center\" data-test=\"select-status|value\">\n <Icon\n data-test=\"select-status|value-icon\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [getTextColor(option.color)]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n :style=\"{ color: option.hexCode }\"\n />\n <span class=\"tw-truncate tw-ml-1.5 tw-mr-6\">{{ option[props.displayBy] }}</span>\n </div>\n </template>\n\n <template #option=\"{ option }\">\n <div class=\"tw-flex tw-min-w-0\">\n <Icon\n data-test=\"svg|status-color\"\n :name=\"option.icon || 'circle-status'\"\n :class=\"[\n { [getTextColor(option.color)]: option.color },\n { 'tw-text-ice-700': !option.color && !option.hexCode },\n ]\"\n class=\"!tw-shrink-0\"\n :style=\"{ color: option.hexCode }\"\n />\n <span data-test=\"span|option-text\" class=\"tw-ml-1.5\" :class=\"!props.noTruncate && 'tw-truncate'\">\n {{ option[props.displayBy] }}\n </span>\n </div>\n </template>\n </Select>\n</template>\n\n<style module>\n :global(.stash-select-status--filled .stash-select__content) {\n border: none;\n padding: 0;\n }\n\n :global(.stash-select-status--filled\n .stash-select--active\n .stash-select__content:focus-within\n .stash-select__border-selector) {\n box-sizing: content-box;\n max-width: calc(100% - 2px);\n }\n\n :global(.stash-select-status--filled .stash-select-status--selected),\n :global(.stash-select-status--filled :has(.stash-select-status--selected) .icon--caret-down) {\n color: theme('colors.white');\n }\n\n :global(.stash-select-status--filled-dark .stash-select-status--selected),\n :global(.stash-select-status--filled-dark :has(.stash-select-status--selected) .icon--caret-down) {\n color: theme('colors.ice.900');\n }\n\n .select :global(.stash-select--disabled > .stash-select__content) {\n background-color: transparent;\n border-color: transparent;\n }\n\n .select :deep(.stash-select__chips) {\n margin: 0;\n }\n\n .select :global(.stash-select__options) {\n margin: 0;\n padding: 0;\n }\n\n .select ul {\n position: relative;\n }\n</style>\n"],"names":["DARK_FILL_COLORS","attrs","useAttrs","classes","useCssModule","props","valueOption","computed","status","hasDarkFill","color","getBgColor","getTextColor","onSelect","value","emit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8DQA,IAAmB,CAAC,SAAS,QAAQ,OAAO,UAAU,WAAW,aAAa,GAE9EC,IAAQC,KACRC,IAAUC;AAYhB,QAAIC,EAAM;AACF,YAAA,IAAI,MAAM,kEAAkE;AAGpF,QAAIJ,EAAM;AACF,YAAA,IAAI,MAAM,uEAAuE;AAWnF,UAAAK,IAAcC,EAAS,MACpBF,EAAM,cAAc,KAAK,CAACG,MAAWA,EAAOH,EAAM,OAAO,MAAMA,EAAM,UAAU,CACvF,GAEKI,IAAcF,EAAS,MAAM;AACjC,YAAM,EAAE,OAAAG,IAAQ,GAAA,IAAOJ,EAAY,SAAS,CAAA;AACrC,aAAAN,EAAiB,SAASU,CAAK;AAAA,IAAA,CACvC;AAMD,aAASC,EAAWD,GAA4C;AAEvD,aAAAA,KAAA,QAAAA,EAAO,SAAS,OAAO,SAASA,CAAK,KAAK,SAASA,CAAK;AAAA,IACjE;AAMA,aAASE,EAAaF,GAA4C;AAEzD,aAAAA,KAAA,QAAAA,EAAO,SAAS,OAAO,WAAWA,CAAK,KAAK,WAAWA,CAAK;AAAA,IACrE;AAEA,aAASG,EAASC,GAAkC;AAClD,MAAAC,EAAK,uBAAsBD,KAAA,gBAAAA,EAAQT,EAAM,aAAY,EAAE;AAAA,IACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -58,10 +58,15 @@ declare const _default: DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRunt
58
58
  }, {}>;
59
59
  export default _default;
60
60
 
61
+ declare type IconName = typeof iconNames[number];
62
+
63
+ declare const iconNames: readonly ["action-dots", "activity", "alert-bell", "archive", "arrow-down", "arrow-left", "arrow-right", "arrow-up", "badge-discount", "badge-seller-elite", "badge-seller-power", "book-customer", "building-office", "bulk-add", "calendar-reschedule", "calendar", "caret-down", "caret-up", "cart-active", "cart-plus", "change-log", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "circle-check", "circle-close", "circle-dollar", "circle-info", "circle-partial", "circle-percent", "circle-question-mark", "circle-status", "circle-warning", "clipboard-checkmark", "clipboard-inventory", "close", "combine", "compass", "contact", "contract", "copy", "credit-card", "credit-profile", "dashboard", "document-accept", "document-invoice", "document-recieved", "document-sent", "document-view", "document", "dolly", "download", "edit", "ellipsis", "envelope-open", "envelope", "export", "figma", "file-csv", "file", "filter-funnel", "filter-line", "flag", "folder", "folder-bar-graph", "folder-orders", "gear", "github", "globe", "graph-bar-chart", "graph-line-chart", "graph-pie-chart", "hazard", "hazard-outline", "headset-agent", "headset-mic", "heart-filled", "heart-outline", "hide", "history", "image", "keyboard-return", "license-approved", "license-certificate", "lightbulb", "link-add", "link-unlink", "link", "list-items", "loading-big", "loading-small", "location", "lock-unlock", "lock", "logo-facebook", "logo-instagram", "logo-linkedin", "logo-ll", "logo-metrc", "logo-plaid", "logo-x", "logo-youtube", "logout", "medical", "megaphone-sound", "megaphone", "menu", "message-dispute", "message-reply", "message", "minus", "mj-leaf", "money", "note-add", "note", "open-in-new", "paperclip", "performance", "phone", "plus", "preview", "print", "product-menu-manage", "product-menu-search", "product-menu", "queue-add", "queue", "recent", "refresh", "register", "reply", "report-download", "sample", "save", "scale-law", "scale-weight", "search", "seed-cycle", "share", "shop-bag-browse", "shop-bag-reorder", "shop-bag", "shop-basket", "shop-cart-add", "shop-cart", "show", "sign-dollar", "sign-percent", "sort", "split", "star-filled", "star-outline", "storefront", "submit", "swap-horizontal", "swap-vertical", "tag-star", "tag", "test-results", "ticket-star", "ticket", "tool-dropper", "tool-wrench", "transfer", "trashcan", "truck", "upload", "user-add", "user-admin", "user-check", "user", "view-card", "view-detailed", "view-list", "warehouse", "working"];
64
+
61
65
  export declare type SelectStatusOption = {
62
66
  id: number | string;
63
67
  name: string;
64
- color?: string;
68
+ color?: StashPrimaryColorGroup | StashCommonColor;
69
+ icon?: IconName;
65
70
  };
66
71
 
67
72
  export declare interface SelectStatusProps {
@@ -104,4 +109,50 @@ export declare interface SelectStatusProps {
104
109
  value?: number | string | boolean | null;
105
110
  }
106
111
 
112
+ declare type StashCommonColor = `${StashCommonColors}`;
113
+
114
+ /**
115
+ * A limited list of stash brand colors, only including their 100, 500, and 700 shades.
116
+ */
117
+ declare enum StashCommonColors {
118
+ Purple700 = "purple-700",
119
+ Purple500 = "purple-500",
120
+ Purple100 = "purple-100",
121
+ Royal700 = "royal-700",
122
+ Royal500 = "royal-500",
123
+ Royal100 = "royal-100",
124
+ Blue700 = "blue-700",
125
+ Blue500 = "blue-500",
126
+ Blue100 = "blue-100",
127
+ Teal700 = "teal-700",
128
+ Teal500 = "teal-500",
129
+ Teal100 = "teal-100",
130
+ Green700 = "green-700",
131
+ Green500 = "green-500",
132
+ Green100 = "green-100",
133
+ Seafoam700 = "seafoam-700",
134
+ Seafoam500 = "seafoam-500",
135
+ Seafoam100 = "seafoam-100",
136
+ Yellow700 = "yellow-700",
137
+ Yellow500 = "yellow-500",
138
+ Yellow100 = "yellow-100",
139
+ Orange700 = "orange-700",
140
+ Orange500 = "orange-500",
141
+ Orange100 = "orange-100",
142
+ Red700 = "red-700",
143
+ Red500 = "red-500",
144
+ Red100 = "red-100",
145
+ Ice700 = "ice-700",
146
+ Ice500 = "ice-500",
147
+ Ice200 = "ice-200",// This is the one outlier, but it's used purposefully in a few places
148
+ Ice100 = "ice-100",
149
+ White = "white",
150
+ Black = "black"
151
+ }
152
+
153
+ /**
154
+ * The names of the color groups.
155
+ */
156
+ declare type StashPrimaryColorGroup = 'blue' | 'green' | 'ice' | 'orange' | 'purple' | 'red' | 'royal' | 'seafoam' | 'teal' | 'yellow';
157
+
107
158
  export { }
package/dist/Step.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as f, useSlots as v, useCssModule as h, inject as x, computed as _, onBeforeMount as y, openBlock as a, createElementBlock as r, normalizeClass as c, unref as t, createElementVNode as i, createBlock as B, toDisplayString as m, createCommentVNode as u, renderSlot as k } from "vue";
1
+ import { defineComponent as f, useSlots as v, useCssModule as y, inject as h, computed as _, onBeforeMount as x, openBlock as a, createElementBlock as d, normalizeClass as o, unref as t, createElementVNode as i, createBlock as B, toDisplayString as m, createCommentVNode as u, renderSlot as k } from "vue";
2
2
  import b from "./Icon.js";
3
3
  import { S as g } from "./keys-7ecef029.js";
4
4
  import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
@@ -20,19 +20,19 @@ const C = {
20
20
  disabled: { type: Boolean, default: !1 }
21
21
  },
22
22
  setup(w) {
23
- const e = w, n = v(), l = h(), s = x(g), o = _(() => (s == null ? void 0 : s.orientation) === "horizontal"), d = _(() => (s == null ? void 0 : s.theme) === "light");
24
- return y(() => {
23
+ const e = w, r = v(), l = y(), s = h(g), c = _(() => (s == null ? void 0 : s.orientation) === "horizontal"), n = _(() => (s == null ? void 0 : s.theme) === "light");
24
+ return x(() => {
25
25
  s && s.registerStep(e.nested);
26
- }), (p, D) => (a(), r("li", {
27
- class: c(["stash-step tw-flex tw-relative tw-w-full", [
26
+ }), (p, D) => (a(), d("li", {
27
+ class: o(["stash-step tw-flex tw-relative tw-w-full", [
28
28
  t(l).step,
29
- { [t(l)["nested-step--active"]]: e.nested && e.active, "last:tw-w-auto": o.value }
29
+ { [t(l)["nested-step--active"]]: e.nested && e.active, "last:tw-w-auto": c.value }
30
30
  ]]),
31
31
  "data-test": "stash-step"
32
32
  }, [
33
- e.nested ? u("", !0) : (a(), r("div", C, [
33
+ e.nested ? u("", !0) : (a(), d("div", C, [
34
34
  i("div", {
35
- class: c([
35
+ class: o([
36
36
  t(l).circle,
37
37
  {
38
38
  [t(l)["circle--todo"]]: !e.error && !e.active && !e.completed,
@@ -46,44 +46,44 @@ const C = {
46
46
  key: 0,
47
47
  name: e.completed ? "circle-check" : "circle-info",
48
48
  size: "dense"
49
- }, null, 8, ["name"])) : (a(), r("span", S, m(e.step), 1))
49
+ }, null, 8, ["name"])) : (a(), d("span", S, m(e.step), 1))
50
50
  ], 2),
51
51
  i("div", {
52
- class: c(["tw-my-1.5 tw-bg-ice tw-w-[1px]", [
52
+ class: o(["tw-my-1.5 tw-bg-ice-500 tw-w-[1px]", [
53
53
  t(l).line,
54
- { [t(l)["line--expanded"]]: e.completed || e.active, "tw-hidden": o.value }
54
+ { [t(l)["line--expanded"]]: e.completed || e.active, "tw-hidden": c.value }
55
55
  ]])
56
56
  }, null, 2)
57
57
  ])),
58
58
  i("div", {
59
- class: c(["tw-flex", [
59
+ class: o(["tw-flex", [
60
60
  {
61
- "tw-flex-row tw-items-center tw-w-full": o.value,
62
- "tw-flex-col": !o.value
61
+ "tw-flex-row tw-items-center tw-w-full": c.value,
62
+ "tw-flex-col": !c.value
63
63
  }
64
64
  ]])
65
65
  }, [
66
66
  i("div", {
67
- class: c(["tw-whitespace-nowrap", [
67
+ class: o(["tw-whitespace-nowrap", [
68
68
  t(l).title,
69
69
  {
70
70
  "tw-cursor-pointer": !e.active && (e.completed || e.error),
71
71
  "tw-cursor-not-allowed": e.disabled,
72
- "tw-text-ice-900": d.value,
72
+ "tw-text-ice-900": n.value,
73
73
  "!tw-font-semibold": e.active,
74
- "tw-text-white": !e.disabled && !d.value
74
+ "tw-text-white": !e.disabled && !n.value
75
75
  }
76
76
  ]])
77
77
  }, m(e.text), 3),
78
- o.value ? (a(), r("div", {
78
+ c.value ? (a(), d("div", {
79
79
  key: 0,
80
- class: c(["tw-border-t tw-mx-1.5 group-last:tw-hidden", [t(l).line, { [t(l)["line--expanded"]]: e.completed || e.active }]])
80
+ class: o(["tw-border-t tw-mx-1.5 group-last:tw-hidden", [t(l).line, { [t(l)["line--expanded"]]: e.completed || e.active }]])
81
81
  }, null, 2)) : u("", !0),
82
82
  i("div", {
83
- class: c({ "tw-pb-9": !p.nested && !t(n).default, "tw-hidden": o.value })
83
+ class: o({ "tw-pb-9": !p.nested && !t(r).default, "tw-hidden": c.value })
84
84
  }, [
85
85
  i("ul", {
86
- class: c([t(l).nested, { "tw-hidden": !t(n).default }])
86
+ class: o([t(l).nested, { "tw-hidden": !t(r).default }])
87
87
  }, [
88
88
  k(p.$slots, "default")
89
89
  ], 2)
@@ -91,17 +91,17 @@ const C = {
91
91
  ], 2)
92
92
  ], 2));
93
93
  }
94
- }), M = "_step_1t7l4_2", N = "_title_1t7l4_11", I = "_line_1t7l4_22", T = "_circle_1t7l4_35", P = "_nested_1t7l4_18", V = {
94
+ }), M = "_step_s5dyo_2", N = "_title_s5dyo_11", I = "_line_s5dyo_22", T = "_circle_s5dyo_35", P = "_nested_s5dyo_18", V = {
95
95
  step: M,
96
96
  title: N,
97
- "nested-step--active": "_nested-step--active_1t7l4_18",
97
+ "nested-step--active": "_nested-step--active_s5dyo_18",
98
98
  line: I,
99
- "line--expanded": "_line--expanded_1t7l4_31",
99
+ "line--expanded": "_line--expanded_s5dyo_31",
100
100
  circle: T,
101
- "circle--todo": "_circle--todo_1t7l4_46",
102
- "circle--active": "_circle--active_1t7l4_52",
103
- "circle--completed": "_circle--completed_1t7l4_58",
104
- "circle--error": "_circle--error_1t7l4_65",
101
+ "circle--todo": "_circle--todo_s5dyo_46",
102
+ "circle--active": "_circle--active_s5dyo_52",
103
+ "circle--completed": "_circle--completed_s5dyo_58",
104
+ "circle--error": "_circle--error_s5dyo_65",
105
105
  nested: P
106
106
  }, $ = {
107
107
  $style: V
package/dist/Step.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","sources":["../src/components/Step/Step.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, useCssModule, useSlots } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n import { STEPPER_INJECTION_KEY } from '../Stepper/keys';\n\n export interface StepProps {\n /**\n * Indicates if the step is currently active.\n * This takes precedence over `completed` and `error`\n */\n active?: boolean;\n /**\n * Indicates if the step is completed\n */\n completed?: boolean;\n /**\n * Indicates if the step has an error\n * This takes precedence over `completed`\n */\n error?: boolean;\n /**\n * The text to display in the step\n */\n text: string;\n /**\n * Indicates if the step is nested\n */\n nested?: boolean;\n /**\n * The text to display in the step circle\n */\n step?: string;\n /**\n * Indicates if the step is disabled\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<StepProps>(), {\n active: false,\n completed: false,\n error: false,\n nested: false,\n step: undefined,\n disabled: false,\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n\n const injectedStepper = inject(STEPPER_INJECTION_KEY);\n\n const isHorizontal = computed(() => injectedStepper?.orientation === 'horizontal');\n\n const isLightThemed = computed(() => injectedStepper?.theme === 'light');\n\n // OnBeforeMount ensures that steps and substeps are registered in the correct order\n onBeforeMount(() => {\n if (injectedStepper) {\n injectedStepper.registerStep(props.nested);\n }\n });\n</script>\n\n<template>\n <li\n class=\"stash-step tw-flex tw-relative tw-w-full\"\n data-test=\"stash-step\"\n :class=\"[\n classes.step,\n { [classes['nested-step--active']]: props.nested && props.active, 'last:tw-w-auto': isHorizontal },\n ]\"\n >\n <div v-if=\"!props.nested\" class=\"tw-flex tw-flex-col tw-items-center tw-mr-3\">\n <div\n :class=\"[\n classes.circle,\n {\n [classes['circle--todo']]: !props.error && !props.active && !props.completed,\n [classes['circle--error']]: props.error && !props.active,\n [classes['circle--completed']]: props.completed && !props.active,\n [classes['circle--active']]: props.active,\n },\n ]\"\n >\n <Icon\n v-if=\"(props.completed || props.error) && !props.active\"\n :name=\"props.completed ? 'circle-check' : 'circle-info'\"\n size=\"dense\"\n />\n <span v-else>{{ props.step }}</span>\n </div>\n <div\n class=\"tw-my-1.5 tw-bg-ice tw-w-[1px]\"\n :class=\"[\n classes.line,\n { [classes['line--expanded']]: props.completed || props.active, 'tw-hidden': isHorizontal },\n ]\"\n />\n </div>\n <div\n class=\"tw-flex\"\n :class=\"[\n {\n 'tw-flex-row tw-items-center tw-w-full': isHorizontal,\n 'tw-flex-col': !isHorizontal,\n },\n ]\"\n >\n <div\n class=\"tw-whitespace-nowrap\"\n :class=\"[\n classes.title,\n {\n 'tw-cursor-pointer': !props.active && (props.completed || props.error),\n 'tw-cursor-not-allowed': props.disabled,\n 'tw-text-ice-900': isLightThemed,\n '!tw-font-semibold': props.active,\n 'tw-text-white': !props.disabled && !isLightThemed,\n },\n ]\"\n >\n {{ props.text }}\n </div>\n <div\n v-if=\"isHorizontal\"\n class=\"tw-border-t tw-mx-1.5 group-last:tw-hidden\"\n :class=\"[classes.line, { [classes['line--expanded']]: props.completed || props.active }]\"\n />\n <div :class=\"{ 'tw-pb-9': !nested && !slots.default, 'tw-hidden': isHorizontal }\">\n <ul :class=\"[classes.nested, { 'tw-hidden': !slots.default }]\">\n <!-- @slot Default slot to compose multiple nested steps -->\n <slot></slot>\n </ul>\n </div>\n </div>\n </li>\n</template>\n\n<style module>\n .step::before {\n content: '●';\n position: absolute;\n color: theme('colors.white');\n left: -28px;\n opacity: 0;\n transition: opacity 500ms cubic-bezier(0.85, 0, 0.15, 1);\n }\n\n .title {\n font-weight: theme('fontWeight.medium');\n font-size: 1rem;\n margin-top: 1px;\n user-select: none;\n }\n\n .nested-step--active::before {\n opacity: 1;\n }\n\n .line {\n flex-grow: 0;\n transition: flex-grow 500ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n\n .step:last-child .line {\n display: none;\n }\n\n .line--expanded {\n flex-grow: 1;\n }\n\n .circle {\n width: theme('spacing.6');\n height: theme('spacing.6');\n line-height: theme('spacing.6');\n border-radius: theme('borderRadius.full');\n display: grid;\n place-items: center;\n font-weight: theme('fontWeight.medium');\n transition: background-color 500ms, color 500ms;\n }\n\n .circle--todo {\n background-color: rgb(255 255 255 / 50%);\n color: #4d4a69;\n border: 1px solid #747293;\n }\n\n .circle--active {\n background-color: theme('colors.blue.DEFAULT');\n color: theme('colors.white');\n border: 1px solid transparent;\n }\n\n .circle--completed {\n background-color: theme('colors.white');\n border: 1px solid theme('colors.ice.DEFAULT');\n color: theme('colors.green.DEFAULT');\n cursor: pointer;\n }\n\n .circle--error {\n background-color: theme('colors.white');\n border: 1px solid theme('colors.ice.DEFAULT');\n color: theme('colors.red.DEFAULT');\n cursor: pointer;\n }\n\n .nested {\n padding: calc(theme('spacing.3') + theme('spacing[1.5]')) 0;\n }\n\n .nested li + li {\n margin-top: theme('spacing.3');\n }\n\n .nested .title {\n font-weight: theme('fontWeight.normal');\n font-size: 0.9rem;\n }\n</style>\n"],"names":["slots","useSlots","classes","useCssModule","injectedStepper","inject","STEPPER_INJECTION_KEY","isHorizontal","computed","isLightThemed","onBeforeMount","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAQC,KACRC,IAAUC,KAEVC,IAAkBC,EAAOC,CAAqB,GAE9CC,IAAeC,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,iBAAgB,YAAY,GAE3EK,IAAgBD,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,WAAU,OAAO;AAGvE,WAAAM,EAAc,MAAM;AAClB,MAAIN,KACcA,EAAA,aAAaO,EAAM,MAAM;AAAA,IAC3C,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Step.js","sources":["../src/components/Step/Step.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, onBeforeMount, useCssModule, useSlots } from 'vue';\n\n import Icon from '../Icon/Icon.vue';\n import { STEPPER_INJECTION_KEY } from '../Stepper/keys';\n\n export interface StepProps {\n /**\n * Indicates if the step is currently active.\n * This takes precedence over `completed` and `error`\n */\n active?: boolean;\n /**\n * Indicates if the step is completed\n */\n completed?: boolean;\n /**\n * Indicates if the step has an error\n * This takes precedence over `completed`\n */\n error?: boolean;\n /**\n * The text to display in the step\n */\n text: string;\n /**\n * Indicates if the step is nested\n */\n nested?: boolean;\n /**\n * The text to display in the step circle\n */\n step?: string;\n /**\n * Indicates if the step is disabled\n */\n disabled?: boolean;\n }\n\n const props = withDefaults(defineProps<StepProps>(), {\n active: false,\n completed: false,\n error: false,\n nested: false,\n step: undefined,\n disabled: false,\n });\n\n const slots = useSlots();\n const classes = useCssModule();\n\n const injectedStepper = inject(STEPPER_INJECTION_KEY);\n\n const isHorizontal = computed(() => injectedStepper?.orientation === 'horizontal');\n\n const isLightThemed = computed(() => injectedStepper?.theme === 'light');\n\n // OnBeforeMount ensures that steps and substeps are registered in the correct order\n onBeforeMount(() => {\n if (injectedStepper) {\n injectedStepper.registerStep(props.nested);\n }\n });\n</script>\n\n<template>\n <li\n class=\"stash-step tw-flex tw-relative tw-w-full\"\n data-test=\"stash-step\"\n :class=\"[\n classes.step,\n { [classes['nested-step--active']]: props.nested && props.active, 'last:tw-w-auto': isHorizontal },\n ]\"\n >\n <div v-if=\"!props.nested\" class=\"tw-flex tw-flex-col tw-items-center tw-mr-3\">\n <div\n :class=\"[\n classes.circle,\n {\n [classes['circle--todo']]: !props.error && !props.active && !props.completed,\n [classes['circle--error']]: props.error && !props.active,\n [classes['circle--completed']]: props.completed && !props.active,\n [classes['circle--active']]: props.active,\n },\n ]\"\n >\n <Icon\n v-if=\"(props.completed || props.error) && !props.active\"\n :name=\"props.completed ? 'circle-check' : 'circle-info'\"\n size=\"dense\"\n />\n <span v-else>{{ props.step }}</span>\n </div>\n <div\n class=\"tw-my-1.5 tw-bg-ice-500 tw-w-[1px]\"\n :class=\"[\n classes.line,\n { [classes['line--expanded']]: props.completed || props.active, 'tw-hidden': isHorizontal },\n ]\"\n />\n </div>\n <div\n class=\"tw-flex\"\n :class=\"[\n {\n 'tw-flex-row tw-items-center tw-w-full': isHorizontal,\n 'tw-flex-col': !isHorizontal,\n },\n ]\"\n >\n <div\n class=\"tw-whitespace-nowrap\"\n :class=\"[\n classes.title,\n {\n 'tw-cursor-pointer': !props.active && (props.completed || props.error),\n 'tw-cursor-not-allowed': props.disabled,\n 'tw-text-ice-900': isLightThemed,\n '!tw-font-semibold': props.active,\n 'tw-text-white': !props.disabled && !isLightThemed,\n },\n ]\"\n >\n {{ props.text }}\n </div>\n <div\n v-if=\"isHorizontal\"\n class=\"tw-border-t tw-mx-1.5 group-last:tw-hidden\"\n :class=\"[classes.line, { [classes['line--expanded']]: props.completed || props.active }]\"\n />\n <div :class=\"{ 'tw-pb-9': !nested && !slots.default, 'tw-hidden': isHorizontal }\">\n <ul :class=\"[classes.nested, { 'tw-hidden': !slots.default }]\">\n <!-- @slot Default slot to compose multiple nested steps -->\n <slot></slot>\n </ul>\n </div>\n </div>\n </li>\n</template>\n\n<style module>\n .step::before {\n content: '●';\n position: absolute;\n color: theme('colors.white');\n left: -28px;\n opacity: 0;\n transition: opacity 500ms cubic-bezier(0.85, 0, 0.15, 1);\n }\n\n .title {\n font-weight: theme('fontWeight.medium');\n font-size: 1rem;\n margin-top: 1px;\n user-select: none;\n }\n\n .nested-step--active::before {\n opacity: 1;\n }\n\n .line {\n flex-grow: 0;\n transition: flex-grow 500ms cubic-bezier(0.87, 0, 0.13, 1);\n }\n\n .step:last-child .line {\n display: none;\n }\n\n .line--expanded {\n flex-grow: 1;\n }\n\n .circle {\n width: theme('spacing.6');\n height: theme('spacing.6');\n line-height: theme('spacing.6');\n border-radius: theme('borderRadius.full');\n display: grid;\n place-items: center;\n font-weight: theme('fontWeight.medium');\n transition: background-color 500ms, color 500ms;\n }\n\n .circle--todo {\n background-color: rgb(255 255 255 / 50%);\n color: #4d4a69;\n border: 1px solid #747293;\n }\n\n .circle--active {\n background-color: theme('colors.blue.500');\n color: theme('colors.white');\n border: 1px solid transparent;\n }\n\n .circle--completed {\n background-color: theme('colors.white');\n border: 1px solid theme('colors.ice.500');\n color: theme('colors.green.500');\n cursor: pointer;\n }\n\n .circle--error {\n background-color: theme('colors.white');\n border: 1px solid theme('colors.ice.500');\n color: theme('colors.red.500');\n cursor: pointer;\n }\n\n .nested {\n padding: calc(theme('spacing.3') + theme('spacing[1.5]')) 0;\n }\n\n .nested li + li {\n margin-top: theme('spacing.3');\n }\n\n .nested .title {\n font-weight: theme('fontWeight.normal');\n font-size: 0.9rem;\n }\n</style>\n"],"names":["slots","useSlots","classes","useCssModule","injectedStepper","inject","STEPPER_INJECTION_KEY","isHorizontal","computed","isLightThemed","onBeforeMount","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;;iBAgDQA,IAAQC,KACRC,IAAUC,KAEVC,IAAkBC,EAAOC,CAAqB,GAE9CC,IAAeC,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,iBAAgB,YAAY,GAE3EK,IAAgBD,EAAS,OAAMJ,KAAA,gBAAAA,EAAiB,WAAU,OAAO;AAGvE,WAAAM,EAAc,MAAM;AAClB,MAAIN,KACcA,EAAA,aAAaO,EAAM,MAAM;AAAA,IAC3C,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Tab.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as x, inject as T, computed as n, onMounted as k, nextTick as y, toRefs as u, openBlock as c, createElementBlock as _, normalizeClass as g, unref as a, withKeys as C, createBlock as P, resolveDynamicComponent as B, mergeProps as E, withCtx as p, createElementVNode as $, createVNode as N, renderSlot as A } from "vue";
2
2
  import I from "./Badge.js";
3
- import { T as j } from "./Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js";
3
+ import { T as j } from "./Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js";
4
4
  import "./_plugin-vue_export-helper-dad06003.js";
5
5
  import "lodash-es/debounce";
6
6
  import "lodash-es/uniqueId";
package/dist/Table.js CHANGED
@@ -3,7 +3,7 @@ import "lodash-es/cloneDeep";
3
3
  import { M as v } from "./Module.keys-2cc7d830.js";
4
4
  import "lodash-es/uniqueId";
5
5
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
6
- import "./Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js";
6
+ import "./Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js";
7
7
  import { D as g } from "./DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js";
8
8
  import N from "./EmptyState.js";
9
9
  import D from "./Loading.js";
@@ -16,7 +16,7 @@ import "lodash-es/get";
16
16
  import "./EmptyState.vue_used_vue_type_style_index_0_lang.module-2f171ae7.js";
17
17
  import "./_plugin-vue_export-helper-dad06003.js";
18
18
  import "./Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js";
19
- import "./Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js";
19
+ import "./Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js";
20
20
  import "./Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js";
21
21
  import "./Checkbox.js";
22
22
  import "./ChevronToggle.vue_vue_type_script_setup_true_lang-1591294c.js";
package/dist/TableCell.js CHANGED
@@ -2,13 +2,13 @@ import { defineComponent as p, useCssModule as d, inject as u, openBlock as r, c
2
2
  import "lodash-es/cloneDeep";
3
3
  import "lodash-es/uniqueId";
4
4
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
5
- import "./Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js";
5
+ import "./Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js";
6
6
  import "./DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js";
7
7
  import "lodash-es/get";
8
8
  import "./EmptyState.vue_used_vue_type_style_index_0_lang.module-2f171ae7.js";
9
9
  import "./Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js";
10
10
  import { T as y, s as C } from "./Table.keys-1ebe4ecb.js";
11
- import "./Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js";
11
+ import "./Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js";
12
12
  import "./Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js";
13
13
  import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
14
14
  const T = {
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as k, useCssModule as T, inject as p, computed as m, openBlock as r, createElementBlock as _, normalizeClass as s, unref as t, createElementVNode as x, renderSlot as E, createBlock as w, createCommentVNode as l } from "vue";
2
2
  import "lodash-es/cloneDeep";
3
3
  import f from "./Icon.js";
4
- import "./Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js";
4
+ import "./Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js";
5
5
  import { D as b } from "./DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js";
6
6
  import "lodash-es/get";
7
7
  import "./EmptyState.vue_used_vue_type_style_index_0_lang.module-2f171ae7.js";
8
8
  import "./Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js";
9
9
  import { T as q } from "./Table.keys-1ebe4ecb.js";
10
10
  import "lodash-es/uniqueId";
11
- import "./Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js";
11
+ import "./Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js";
12
12
  import "./Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js";
13
13
  import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
14
14
  import "./index-79ce320f.js";
@@ -4,7 +4,7 @@ import C from "./Checkbox.js";
4
4
  import "lodash-es/cloneDeep";
5
5
  import "lodash-es/uniqueId";
6
6
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
7
- import "./Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js";
7
+ import "./Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js";
8
8
  import "./DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js";
9
9
  import "./EmptyState.vue_used_vue_type_style_index_0_lang.module-2f171ae7.js";
10
10
  import "./Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js";
@@ -13,7 +13,7 @@ import "./Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js";
13
13
  import m from "./TableHeaderCell.js";
14
14
  import { _ as S } from "./_plugin-vue_export-helper-dad06003.js";
15
15
  import "lodash-es/get";
16
- import "./Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js";
16
+ import "./Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js";
17
17
  import "./Icon.js";
18
18
  import "./index-79ce320f.js";
19
19
  const B = {
package/dist/TableRow.js CHANGED
@@ -6,7 +6,7 @@ import { _ as O } from "./ChevronToggle.vue_vue_type_script_setup_true_lang-1591
6
6
  import { _ as U } from "./Expand.vue_vue_type_script_setup_true_lang-5fe03d51.js";
7
7
  import "lodash-es/cloneDeep";
8
8
  import "./Icon.vue_used_vue_type_style_index_0_lang.module-eb359559.js";
9
- import "./Paginate.vue_used_vue_type_style_index_0_lang.module-e579235f.js";
9
+ import "./Paginate.vue_used_vue_type_style_index_0_lang.module-bfccf992.js";
10
10
  import "./DataView.vue_used_vue_type_style_index_0_lang.module-d878ca9a.js";
11
11
  import "./EmptyState.vue_used_vue_type_style_index_0_lang.module-2f171ae7.js";
12
12
  import "./Loading.vue_vue_type_style_index_0_scoped_bb8d5f15_lang-4ed993c7.js";
@@ -14,7 +14,7 @@ import T from "./TableCell.js";
14
14
  import { T as G, a as H } from "./Table.keys-1ebe4ecb.js";
15
15
  import { _ as K } from "./_plugin-vue_export-helper-dad06003.js";
16
16
  import "lodash-es/get";
17
- import "./Checkbox.vue_vue_type_style_index_0_scoped_0cd31c8f_lang-4ed993c7.js";
17
+ import "./Checkbox.vue_vue_type_style_index_0_scoped_0d7e7fd0_lang-4ed993c7.js";
18
18
  import "./Button.js";
19
19
  import "./Button.vue_used_vue_type_style_index_0_lang.module-b77978d6.js";
20
20
  import "./Icon.js";
package/dist/Tabs.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as o } from "./Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js";
2
- import { T as A, a as B } from "./Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js";
1
+ import { _ as o } from "./Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js";
2
+ import { T as A, a as B } from "./Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js";
3
3
  import "vue";
4
4
  import "lodash-es/debounce";
5
5
  import "lodash-es/uniqueId";
@@ -60,7 +60,7 @@ const oe = {
60
60
  e.className = "";
61
61
  const o = e.firstChild;
62
62
  if (o.className = "", e.setAttribute("aria-selected", "false"), e.addEventListener("click", () => {
63
- e.getAttribute("aria-selected") && e.classList.add("tw-bg-blue", "tw-text-white");
63
+ e.getAttribute("aria-selected") && e.classList.add("tw-bg-blue-500", "tw-text-white");
64
64
  }), r.value.has(e.getAttribute("id")))
65
65
  e.classList.remove("tw-hidden"), e.classList.add(
66
66
  "tw-rounded",
@@ -68,7 +68,7 @@ const oe = {
68
68
  "tw-text-sm",
69
69
  "tw-cursor-pointer",
70
70
  "tw-p-1.5",
71
- "hover:tw-bg-blue",
71
+ "hover:tw-bg-blue-500",
72
72
  "hover:tw-text-white"
73
73
  );
74
74
  else {
@@ -151,4 +151,4 @@ export {
151
151
  ve as _,
152
152
  N as a
153
153
  };
154
- //# sourceMappingURL=Tabs.vue_vue_type_script_setup_true_lang-aca4f8b8.js.map
154
+ //# sourceMappingURL=Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.vue_vue_type_script_setup_true_lang-56e85faa.js","sources":["../src/components/Tabs/keys.ts","../src/components/Tabs/models.ts","../src/components/Tabs/Tabs.vue"],"sourcesContent":["import { Injection } from '../../../types/utils';\nimport { TabsInjection } from './models';\n\nexport const TABS_INJECTION: Injection<TabsInjection> = Object.freeze({\n key: Symbol('TABS_INJECTION_KEY'),\n});\n","import { ComputedRef } from 'vue';\n\nexport enum TabVariant {\n Line = 'line',\n Enclosed = 'enclosed',\n}\n\nexport type TabVariants = `${TabVariant}`;\n\nexport interface TabsInjection {\n activeTab: ComputedRef<string>;\n variant: ComputedRef<TabVariants>;\n setActiveTab: (newTabValue: string) => void;\n}\n","<script lang=\"ts\">\n import { TabVariant, TabVariants } from './models';\n\n export * from './keys';\n export * from './models';\n\n export interface TabsProps {\n /**\n * The currently active tab value\n */\n activeTab: string;\n\n /**\n * Tabs variant\n */\n variant?: TabVariants;\n }\n</script>\n\n<script setup lang=\"ts\">\n import debounce from 'lodash-es/debounce';\n import uniqueId from 'lodash-es/uniqueId';\n import { computed, onBeforeUnmount, onDeactivated, onMounted, onUpdated, provide, Ref, ref } from 'vue';\n\n import { DEBOUNCE } from '../../constants';\n import { t } from '../../locale';\n import Dropdown from '../Dropdown/Dropdown.vue';\n import Icon from '../Icon/Icon.vue';\n import { TABS_INJECTION } from './keys';\n\n const emit =\n defineEmits<{\n (e: 'update:activeTab', newTabValue: TabsProps['activeTab']): void;\n }>();\n\n const props = withDefaults(defineProps<TabsProps>(), {\n variant: TabVariant.Line,\n });\n\n const tabListEl = ref();\n const moreDropdownMenuEl = ref();\n const observer: Ref<IntersectionObserver | undefined> = ref(undefined);\n const hasIntersectionObserver = 'IntersectionObserver' in window;\n const overflowIds = ref<Set<string>>(new Set());\n const moreDropdownWidth = ref(0);\n const moreDropdownEl = ref<InstanceType<typeof Dropdown>>();\n const moreMenuId = uniqueId('more-dropdown-menu-');\n const isMoreMenuOpen = ref(false);\n\n const currentActiveTab = computed({\n get() {\n return props.activeTab;\n },\n set(nv: TabsProps['activeTab']) {\n emit('update:activeTab', nv);\n },\n });\n\n function setActiveTab(newTabValue: TabsProps['activeTab']) {\n currentActiveTab.value = newTabValue;\n }\n\n provide(TABS_INJECTION.key, {\n activeTab: computed(() => currentActiveTab.value),\n variant: computed(() => props.variant),\n setActiveTab,\n });\n\n function initObserve() {\n if (!hasIntersectionObserver) {\n return;\n }\n\n if (!tabListEl.value) {\n return;\n }\n\n const tabs = Array.from(tabListEl.value?.children as HTMLLIElement[]);\n const options = {\n root: tabListEl.value,\n rootMargin: '0px',\n threshold: Array.from({ length: 100 }).map((v, i) => (i + 1) / 100),\n };\n\n observer.value = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n const dataId = entry.target.getAttribute('id') as string;\n /**\n * Check for partial intersection.\n * Zooming out can result in ratio of approx 0.984\n * Anything higher will result in nav items disappearing\n */\n if (entry.intersectionRatio > 0.94) {\n // show tab, hide in dropdown\n if (overflowIds.value.has(dataId)) {\n overflowIds.value.delete(dataId);\n }\n } else {\n // hide tab, show in dropdown\n if (dataId && !overflowIds.value.has(dataId)) {\n overflowIds.value.add(dataId);\n }\n }\n });\n }, options);\n\n tabs.forEach((element) => {\n observer.value?.observe(element);\n if (overflowIds.value.has(element.getAttribute('id') as string)) {\n element.classList.add('tw-invisible');\n } else {\n element.classList.remove('tw-invisible');\n }\n });\n\n moreDropdownWidth.value = moreDropdownEl.value?.$el?.getBoundingClientRect().width;\n\n if (!moreDropdownMenuEl.value) {\n return;\n }\n\n const dropdownList = Array.from(moreDropdownMenuEl.value.children as HTMLLIElement[]);\n dropdownList.forEach((element) => {\n element.className = '';\n const el = element.firstChild as Element;\n el.className = '';\n element.setAttribute('aria-selected', 'false');\n\n element.addEventListener('click', () => {\n if (element.getAttribute('aria-selected')) {\n element.classList.add('tw-bg-blue-500', 'tw-text-white');\n }\n });\n\n if (!overflowIds.value.has(element.getAttribute('id') as string)) {\n element.classList.add('tw-hidden');\n const el = element.firstChild as Element;\n el.className = '';\n } else {\n element.classList.remove('tw-hidden');\n element.classList.add(\n 'tw-rounded',\n 'dropdown-link',\n 'tw-text-sm',\n 'tw-cursor-pointer',\n 'tw-p-1.5',\n 'hover:tw-bg-blue-500',\n 'hover:tw-text-white',\n );\n }\n\n element.removeEventListener('click', () => {});\n });\n }\n\n const debouncedInitObserve = debounce(initObserve, DEBOUNCE.FAST, { leading: true });\n\n function destroyObserver() {\n if (observer.value) {\n observer.value.disconnect();\n observer.value = undefined;\n }\n }\n\n onMounted(() => {\n initObserve();\n });\n\n onUpdated(() => {\n destroyObserver();\n debouncedInitObserve();\n });\n\n onDeactivated(() => {\n destroyObserver();\n });\n\n onBeforeUnmount(() => {\n destroyObserver();\n });\n\n function onMoreClick(toggleMoreDropdown) {\n toggleMoreDropdown();\n isMoreMenuOpen.value = !isMoreMenuOpen.value;\n }\n</script>\n\n<template>\n <div class=\"root stash-tabs tw-relative\" role=\"tabList\" data-test=\"stash-tabs\">\n <ul\n ref=\"tabListEl\"\n :style=\"{\n width: `calc(100% - ${moreDropdownWidth}px)`,\n }\"\n class=\"stash-tabs-list tw-flex tw-items-end tw-overflow-hidden\"\n :class=\"{\n 'stash-tabs-list--line': variant === 'line',\n 'stash-tabs-list--enclosed': variant === 'enclosed',\n 'tw-gap-6': variant === 'line',\n }\"\n >\n <slot></slot>\n\n <Dropdown v-if=\"overflowIds.size\" ref=\"moreDropdownEl\" class=\"!tw-absolute tw-right-0 tw-top-0\">\n <template #toggle=\"{ toggle }\">\n <button\n aria-haspopup=\"menu\"\n :aria-controls=\"moreMenuId\"\n :aria-expanded=\"isMoreMenuOpen\"\n class=\"\n tw-font-medium\n tw-text-sm\n tw-border-solid\n tw-py-1.5\n tw-flex\n tw-items-center\n tw-justify-center\n tw-cursor-pointer\n tw-px-6\n tw-text-blue-500\n hover:tw-text-blue-700\n \"\n :class=\"{ 'tw-border-t-4 tw-border-transparent': props.variant === 'enclosed' }\"\n type=\"button\"\n @click=\"onMoreClick(toggle)\"\n >\n {{ t('ll.more') }}\n <Icon name=\"caret-down\" />\n </button>\n </template>\n <template #default>\n <ul\n :id=\"moreMenuId\"\n ref=\"moreDropdownMenuEl\"\n class=\"dropdown-list tw-px-1.5 tw-pb-1.5 tw-space-y-1.5\"\n role=\"menu\"\n >\n <slot></slot>\n </ul>\n </template>\n </Dropdown>\n </ul>\n </div>\n</template>\n"],"names":["TABS_INJECTION","TabVariant","tabListEl","ref","moreDropdownMenuEl","observer","hasIntersectionObserver","overflowIds","moreDropdownWidth","moreDropdownEl","moreMenuId","uniqueId","isMoreMenuOpen","currentActiveTab","computed","props","nv","emit","setActiveTab","newTabValue","provide","initObserve","tabs","_a","options","v","i","entries","entry","dataId","element","_c","_b","el","debouncedInitObserve","debounce","DEBOUNCE","destroyObserver","onMounted","onUpdated","onDeactivated","onBeforeUnmount","onMoreClick","toggleMoreDropdown"],"mappings":";;;;;;;AAGa,MAAAA,KAA2C,OAAO,OAAO;AAAA,EACpE,KAAK,OAAO,oBAAoB;AAClC,CAAC;ACHW,IAAAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,WAAW,YAFDA,IAAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;iBCqCJC,IAAYC,KACZC,IAAqBD,KACrBE,IAAkDF,EAAI,MAAS,GAC/DG,IAA0B,0BAA0B,QACpDC,IAAcJ,EAAqB,oBAAA,IAAK,CAAA,GACxCK,IAAoBL,EAAI,CAAC,GACzBM,IAAiBN,KACjBO,IAAaC,EAAS,qBAAqB,GAC3CC,IAAiBT,EAAI,EAAK,GAE1BU,IAAmBC,EAAS;AAAA,MAChC,MAAM;AACJ,eAAOC,EAAM;AAAA,MACf;AAAA,MACA,IAAIC,GAA4B;AAC9B,QAAAC,EAAK,oBAAoBD,CAAE;AAAA,MAC7B;AAAA,IAAA,CACD;AAED,aAASE,EAAaC,GAAqC;AACzD,MAAAN,EAAiB,QAAQM;AAAA,IAC3B;AAEA,IAAAC,EAAQpB,GAAe,KAAK;AAAA,MAC1B,WAAWc,EAAS,MAAMD,EAAiB,KAAK;AAAA,MAChD,SAASC,EAAS,MAAMC,EAAM,OAAO;AAAA,MACrC,cAAAG;AAAA,IAAA,CACD;AAED,aAASG,IAAc;;AAKjB,UAJA,CAACf,KAID,CAACJ,EAAU;AACb;AAGF,YAAMoB,IAAO,MAAM,MAAKC,IAAArB,EAAU,UAAV,gBAAAqB,EAAiB,QAA2B,GAC9DC,IAAU;AAAA,QACd,MAAMtB,EAAU;AAAA,QAChB,YAAY;AAAA,QACZ,WAAW,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,EAAE,IAAI,CAACuB,GAAGC,OAAOA,IAAI,KAAK,GAAG;AAAA,MAAA;AAoChE,UAjCJrB,EAAS,QAAQ,IAAI,qBAAqB,CAACsB,MAAY;AAC7C,QAAAA,EAAA,QAAQ,CAACC,MAAU;AACzB,gBAAMC,IAASD,EAAM,OAAO,aAAa,IAAI;AAMzC,UAAAA,EAAM,oBAAoB,OAExBrB,EAAY,MAAM,IAAIsB,CAAM,KAClBtB,EAAA,MAAM,OAAOsB,CAAM,IAI7BA,KAAU,CAACtB,EAAY,MAAM,IAAIsB,CAAM,KAC7BtB,EAAA,MAAM,IAAIsB,CAAM;AAAA,QAEhC,CACD;AAAA,SACAL,CAAO,GAELF,EAAA,QAAQ,CAACQ,MAAY;;AACf,SAAAP,IAAAlB,EAAA,UAAA,QAAAkB,EAAO,QAAQO,IACpBvB,EAAY,MAAM,IAAIuB,EAAQ,aAAa,IAAI,CAAW,IACpDA,EAAA,UAAU,IAAI,cAAc,IAE5BA,EAAA,UAAU,OAAO,cAAc;AAAA,MACzC,CACD,GAEDtB,EAAkB,SAAQuB,KAAAC,IAAAvB,EAAe,UAAf,gBAAAuB,EAAsB,QAAtB,gBAAAD,EAA2B,wBAAwB,OAEzE,CAAC3B,EAAmB;AACtB;AAIW,MADQ,MAAM,KAAKA,EAAmB,MAAM,QAA2B,EACvE,QAAQ,CAAC0B,MAAY;AAChC,QAAAA,EAAQ,YAAY;AACpB,cAAMG,IAAKH,EAAQ;AAUf,YATJG,EAAG,YAAY,IACPH,EAAA,aAAa,iBAAiB,OAAO,GAErCA,EAAA,iBAAiB,SAAS,MAAM;AAClC,UAAAA,EAAQ,aAAa,eAAe,KAC9BA,EAAA,UAAU,IAAI,kBAAkB,eAAe;AAAA,QACzD,CACD,GAEIvB,EAAY,MAAM,IAAIuB,EAAQ,aAAa,IAAI,CAAW;AAKrD,UAAAA,EAAA,UAAU,OAAO,WAAW,GACpCA,EAAQ,UAAU;AAAA,YAChB;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,aAb8D;AACxD,UAAAA,EAAA,UAAU,IAAI,WAAW;AACjC,gBAAMG,IAAKH,EAAQ;AACnBG,UAAAA,EAAG,YAAY;AAAA,QAAA;AAcT,QAAAH,EAAA,oBAAoB,SAAS,MAAM;AAAA,QAAA,CAAE;AAAA,MAAA,CAC9C;AAAA,IACH;AAEM,UAAAI,IAAuBC,EAASd,GAAae,EAAS,MAAM,EAAE,SAAS,IAAM;AAEnF,aAASC,IAAkB;AACzB,MAAIhC,EAAS,UACXA,EAAS,MAAM,cACfA,EAAS,QAAQ;AAAA,IAErB;AAEA,IAAAiC,EAAU,MAAM;AACF,MAAAjB;IAAA,CACb,GAEDkB,EAAU,MAAM;AACE,MAAAF,KACKH;IAAA,CACtB,GAEDM,EAAc,MAAM;AACF,MAAAH;IAAA,CACjB,GAEDI,EAAgB,MAAM;AACJ,MAAAJ;IAAA,CACjB;AAED,aAASK,EAAYC,GAAoB;AACpB,MAAAA,KACJ/B,EAAA,QAAQ,CAACA,EAAe;AAAA,IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/Textarea.js CHANGED
@@ -103,7 +103,7 @@ const L = ["id", "value"], N = /* @__PURE__ */ R({
103
103
  ]), 1040, ["id", "class"]));
104
104
  }
105
105
  });
106
- const X = /* @__PURE__ */ F(N, [["__scopeId", "data-v-41bcfee5"]]);
106
+ const X = /* @__PURE__ */ F(N, [["__scopeId", "data-v-cb24d278"]]);
107
107
  export {
108
108
  X as default
109
109
  };