@weni/unnnic-system 3.12.8-alpha-teleports.0 → 3.12.8-alpha.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.
Files changed (84) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/CHANGELOG.md +1114 -0
  3. package/README.md +1 -9
  4. package/dist/{es-2f6793d2.mjs → es-9d6892f7.mjs} +1 -1
  5. package/dist/{index-799af668.mjs → index-78117c0a.mjs} +9299 -8975
  6. package/dist/index.d.ts +870 -321
  7. package/dist/{pt-br-f5121b47.mjs → pt-br-89839646.mjs} +1 -1
  8. package/dist/style.css +1 -1
  9. package/dist/unnnic.mjs +156 -154
  10. package/dist/unnnic.umd.js +33 -33
  11. package/package.json +1 -1
  12. package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +1 -1
  13. package/src/components/ChartFunnel/DefaultFunnel/ChartDefaultFunnelBase.vue +1 -2
  14. package/src/components/ChartFunnel/SvgFunnel/ChartFunnelTwoRows.vue +60 -61
  15. package/src/components/Checkbox/Checkbox.vue +9 -3
  16. package/src/components/CheckboxGroup/CheckboxGroup.vue +7 -5
  17. package/src/components/Chip/Chip.vue +1 -1
  18. package/src/components/DatePicker/DatePicker.vue +1 -11
  19. package/src/components/Drawer/Drawer.vue +20 -9
  20. package/src/components/Drawer/__tests__/Drawer.spec.js +11 -9
  21. package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +9 -9
  22. package/src/components/EmojiPicker/EmojiPicker.vue +1 -1
  23. package/src/components/FormElement/FormElement.vue +97 -88
  24. package/src/components/Input/BaseInput.vue +25 -5
  25. package/src/components/Input/Input.scss +2 -1
  26. package/src/components/Input/Input.vue +26 -3
  27. package/src/components/Input/TextInput.vue +64 -25
  28. package/src/components/Input/__test__/TextInput.spec.js +1 -1
  29. package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +5 -1
  30. package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +7 -1
  31. package/src/components/InputDatePicker/InputDatePicker.vue +73 -68
  32. package/src/components/InputDatePicker/__test__/InputDatePicker.spec.js +24 -31
  33. package/src/components/ModalDialog/ModalDialog.vue +8 -1
  34. package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +1 -31
  35. package/src/components/MultiSelect/MultSelectOption.vue +49 -0
  36. package/src/components/MultiSelect/__tests__/MultiSelect.spec.js +557 -0
  37. package/src/components/MultiSelect/__tests__/MultiSelectOption.spec.js +229 -0
  38. package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelect.spec.js.snap +87 -0
  39. package/src/components/MultiSelect/__tests__/__snapshots__/MultiSelectOption.spec.js.snap +51 -0
  40. package/src/components/MultiSelect/index.vue +265 -0
  41. package/src/components/Radio/Radio.vue +13 -7
  42. package/src/components/Radio/__test__/Radio.spec.js +3 -1
  43. package/src/components/RadioGroup/RadioGroup.vue +18 -10
  44. package/src/components/Select/__tests__/Select.spec.js +422 -0
  45. package/src/components/Select/__tests__/SelectItem.spec.js +330 -0
  46. package/src/components/Select/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
  47. package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +71 -0
  48. package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +15 -0
  49. package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +25 -0
  50. package/src/components/Select/__tests__/__snapshots__/SelectPopover.spec.js.snap +8 -0
  51. package/src/components/Select/index.vue +308 -0
  52. package/src/components/Switch/Switch.vue +11 -4
  53. package/src/components/TemplatePreview/TemplatePreview.vue +30 -27
  54. package/src/components/TemplatePreview/TemplatePreviewModal.vue +11 -11
  55. package/src/components/TemplatePreview/types.d.ts +3 -3
  56. package/src/components/Toast/Toast.vue +13 -9
  57. package/src/components/Toast/ToastManager.ts +1 -4
  58. package/src/components/Toast/__tests__/ToastManager.spec.js +6 -10
  59. package/src/components/ToolTip/ToolTip.vue +1 -1
  60. package/src/components/index.ts +6 -6
  61. package/src/components/ui/dialog/DialogContent.vue +5 -5
  62. package/src/components/ui/drawer/DrawerContent.vue +2 -4
  63. package/src/components/ui/popover/PopoverContent.vue +2 -4
  64. package/src/components/ui/popover/PopoverOption.vue +4 -0
  65. package/src/components/ui/tooltip/TooltipContent.vue +2 -5
  66. package/src/components/ui/tooltip/TooltipTrigger.vue +4 -2
  67. package/src/index.ts +2 -9
  68. package/src/lib/layer-manager.ts +52 -24
  69. package/src/locales/en.json +3 -1
  70. package/src/locales/es.json +3 -1
  71. package/src/locales/pt_br.json +3 -1
  72. package/src/stories/Input.mdx +3 -0
  73. package/src/stories/LayerManager.docs.mdx +9 -9
  74. package/src/stories/LayerManager.stories.js +11 -54
  75. package/src/stories/ModalDialog.stories.js +0 -95
  76. package/src/stories/MultiSelect.stories.js +143 -45
  77. package/src/stories/Select.stories.js +161 -0
  78. package/src/stories/TemplatePreview.stories.js +27 -27
  79. package/src/stories/TemplatePreviewModal.stories.js +31 -31
  80. package/dist/apple-64.png +0 -0
  81. package/public/apple-64.png +0 -0
  82. package/src/components/MultiSelect/MultiSelect.vue +0 -297
  83. package/src/lib/__tests__/teleport-target.spec.ts +0 -73
  84. package/src/lib/teleport-target.ts +0 -46
