@onereach/ui-components 4.7.5 → 4.7.6

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 (46) hide show
  1. package/dist/bundled/v2/components/OrExpansionPanelV3/OrExpansionPanel.js +33 -25
  2. package/dist/bundled/v2/components/OrExpansionPanelV3/OrExpansionPanel.vue.d.ts +15 -28
  3. package/dist/bundled/v2/components/OrExpansionPanelV3/index.js +1 -3
  4. package/dist/bundled/v2/components/OrExpansionPanelV3/props.d.ts +0 -5
  5. package/dist/bundled/v2/components/OrExpansionPanelV3/props.js +1 -7
  6. package/dist/bundled/v2/components/OrExpansionPanelV3/styles.d.ts +3 -4
  7. package/dist/bundled/v2/components/OrExpansionPanelV3/styles.js +5 -17
  8. package/dist/bundled/v2/components/OrSelectV3/OrSelect.js +1 -1
  9. package/dist/bundled/v2/components/OrSelectV3/index.js +1 -1
  10. package/dist/bundled/v2/components/index.js +1 -1
  11. package/dist/bundled/v2/index.js +2 -2
  12. package/dist/bundled/v3/{OrExpansionPanel.vue_vue_type_script_lang-ca9d5307.js → OrExpansionPanel.vue_vue_type_script_lang-d4ed6199.js} +29 -20
  13. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-85fcf3fa.js → OrSelect.vue_vue_type_script_lang-ba73f458.js} +1 -1
  14. package/dist/bundled/v3/components/OrExpansionPanelV3/OrExpansionPanel.js +5 -7
  15. package/dist/bundled/v3/components/OrExpansionPanelV3/OrExpansionPanel.vue.d.ts +11 -22
  16. package/dist/bundled/v3/components/OrExpansionPanelV3/index.js +2 -4
  17. package/dist/bundled/v3/components/OrExpansionPanelV3/props.d.ts +0 -5
  18. package/dist/bundled/v3/components/OrExpansionPanelV3/props.js +1 -7
  19. package/dist/bundled/v3/components/OrExpansionPanelV3/styles.d.ts +3 -4
  20. package/dist/bundled/v3/components/OrExpansionPanelV3/styles.js +5 -17
  21. package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +4 -4
  22. package/dist/bundled/v3/components/OrSelectV3/index.js +3 -3
  23. package/dist/bundled/v3/components/index.js +3 -3
  24. package/dist/bundled/v3/index.js +4 -4
  25. package/dist/esm/v2/{OrExpansionPanel-b8411db6.js → OrExpansionPanel-d3a2218d.js} +36 -48
  26. package/dist/esm/v2/{OrSelect-7f2d3a94.js → OrSelect-1132c7dc.js} +1 -1
  27. package/dist/esm/v2/components/index.js +2 -2
  28. package/dist/esm/v2/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +15 -28
  29. package/dist/esm/v2/components/or-expansion-panel-v3/index.js +1 -5
  30. package/dist/esm/v2/components/or-expansion-panel-v3/props.d.ts +0 -5
  31. package/dist/esm/v2/components/or-expansion-panel-v3/styles.d.ts +3 -4
  32. package/dist/esm/v2/components/or-select-v3/index.js +3 -3
  33. package/dist/esm/v2/index.js +2 -2
  34. package/dist/esm/v3/{OrExpansionPanel-df527763.js → OrExpansionPanel-c016d8fa.js} +35 -47
  35. package/dist/esm/v3/{OrSelect-c931ed6e.js → OrSelect-9432ac4d.js} +1 -1
  36. package/dist/esm/v3/components/index.js +2 -2
  37. package/dist/esm/v3/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +11 -22
  38. package/dist/esm/v3/components/or-expansion-panel-v3/index.js +1 -5
  39. package/dist/esm/v3/components/or-expansion-panel-v3/props.d.ts +0 -5
  40. package/dist/esm/v3/components/or-expansion-panel-v3/styles.d.ts +3 -4
  41. package/dist/esm/v3/components/or-select-v3/index.js +3 -3
  42. package/dist/esm/v3/index.js +2 -2
  43. package/package.json +2 -2
  44. package/src/components/or-expansion-panel-v3/OrExpansionPanel.vue +35 -28
  45. package/src/components/or-expansion-panel-v3/props.ts +0 -6
  46. package/src/components/or-expansion-panel-v3/styles.ts +3 -25
@@ -1,4 +1,4 @@
1
- export { s as OrSelectV3 } from '../../OrSelect-c931ed6e.js';
1
+ export { s as OrSelectV3 } from '../../OrSelect-9432ac4d.js';
2
2
  export { I as SelectSize } from '../../OrInputBox-32814878.js';
3
3
  import 'vue-demi';
4
4
  import '../../dropdown-open-e1f90e0a.js';
@@ -12,8 +12,7 @@ import '../../OrLabel-4da56db0.js';
12
12
  import 'vue';
13
13
  import '../../style-inject.es-4c6f2515.js';
14
14
  import '../../OrError-c01d0c29.js';
15
- import '../../OrExpansionPanel-df527763.js';
16
- import '../../usePopoverState-8a95a300.js';
15
+ import '../../OrExpansionPanel-c016d8fa.js';
17
16
  import '../../OrIcon-62793572.js';
18
17
  import '../../OrHint-06ab89d7.js';
19
18
  import '../../OrInput-a303f924.js';
@@ -21,6 +20,7 @@ import '../../useResponsive-a02e95b7.js';
21
20
  import '../../useValidationAttributes-d1abbe34.js';
22
21
  import '../../OrIconButton-0aaadc68.js';
23
22
  import '../../OrTooltip-3025564a.js';
23
+ import '../../usePopoverState-8a95a300.js';
24
24
  import '../../OrPopover-337df396.js';
25
25
  import '@floating-ui/dom';
26
26
  import '../../useElevation-a50ec347.js';
@@ -31,7 +31,7 @@ export { E as EmptyStateSize, s as OrEmptyStateV3 } from './OrEmptyState-5349a1f
31
31
  export { s as OrError } from './OrError-f90296db.js';
32
32
  export { s as OrErrorTagV3 } from './OrErrorTag-ade9192b.js';
33
33
  export { s as OrErrorV3 } from './OrError-c01d0c29.js';
34
- export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, s as OrExpansionPanelV3 } from './OrExpansionPanel-df527763.js';
34
+ export { a as ExpansionPanelColor, E as ExpansionPanelVariant, s as OrExpansionPanelV3 } from './OrExpansionPanel-c016d8fa.js';
35
35
  export { F as FabColor, s as OrFabV3 } from './OrFab-83cd7ed7.js';
36
36
  export { s as OrFloating, a as OrFloatingHideStrategy, O as OrFloatingPlacements } from './OrFloating-1a9ccfe9.js';
37
37
  export { F as FormGroupDirection, s as OrFormGroupV3 } from './OrFormGroup-9f581536.js';
@@ -76,7 +76,7 @@ export { s as OrSearch } from './OrSearch-d0c8aca7.js';
76
76
  export { s as OrSearchV3 } from './OrSearch-c5ecb005.js';
77
77
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-359fbf3a.js';
78
78
  export { s as OrSelect } from './OrSelect-60205145.js';
79
- export { s as OrSelectV3 } from './OrSelect-c931ed6e.js';
79
+ export { s as OrSelectV3 } from './OrSelect-9432ac4d.js';
80
80
  export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-aaf73310.js';
81
81
  export { s as OrSidebarV3 } from './OrSidebar-7f5795da.js';
82
82
  export { O as OrSidebarPlacement } from './OrSidebarCollapseButton-5fb7a6a1.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "4.7.5",
3
+ "version": "4.7.6",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -155,5 +155,5 @@
155
155
  },