@@ -34,10 +34,10 @@ import modal from './Modal/Modal.vue';
34
34
  import modalUpload from './ModalUpload/ModalUpload.vue';
35
35
  import { callAlert, callModal } from '../utils/call';
36
36
  import selectSmart from './SelectSmart/SelectSmart.vue';
37
- // import select from './Select/Select.vue';
37
+ import select from './Select/index.vue';
38
38
  import selectItem from './Select/SelectItem.vue';
39
39
  // import selectListItem from './SelectListItem/SelectListItem.vue';
40
- import multiSelect from './MultiSelect/MultiSelect.vue';
40
+ import multiSelect from './MultiSelect/index.vue';
41
41
  import alert from './Alert/Alert.vue';
42
42
  // import autocomplete from './Input/Autocomplete.vue';
43
43
  // import autocompleteSelect from './AutocompleteSelect/AutocompleteSelect.vue';
@@ -170,10 +170,10 @@ export const components: ComponentsMap = {
170
170
  unnnicModalDialog: ModalDialog,
171
171
  unnnicModalUpload: modalUpload,
172
172
  unnnicSelectSmart: selectSmart,
173
- // unnnicSelect: select,
173
+ unnnicSelect: select,
174
174
  unnnicSelectItem: selectItem,
175
175
  // unnnicSelectListItem: selectListItem,
176
- unnnicMultiSelect: multiSelect,
176
+ unnnicMultiSelect: multiSelect as VueComponent,
177
177
  unnnicAlert: alert,
178
178
  unnnicCallAlert: callAlert,
179
179
  unnnicCallModal: callModal,
@@ -299,7 +299,7 @@ export const unnnicModalDialog = ModalDialog;
299
299
  export const unnnicModalNext = ModalNext;
300
300
  export const unnnicModalUpload = modalUpload;
301
301
  export const unnnicSelectSmart = selectSmart as VueComponent;
302
- // export const unnnicSelect = select;
302
+ export const unnnicSelect = select as VueComponent;
303
303
  export const unnnicSelectItem = selectItem;
304
304
  // export const unnnicSelectListItem = selectListItem;
305
305
  export const unnnicMultiSelect = multiSelect as VueComponent;
@@ -427,7 +427,7 @@ export const UnnnicModalDialog = ModalDialog;
427
427
  export const UnnnicModalNext = ModalNext;
428
428
  export const UnnnicModalUpload = modalUpload;
429
429
  export const UnnnicSelectSmart = selectSmart as VueComponent;
430
- // export const UnnnicSelect = select;
430
+ export const UnnnicSelect = select as VueComponent;
431
431
  export const UnnnicSelectItem = selectItem;
432
432
  // export const UnnnicSelectListItem = selectListItem;
433
433
  export const UnnnicMultiSelect = multiSelect as VueComponent;
@@ -11,7 +11,6 @@ import {
11
11
  } from 'reka-ui';
12
12
  import { cn } from '@/lib/utils';
13
13
  import { useLayerZIndex } from '@/lib/layer-manager';
14
- import { useTeleportTarget } from '@/lib/teleport-target';
15
14
 
16
15
  defineOptions({
17
16
  name: 'UnnnicDialogContent',
@@ -37,9 +36,8 @@ const delegatedProps = reactiveOmit(props, 'class', 'parentClass');
37
36
 
38
37
  const forwarded = useForwardPropsEmits(delegatedProps, emits);
39
38
 
40
- const overlayZIndex = useLayerZIndex({ offset: -2 });
41
- const modalZIndex = useLayerZIndex();
42
- const portalTarget = useTeleportTarget();
39
+ const overlayZIndex = useLayerZIndex('modal', { offset: -2 });
40
+ const modalZIndex = useLayerZIndex('modal');
43
41
 
44
42
  const contentClasses = computed(() =>
45
43
  cn(
@@ -61,7 +59,7 @@ const ConditionalWrapper: Component = (_, { slots }) => {
61
59
  </script>
62
60
 
63
61
  <template>
64
- <DialogPortal :to="portalTarget">
62
+ <DialogPortal>
65
63
  <DialogOverlay
66
64
  class="unnnic-dialog-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
67
65
  :style="{ zIndex: overlayZIndex }"
@@ -97,6 +95,8 @@ const ConditionalWrapper: Component = (_, { slots }) => {
97
95
  top: 50%;
98
96
  left: 50%;
99
97
 
98
+ overflow: hidden;
99
+
100
100
  transform: translate(-50%, -50%);
101
101
 
102
102
  width: 100%;
@@ -6,7 +6,6 @@ import { useForwardPropsEmits } from 'reka-ui';
6
6
  import { DrawerContent, DrawerPortal } from 'vaul-vue';
7
7
  import { cn } from '@/lib/utils';
8
8
  import { useLayerZIndex } from '@/lib/layer-manager';
9
- import { useTeleportTarget } from '@/lib/teleport-target';
10
9
  import DrawerOverlay from './DrawerOverlay.vue';
11
10
 
12
11
  defineOptions({
@@ -32,12 +31,11 @@ const emits = defineEmits<DialogContentEmits>();
32
31
  const delegatedProps = reactiveOmit(props, 'class');
33
32
  const forwardedProps = useForwardPropsEmits(delegatedProps, emits);
34
33
 
35
- const layerZIndex = useLayerZIndex();
36
- const portalTarget = useTeleportTarget();
34
+ const layerZIndex = useLayerZIndex('drawer');
37
35
  </script>
38
36
 
39
37
  <template>
40
- <DrawerPortal :to="portalTarget">
38
+ <DrawerPortal>
41
39
  <DrawerOverlay
42
40
  v-if="showOverlay"
43
41
  :style="{ zIndex: layerZIndex - 2 }"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <PopoverPortal :to="portalTarget">
2
+ <PopoverPortal>
3
3
  <PopoverContent
4
4
  v-bind="{ ...forwarded, ...$attrs }"
5
5
  :style="{ width: contentWidth, zIndex: popoverZIndex }"
@@ -35,7 +35,6 @@ import { reactiveOmit } from '@vueuse/core';
35
35
  import { PopoverContent, PopoverPortal, useForwardPropsEmits } from 'reka-ui';
36
36
  import { cn } from '@/lib/utils';
37
37
  import { useLayerZIndex } from '@/lib/layer-manager';
38
- import { useTeleportTarget } from '@/lib/teleport-target';
39
38
 
40
39
  defineOptions({
41
40
  inheritAttrs: false,
@@ -65,8 +64,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
65
64
 
66
65
  const slots = useSlots() as Slots;
67
66
 
68
- const popoverZIndex = useLayerZIndex();
69
- const portalTarget = useTeleportTarget();
67
+ const popoverZIndex = useLayerZIndex('popover');
70
68
 
71
69
  const getComponentName = (vnode: VNode): string | undefined => {
72
70
  const componentType = vnode.type as { name?: string; __name?: string };
@@ -98,6 +98,10 @@ const schemeColor = computed(() => {
98
98
  }
99
99
 
100
100
  &__label {
101
+ overflow: hidden;
102
+ text-overflow: ellipsis;
103
+ white-space: nowrap;
104
+
101
105
  @each $name, $color in $unnnic-scheme-colors {
102
106
  &.unnnic-popover-option__label--#{$name} {
103
107
  color: $color;
@@ -10,7 +10,6 @@ import {
10
10
  } from 'reka-ui';
11
11
  import { cn } from '@/lib/utils';
12
12
  import { useLayerZIndex } from '@/lib/layer-manager';
13
- import { useTeleportTarget } from '@/lib/teleport-target';
14
13
 
15
14
  defineOptions({
16
15
  inheritAttrs: false,
@@ -20,7 +19,6 @@ const props = withDefaults(
20
19
  defineProps<TooltipContentProps & { class?: HTMLAttributes['class'] }>(),
21
20
  {
22
21
  sideOffset: 0,
23
- class: undefined,
24
22
  },
25
23
  );
26
24
 
@@ -29,12 +27,11 @@ const emits = defineEmits<TooltipContentEmits>();
29
27
  const delegatedProps = reactiveOmit(props, 'class');
30
28
 
31
29
  const forwarded = useForwardPropsEmits(delegatedProps, emits);
32
- const tooltipZIndex = useLayerZIndex();
33
- const portalTarget = useTeleportTarget();
30
+ const tooltipZIndex = useLayerZIndex('tooltip');
34
31
  </script>
35
32
 
36
33
  <template>
37
- <TooltipPortal :to="portalTarget">
34
+ <TooltipPortal>
38
35
  <TooltipContent
39
36
  v-bind="{ ...forwarded, ...$attrs }"
40
37
  :class="
@@ -17,8 +17,10 @@ const props = defineProps<TooltipTriggerProps>();
17
17
 
18
18
  <style lang="scss" scoped>
19
19
  .unnnic-tooltip-trigger {
20
- position: relative;
21
20
  display: inline-block;
22
- overflow-wrap: break-word;
21
+
22
+ & > * {
23
+ width: 100%;
24
+ }
23
25
  }
24
26
  </style>
package/src/index.ts CHANGED
@@ -1,21 +1,14 @@
1
1
  import type { App } from 'vue';
2
2
  import { components } from '@/components';
3
3
  import './assets/scss/tailwind.scss';
4
- import { setTeleportTarget, type TeleportTarget } from '@/lib/teleport-target';
5
4
 
6
5
  interface UnnnicPlugin {
7
- install(app: App, options?: UnnnicPluginOptions): void;
6
+ install(app: App): void;
8
7
  [key: string]: any;
9
8
  }
10
9
 
11
- export interface UnnnicPluginOptions {
12
- teleportTarget?: TeleportTarget | null;
13
- }
14
-
15
10
  const Unnnic: UnnnicPlugin = {
16
- install(app: App, options?: UnnnicPluginOptions) {
17
- setTeleportTarget(options?.teleportTarget ?? null);
18
-
11
+ install(app: App) {
19
12
  Object.keys(components).forEach((name) => {
20
13
  app.component(name, components[name] as any);
21
14
  });
@@ -1,37 +1,62 @@
1
1
  import { onBeforeUnmount, onMounted, ref, type Ref } from 'vue';
2
2
 
3
- const BASE_LAYER_Z_INDEX = 1000;
3
+ export const layerScale = {
4
+ hide: -1,
5
+ base: 0,
6
+ drawer: 1000,
7
+ modal: 1100,
8
+ popover: 1200,
9
+ tooltip: 1300,
10
+ toast: 1400,
11
+ } as const;
12
+
13
+ export type LayerToken = keyof typeof layerScale;
14
+
4
15
  const DEFAULT_STEP = 5;
5
16
 
6
- const layerStack: number[] = [];
7
- const layerHandles = new Map<symbol, number>();
17
+ const activeValues: Record<LayerToken, number[]> = {
18
+ hide: [],
19
+ base: [],
20
+ drawer: [],
21
+ modal: [],
22
+ popover: [],
23
+ tooltip: [],
24
+ toast: [],
25
+ };
8
26
 
9
- interface LayerHandle {
27
+ interface Allocation {
10
28
  id: symbol;
29
+ type: LayerToken;
11
30
  value: number;
12
31
  }
13
32
 
14
- function pushLayer(): LayerHandle {
33
+ const allocations = new Map<symbol, Allocation>();
34
+
35
+ function acquire(type: LayerToken): Allocation {
15
36
  const id = Symbol('layer');
16
- const lastValue = layerStack.length
17
- ? layerStack[layerStack.length - 1]
18
- : BASE_LAYER_Z_INDEX;
37
+ const list = activeValues[type];
38
+ const lastValue = list.length ? list[list.length - 1] : layerScale[type];
19
39
  const value = lastValue + DEFAULT_STEP;
20
- layerStack.push(value);
21
- layerHandles.set(id, value);
22
- return { id, value };
40
+ const allocation: Allocation = { id, type, value };
41
+
42
+ list.push(value);
43
+ allocations.set(id, allocation);
44
+
45
+ return allocation;
23
46
  }
24
47
 
25
- function popLayer(id: symbol) {
26
- const value = layerHandles.get(id);
27
- if (value === undefined) {
48
+ function release(id: symbol) {
49
+ const allocation = allocations.get(id);
50
+ if (!allocation) {
28
51
  return;
29
52
  }
30
53
 
31
- layerHandles.delete(id);
32
- const index = layerStack.indexOf(value);
54
+ allocations.delete(id);
55
+ const list = activeValues[allocation.type];
56
+ const index = list.indexOf(allocation.value);
57
+
33
58
  if (index !== -1) {
34
- layerStack.splice(index, 1);
59
+ list.splice(index, 1);
35
60
  }
36
61
  }
37
62
 
@@ -39,23 +64,26 @@ export interface LayerZIndexOptions {
39
64
  offset?: number;
40
65
  }
41
66
 
42
- export function useLayerZIndex(options?: LayerZIndexOptions): Ref<number> {
43
- const offset = options?.offset ?? 0;
44
- const zIndex = ref(BASE_LAYER_Z_INDEX + offset);
67
+ export function useLayerZIndex(
68
+ type: LayerToken = 'base',
69
+ options?: LayerZIndexOptions,
70
+ ): Ref<number> {
71
+ const initialValue = layerScale[type] + (options?.offset ?? 0);
72
+ const zIndex = ref(initialValue);
45
73
 
46
74
  let allocationId: symbol | null = null;
47
75
 
48
76
  const allocate = () => {
49
- const handle = pushLayer();
50
- allocationId = handle.id;
51
- zIndex.value = handle.value + offset;
77
+ const allocation = acquire(type);
78
+ allocationId = allocation.id;
79
+ zIndex.value = allocation.value + (options?.offset ?? 0);
52
80
  };
53
81
 
54
82
  onMounted(allocate);
55
83
 
56
84
  onBeforeUnmount(() => {
57
85
  if (allocationId) {
58
- popLayer(allocationId);
86
+ release(allocationId);
59
87
  allocationId = null;
60
88
  }
61
89
  });
@@ -44,5 +44,7 @@
44
44
  "flags": "Flags",
45
45
  "custom": "Custom"
46
46
  }
47
- }
47
+ },
48
+ "search": "Search",
49
+ "without_results": "No results found"
48
50
  }
@@ -44,5 +44,7 @@
44
44
  "flags": "Banderas",
45
45
  "custom": "Personalizados"
46
46
  }
47
- }
47
+ },
48
+ "search": "Buscar",
49
+ "without_results": "No se encontró ningún resultado"
48
50
  }
@@ -44,5 +44,7 @@
44
44
  "flags": "Bandeiras",
45
45
  "custom": "Personalizados"
46
46
  }
47
- }
47
+ },
48
+ "search": "Buscar",
49
+ "without_results": "Nenhum resultado encontrado"
48
50
  }
@@ -42,6 +42,9 @@ The `Input` component is designed to provide an input field for users to enter t
42
42
  | placeholder | `String` of the native input placeholder | `String` | `''` |
43
43
  | iconLeft | `String` of the left icon | `String` | `undefined` |
44
44
  | iconRight | `String` of the right icon | `String` | `false` |
45
+ | useFocusProp | `Boolean` to enable use focus by prop (ignore native css) | `true` \| `false` | `false` |
46
+ | focus | `Boolean` to enable focus component status | `true` \| `false` | `false` |
47
+
45
48
 
46
49
  ## Example
47
50
  Some examples of uses of the `UnnnicInput`
@@ -4,7 +4,7 @@ import { Meta } from '@storybook/blocks';
4
4
 
5
5
  # Layer Manager Overview
6
6
 
7
- The layer manager exists to keep every teleported component (dialogs, drawers, popovers, tooltips, toasts, etc.) in a predictable stacking order without sprinkling arbitrary `z-index: 9999` rules across the codebase. Instead of assigning fixed bands per component type, we keep a single global stack that increments as layers mount. [Reference](https://v1.chakra-ui.com/docs/components/recipes/z-index)
7
+ The layer manager exists to keep every teleported component (dialogs, drawers, popovers, tooltips, toasts, etc.) in a predictable stacking order without sprinkling arbitrary `z-index: 9999` rules across the codebase. Defining semantic bands (drawer, modal, popover, tooltip, toast) and allocating values automatically whenever a component mounts. [Reference](https://v1.chakra-ui.com/docs/components/recipes/z-index)
8
8
 
9
9
  ## Why avoid manual z-index values?
10
10
 
@@ -14,25 +14,25 @@ The layer manager exists to keep every teleported component (dialogs, drawers, p
14
14
 
15
15
  ## How it works here
16
16
 
17
- 1. **Single base (1000)** – all teleported layers share the same starting point, which keeps the implementation simple and predictable.
18
- 2. **Auto-increment** – every time a component mounts, it receives the next value in the global stack so the newest element always sits on top, regardless of type.
19
- 3. **Scoped offsets** – overlays that belong to the same surface (e.g., `DialogOverlay` vs. `DialogContent`) call `useLayerZIndex({ offset: -2 })` so the overlay sits just beneath the content that spawned it.
17
+ 1. **Tokens, not numbers** – components request a token such as `modal`, `popover`, or `tooltip`. The manager maps those tokens to a base band (e.g., modals start at 1200, popovers at 1400).
18
+ 2. **Auto-increment** – every time a component mounts, it receives the next value in its band so nested dialogs or infinite toasts still stack correctly.
19
+ 3. **Scoped offsets** – overlays that belong to the same surface (e.g., `DialogOverlay` vs `DialogContent`) simply call `useLayerZIndex` with a small negative offset so the overlay sits just beneath the content that opened it.
20
20
 
21
21
  ```
22
- const modalZ = useLayerZIndex();
23
- const overlayZ = useLayerZIndex({ offset: -2 });
22
+ const modalZ = useLayerZIndex('modal');
23
+ const overlayZ = useLayerZIndex('modal', { offset: -2 });
24
24
  ```
25
25
 
26
26
  ## Benefits
27
27
 
28
- - **Deterministic ordering** – the last overlay opened is always on top, no matter if it is a drawer, modal, popover, or toast.
29
- - **Safer refactors** – no need to chase down hard-coded z-index constants across the codebase; everything flows through the same stack.
28
+ - **Deterministic ordering** – open a drawer, then a popover, then a dialog, then a tooltip and the visual order will always follow the semantic bands.
29
+ - **Safer refactors** – tokens can be remapped (e.g., raise the entire `tooltip` band) without touching every component.
30
30
 
31
31
  ## When to override
32
32
 
33
33
  In rare cases you might still need a custom `z-index`. Prefer to:
34
34
 
35
- 1. Add a dedicated offset (e.g., `useLayerZIndex({ offset: X })`) if the overlay needs to sit just above/below a sibling.
35
+ 1. Add a new token in the layer manager if the surface fits the existing pattern (e.g., `tour`).
36
36
  2. Only apply inline overrides for truly one-off cases, and document why the global manager does not work there.
37
37
 
38
38
 
@@ -48,7 +48,7 @@ export default {
48
48
  };
49
49
 
50
50
  export const DialogWithTooltipAndPopover = {
51
- name: 'Dialog > Tooltip + Popover',
51
+ name: 'Dialog + Tooltip + Popover',
52
52
  render: () => ({
53
53
  components: {
54
54
  Dialog,
@@ -110,7 +110,7 @@ export const DialogWithTooltipAndPopover = {
110
110
  };
111
111
 
112
112
  export const DrawerWithTooltipAndPopover = {
113
- name: 'Drawer > Tooltip + Popover',
113
+ name: 'Drawer + Tooltip + Popover',
114
114
  render: () => ({
115
115
  components: {
116
116
  Drawer,
@@ -174,7 +174,7 @@ export const DrawerWithTooltipAndPopover = {
174
174
  };
175
175
 
176
176
  export const DrawerNextToDialog = {
177
- name: 'Drawer > Dialog',
177
+ name: 'Drawer + Dialog',
178
178
  render: () => ({
179
179
  components: {
180
180
  Drawer,
@@ -188,6 +188,8 @@ export const DrawerNextToDialog = {
188
188
  DialogContent,
189
189
  DialogHeader,
190
190
  DialogTitle,
191
+ DialogFooter,
192
+ DialogClose,
191
193
  UnnnicButton,
192
194
  },
193
195
  setup() {
@@ -222,6 +224,11 @@ export const DrawerNextToDialog = {
222
224
  <div style="padding: 24px; color: #67738B;">
223
225
  This dialog must appear above the drawer and its overlay.
224
226
  </div>
227
+ <DialogFooter>
228
+ <DialogClose>
229
+ <UnnnicButton text="Close dialog" type="tertiary" />
230
+ </DialogClose>
231
+ </DialogFooter>
225
232
  </DialogContent>
226
233
  </Dialog>
227
234
  </div>
@@ -229,56 +236,6 @@ export const DrawerNextToDialog = {
229
236
  }),
230
237
  };
231
238
 
232
- export const DrawerOpenedFromDialog = {
233
- name: 'Dialog > Drawer',
234
- render: () => ({
235
- components: {
236
- UnnnicButton,
237
- Dialog,
238
- DialogContent,
239
- DialogHeader,
240
- DialogTitle,
241
- Drawer,
242
- DrawerContent,
243
- DrawerHeader,
244
- DrawerTitle,
245
- DrawerDescription,
246
- },
247
- setup() {
248
- const dialogOpen = ref(false);
249
- const drawerOpen = ref(false);
250
- return { dialogOpen, drawerOpen };
251
- },
252
- template: `
253
- <div>
254
- <div style="display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;">
255
- <UnnnicButton text="Open dialog" type="primary" @click="dialogOpen = true" />
256
- </div>
257
- <Dialog v-model:open="dialogOpen">
258
- <DialogContent>
259
- <DialogHeader>
260
- <DialogTitle>Dialog</DialogTitle>
261
- </DialogHeader>
262
- <div style="padding: 24px; color: #67738B;">
263
- <UnnnicButton text="Open drawer" type="primary" @click="drawerOpen = true" />
264
- </div>
265
- </DialogContent>
266
- </Dialog>
267
- <Drawer v-model:open="drawerOpen">
268
- <DrawerContent>
269
- <DrawerHeader>
270
- <DrawerTitle>Drawer</DrawerTitle>
271
- </DrawerHeader>
272
- <div style="padding: 24px; color: #67738B;">
273
- Drawer should appear above the dialog.
274
- </div>
275
- </DrawerContent>
276
- </Drawer>
277
- </div>
278
- `,
279
- }),
280
- };
281
-
282
239
  export const NestedDialogs = {
283
240
  name: 'Dialog nested',
284
241
  render: () => ({
@@ -346,7 +303,7 @@ export const NestedDialogs = {
346
303
  };
347
304
 
348
305
  export const DialogWithToast = {
349
- name: 'Dialog > Toast',
306
+ name: 'Dialog + Toast',
350
307
  render: () => ({
351
308
  components: {
352
309
  Dialog,
@@ -1,9 +1,6 @@
1
1
  import UnnnicModalDialog from '../components/ModalDialog/ModalDialog.vue';
2
2
  import UnnnicInput from '../components/Input/Input.vue';
3
3
  import UnnnicLabel from '../components/Label/Label.vue';
4
- import UnnnicInputDatePicker from '../components/InputDatePicker/InputDatePicker.vue';
5
- import UnnnicSwitch from '../components/Switch/Switch.vue';
6
- import UnnnicButton from '../components/Button/Button.vue';
7
4
 
8
5
  import { action } from '@storybook/addon-actions';
9
6
  import iconsList from '../utils/iconList';
@@ -185,85 +182,6 @@ const TemplateLeftSidebar = (args) => ({
185
182
  },
186
183
  });
187
184
 
188
- const TemplateWithDatePicker = (args) => ({
189
- components: {
190
- UnnnicModalDialog,
191
- UnnnicInputDatePicker,
192
- UnnnicSwitch,
193
- UnnnicButton,
194
- },
195
- setup() {
196
- const updateModelValue = (value) => {
197
- action('update:modelValue')(value);
198
- args.modelValue = value;
199
- };
200
- return { args, updateModelValue };
201
- },
202
- data() {
203
- return {
204
- forms: [{ date: { start: null, end: null }, repeat: false }],
205
- isLoading: false,
206
- };
207
- },
208
- template: `
209
- <div>
210
- <button @click="updateModelValue(true)">Open Modal with DatePicker</button>
211
- <unnnic-modal-dialog
212
- v-bind="args"
213
- @primaryButtonClick="handleSave"
214
- @secondaryButtonClick="secondaryButtonClick"
215
- @update:modelValue="updateModelValue"
216
- >
217
- <section style="display: flex; flex-direction: column; gap: 16px;">
218
- <section
219
- v-for="(form, index) in forms"
220
- :key="index"
221
- style="display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid #E2E6ED; border-radius: 8px;"
222
- >
223
- <section style="display: flex; flex-direction: column; gap: 8px;">
224
- <p style="font-family: 'Lato'; font-size: 14px; font-weight: 600; margin: 0; color: #3B414D;">
225
- Select date or period
226
- </p>
227
- <UnnnicInputDatePicker
228
- v-model="form.date"
229
- :options="[{ id: 'custom', name: 'Custom' }]"
230
- next
231
- fillW
232
- actionText="Confirm"
233
- disableClear
234
- />
235
- </section>
236
- <UnnnicSwitch
237
- v-model="form.repeat"
238
- textRight="Repeat annually"
239
- size="small"
240
- />
241
- </section>
242
- <UnnnicButton
243
- iconCenter="add-1"
244
- type="tertiary"
245
- text="Add"
246
- @click="addForm"
247
- />
248
- </section>
249
- </unnnic-modal-dialog>
250
- </div>
251
- `,
252
- methods: {
253
- primaryButtonClick: action('primaryButtonClick'),
254
- secondaryButtonClick: action('secondaryButtonClick'),
255
- handleSave() {
256
- action('primaryButtonClick')();
257
- action('save')(this.forms);
258
- console.log('Forms data:', this.forms);
259
- },
260
- addForm() {
261
- this.forms.push({ date: { start: null, end: null }, repeat: false });
262
- action('addForm')();
263
- },
264
- },
265
- });
266
-
267
185
  export const Default = Template.bind({});
268
186
  Default.args = {
269
187
  title: 'Default Modal',
@@ -343,16 +261,3 @@ Image.args = {
343
261
  },
344
262
  showActionsDivider: true,
345
263
  };
346
-
347
- export const WithDatePicker = TemplateWithDatePicker.bind({});
348
- WithDatePicker.args = {
349
- title: 'Add Non-Working Dates',
350
- type: '',
351
- primaryButtonProps: {
352
- text: 'Save',
353
- loading: false,
354
- },
355
- secondaryButtonProps: {
356
- text: 'Cancel',
357
- },
358
- };