156
156
  "./package.json": "./package.json"
157
157
  },
158
- "gitHead": "7f847df360021cf81d62c83583de7acea0964a1b"
158
+ "gitHead": "29bb1b07850eb0d9511876bb4a40d9ca8c434bb6"
159
159
  }
@@ -9,14 +9,13 @@
9
9
  :class="headerStyles"
10
10
  :tabindex="!disabled ? 0 : null"
11
11
  :disabled="disabled ? '' : null"
12
- @click.stop="toggle()"
12
+ @click.stop="expanded ? close(): open()"
13
13
  >
14
14
  <OrIcon
15
- :class="[state === 'open' ? 'rotate-0' : 'rotate-[-90deg]']"
15
+ :class="[expanded ? 'rotate-0' : 'rotate-[-90deg]']"
16
16
  :icon="'expand_more'"
17
17
  :variant="'filled-bold'"
18
18
  />
19
-
20
19
  <span class="truncate">
21
20
  {{ label }}
22
21
  </span>
@@ -27,18 +26,17 @@
27
26
  </div>
28
27
  </div>
29
28
 
30
- <div v-show="state === 'open'">
29
+ <div v-show="expanded">
31
30
  <slot />
32
31
  </div>
33
32
  </div>
34
33
  </template>
35
34
 
36
35
  <script lang="ts">
37
- import { computed, defineComponent, PropType, ref, toRef } from 'vue-demi';
38
- import { usePopoverState } from '../../hooks';
36
+ import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
39
37
  import { OrIconV3 as OrIcon } from '../or-icon-v3';
40
- import { ExpansionPanelBackgroundColor, ExpansionPanelColor, ExpansionPanelVariant } from './props';
41
- import { ExpansionPanel, ExpansionPanelAddon, ExpansionPanelBackgroundColors, ExpansionPanelHeader, ExpansionPanelHeaderColors, ExpansionPanelVariants } from './styles';
38
+ import { ExpansionPanelColor, ExpansionPanelVariant } from './props';
39
+ import { ExpansionPanelAddon, ExpansionPanelHeader, ExpansionPanelHeaderColors, ExpansionPanelRoot, ExpansionPanelRootVariants } from './styles';
42
40
 
43
41
  export default defineComponent({
44
42
  name: 'OrExpansionPanel',
@@ -54,25 +52,20 @@ export default defineComponent({
54
52
  },
55
53
 
56
54
  isOpen: {
57
- type: Boolean,
55
+ type: Boolean as PropType<boolean>,
58
56
  default: false,
59
57
  },
60
58
 
61
59
  variant: {
62
- type: String as PropType<`${ExpansionPanelVariant}`>,
60
+ type: String as PropType<ExpansionPanelVariant>,
63
61
  default: ExpansionPanelVariant.Default,
64
62
  },
65
63
 
66
64
  color: {
67
- type: String as PropType<`${ExpansionPanelColor}`>,
65
+ type: String as PropType<ExpansionPanelColor>,
68
66
  default: ExpansionPanelColor.Default,
69
67
  },
70
68
 
71
- backgroundColor: {
72
- type: String as PropType<`${ExpansionPanelBackgroundColor}`>,
73
- default: ExpansionPanelBackgroundColor.Primary,
74
- },
75
-
76
69
  disabled: {
77
70
  type: Boolean,
78
71
  default: false,
@@ -80,20 +73,14 @@ export default defineComponent({
80
73
  },
81
74
 
82
75
  emits: [
83
- 'update:state',
84
-
85
76
  'open',
86
77
  'close',
87
78
  ],
88
79
 
89
80
  expose: [
90
81
  'root',
91
-
92
- 'state',
93
-
94
82
  'open',
95
83
  'close',
96
- 'toggle',
97
84
  ],
98
85
 
99
86
  setup(props, context) {
@@ -103,9 +90,8 @@ export default defineComponent({
103
90
  // Styles
104
91
  const rootStyles = computed(() => [
105
92
  'or-expansion-panel-v3',
106
- ...ExpansionPanel,
107
- ...ExpansionPanelVariants[props.variant],
108
- ...ExpansionPanelBackgroundColors[`${props.backgroundColor}-${props.variant}`],
93
+ ...ExpansionPanelRoot,
94
+ ...ExpansionPanelRootVariants[props.variant],
109
95
  ]);
110
96
 
111
97
  const headerStyles = computed(() => [
@@ -118,17 +104,38 @@ export default defineComponent({
118
104
  ]);
119
105
 
120
106
  // State
121
- const { state, open, close, toggle } = usePopoverState(toRef(props, 'isOpen'), context);
107
+ const expanded = ref(false);
108
+
109
+ // Events
110
+ watch(expanded, (value) => {
111
+ context.emit(value ? 'open' : 'close');
112
+ });
113
+
114
+ watch(() => props.isOpen, (newIsOpen) => {
115
+ if (newIsOpen) {
116
+ open();
117
+ } else {
118
+ close();
119
+ }
120
+ }, { immediate: true });
121
+
122
+ // Methods
123
+ function open(): void {
124
+ expanded.value = true;
125
+ }
126
+
127
+ function close(): void {
128
+ expanded.value = false;
129
+ }
122
130
 
123
131
  return {
124
132
  root,
125
133
  rootStyles,
126
134
  headerStyles,
127
135
  addonStyles,
128
- state,
136
+ expanded,
129
137
  open,
130
138
  close,
131
- toggle,
132
139
  };
133
140
  },
134
141
  });
@@ -7,9 +7,3 @@ export enum ExpansionPanelColor {
7
7
  Default = 'default',
8
8
  Danger = 'danger',
9
9
  }
10
-
11
- export enum ExpansionPanelBackgroundColor {
12
- Primary = 'primary',
13
- Secondary = 'secondary',
14
- Inherit = 'inherit',
15
- }
@@ -1,11 +1,11 @@
1
- import { ExpansionPanelBackgroundColor, ExpansionPanelColor, ExpansionPanelVariant } from './props';
1
+ import { ExpansionPanelColor, ExpansionPanelVariant } from './props';
2
2
 
3
- export const ExpansionPanel: string[] = [
3
+ export const ExpansionPanelRoot: string[] = [
4
4
  // Layout
5
5
  'layout-column',
6
6
  ];
7
7
 
8
- export const ExpansionPanelVariants: Record<ExpansionPanelVariant, string[]> = {
8
+ export const ExpansionPanelRootVariants: Record<ExpansionPanelVariant, string[]> = {
9
9
  'default': [
10
10
  // Spacing
11
11
  'gap-sm',
@@ -20,33 +20,11 @@ export const ExpansionPanelVariants: Record<ExpansionPanelVariant, string[]> = {
20
20
  'py-md',
21
21
 
22
22
  'gap-md',
23
- ],
24
- };
25
-
26
- export const ExpansionPanelBackgroundColors: Record<`${ExpansionPanelBackgroundColor}-${ExpansionPanelVariant}`, string[]> = {
27
- 'primary-default': [],
28
23
 
29
- 'primary-card': [
30
24
  // Theme
31
25
  'theme-background-surface-1',
32
26
  'dark:theme-background-surface-1-dark',
33
27
  ],
34
-
35
- 'secondary-default': [],
36
-
37
- 'secondary-card': [
38
- // Theme
39
- 'theme-background-surface-3',
40
- 'dark:theme-background-surface-3-dark',
41
- ],
42
-
43
- 'inherit-default': [],
44
-
45
- 'inherit-card': [
46
- // Theme
47
- 'theme-background-inherit',
48
- 'dark:theme-background-inherit',
49
- ],
50
28
  };
51
29
 
52
30
  export const ExpansionPanelHeader: string[] = [