@onereach/ui-components 2.69.2-beta.2136.0 → 2.69.2

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 (78) hide show
  1. package/dist/bundled/v2/{OrAvatar-2fa559e1.js → OrAvatar-ae61bfb9.js} +41 -15
  2. package/dist/bundled/v2/{OrButton-4b99c680.js → OrButton-0e91a808.js} +1 -5
  3. package/dist/bundled/v2/{OrConfirm-cab6535b.js → OrConfirm-18c534df.js} +1 -1
  4. package/dist/bundled/v2/components/index.js +3 -3
  5. package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  6. package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  7. package/dist/bundled/v2/components/or-avatar-v3/index.js +2 -1
  8. package/dist/bundled/v2/components/or-avatar-v3/props.d.ts +2 -1
  9. package/dist/bundled/v2/components/or-avatar-v3/styles.d.ts +2 -0
  10. package/dist/bundled/v2/components/or-button-v3/index.js +1 -1
  11. package/dist/bundled/v2/components/or-confirm-v3/index.js +2 -2
  12. package/dist/bundled/v2/index.js +4 -4
  13. package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-22e46ce1.js → OrAvatar.vue_vue_type_script_lang-0426862b.js} +35 -13
  14. package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-b0dc31ca.js → OrButton.vue_vue_type_script_lang-3718b300.js} +1 -5
  15. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-3993a015.js → OrCardCollection.vue_vue_type_script_lang-861158b5.js} +2 -2
  16. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-49a3a9bd.js → OrConfirm.vue_vue_type_script_lang-289b5600.js} +1 -1
  17. package/dist/bundled/v3/{OrIconButton-4bd33e3c.js → OrIconButton-1581013c.js} +1 -1
  18. package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-641f6e06.js → OrIconButton.vue_vue_type_script_lang-f6f801ff.js} +1 -1
  19. package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-3a8189f4.js → OrInlineInput.vue_vue_type_script_lang-f29483f4.js} +2 -2
  20. package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-890b97ab.js → OrInlineTextarea.vue_vue_type_script_lang-cc40af48.js} +2 -2
  21. package/dist/bundled/v3/OrInput.vue_vue_type_script_lang-f6d793d3.js +2 -2
  22. package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-00a477f0.js → OrModal.vue_vue_type_script_lang-80a7b906.js} +2 -2
  23. package/dist/bundled/v3/OrNotification.vue_vue_type_script_lang-fbb35355.js +2 -2
  24. package/dist/bundled/v3/OrSelect.vue_vue_type_script_lang-15285ce4.js +1 -1
  25. package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-92d9fb12.js → OrTag.vue_vue_type_script_lang-dc6a4011.js} +2 -2
  26. package/dist/bundled/v3/{OrToastContainer-afb51e5d.js → OrToastContainer-7c3c0b12.js} +1 -1
  27. package/dist/bundled/v3/components/index.js +12 -12
  28. package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  29. package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  30. package/dist/bundled/v3/components/or-avatar-v3/index.js +3 -1
  31. package/dist/bundled/v3/components/or-avatar-v3/props.d.ts +2 -1
  32. package/dist/bundled/v3/components/or-avatar-v3/styles.d.ts +2 -0
  33. package/dist/bundled/v3/components/or-button-v3/index.js +1 -1
  34. package/dist/bundled/v3/components/or-card-collection-v3/index.js +3 -3
  35. package/dist/bundled/v3/components/or-confirm-v3/index.js +4 -4
  36. package/dist/bundled/v3/components/or-icon-button-v3/index.js +1 -1
  37. package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -3
  38. package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -3
  39. package/dist/bundled/v3/components/or-input-v3/index.js +2 -2
  40. package/dist/bundled/v3/components/or-modal-v3/index.js +3 -3
  41. package/dist/bundled/v3/components/or-notification-v3/index.js +2 -2
  42. package/dist/bundled/v3/components/or-search-v3/index.js +2 -2
  43. package/dist/bundled/v3/components/or-select-v3/index.js +3 -3
  44. package/dist/bundled/v3/components/or-tag-v3/index.js +3 -3
  45. package/dist/bundled/v3/components/or-toast-v3/index.js +4 -4
  46. package/dist/bundled/v3/index.js +29 -23
  47. package/dist/bundled/v3/{types-6c5eee23.js → types-dcc78caa.js} +2 -2
  48. package/dist/esm/v2/{OrAvatar-0afdef36.js → OrAvatar-3d155af3.js} +41 -15
  49. package/dist/esm/v2/{OrButton-357e1e2c.js → OrButton-357a5756.js} +1 -5
  50. package/dist/esm/v2/{OrConfirm-ec7aef0e.js → OrConfirm-b0b2e43c.js} +1 -1
  51. package/dist/esm/v2/components/index.js +3 -3
  52. package/dist/esm/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  53. package/dist/esm/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  54. package/dist/esm/v2/components/or-avatar-v3/index.js +2 -1
  55. package/dist/esm/v2/components/or-avatar-v3/props.d.ts +2 -1
  56. package/dist/esm/v2/components/or-avatar-v3/styles.d.ts +2 -0
  57. package/dist/esm/v2/components/or-button-v3/index.js +1 -1
  58. package/dist/esm/v2/components/or-confirm-v3/index.js +2 -2
  59. package/dist/esm/v2/index.js +3 -3
  60. package/dist/esm/v3/{OrAvatar-ef88d31c.js → OrAvatar-53a4429d.js} +43 -16
  61. package/dist/esm/v3/{OrButton-bb6bf8a9.js → OrButton-f4b9ee51.js} +1 -5
  62. package/dist/esm/v3/{OrConfirm-5d56cbd3.js → OrConfirm-906427ef.js} +1 -1
  63. package/dist/esm/v3/components/index.js +3 -3
  64. package/dist/esm/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  65. package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  66. package/dist/esm/v3/components/or-avatar-v3/index.js +2 -1
  67. package/dist/esm/v3/components/or-avatar-v3/props.d.ts +2 -1
  68. package/dist/esm/v3/components/or-avatar-v3/styles.d.ts +2 -0
  69. package/dist/esm/v3/components/or-button-v3/index.js +1 -1
  70. package/dist/esm/v3/components/or-confirm-v3/index.js +2 -2
  71. package/dist/esm/v3/index.js +3 -3
  72. package/package.json +3 -2
  73. package/src/components/or-avatar-v3/OrAvatar.stories3.ts +9 -7
  74. package/src/components/or-avatar-v3/OrAvatar.vue +22 -2
  75. package/src/components/or-avatar-v3/props.ts +1 -0
  76. package/src/components/or-avatar-v3/styles.ts +49 -11
  77. package/src/components/or-button-v3/styles.ts +0 -6
  78. package/src/components/or-menu-v3/OrMenu.stories3.ts +1 -1
@@ -2,7 +2,6 @@ import { Meta, StoryFn } from '@storybook/vue3';
2
2
  import OrAvatarDocs from './OrAvatar.docs.mdx';
3
3
  import OrAvatar from './OrAvatar.vue';
4
4
  import { AvatarColor, AvatarSize } from './props';
5
- import { OrIconV3 as OrIcon } from '../or-icon-v3';
6
5
  import { getAbbreviation } from '../../utils/functions/text';
7
6
  import { computed } from 'vue-demi';
8
7
 
@@ -39,6 +38,10 @@ export default {
39
38
  colorSalt: {
40
39
  control: { type: 'text' },
41
40
  },
41
+
42
+ icon: {
43
+ control: { type: 'text' },
44
+ },
42
45
  },
43
46
 
44
47
  parameters: {
@@ -58,7 +61,6 @@ export default {
58
61
  const DefaultTemplate: StoryFn<typeof OrAvatar> = (args) => ({
59
62
  components: {
60
63
  OrAvatar,
61
- OrIcon,
62
64
  },
63
65
 
64
66
  setup() {
@@ -114,22 +116,22 @@ WithTextInSlot.args = {
114
116
  colorSalt: 'A username',
115
117
  };
116
118
 
117
- export const WithIconInSlot = DefaultTemplate.bind({});
118
- WithIconInSlot.args = {
119
- default: '<or-icon icon="face" size="inherit" />',
119
+ export const WithIcon = DefaultTemplate.bind({});
120
+ WithIcon.args = {
121
+ icon: 'store',
120
122
  colorSalt: 'Any string here',
121
123
  };
122
124
 
123
125
  export const WithColor = DefaultTemplate.bind({});
124
126
  WithColor.args = {
125
127
  color: AvatarColor.blue,
126
- default: '<or-icon icon="person" size="inherit" />',
128
+ icon: 'person',
127
129
  };
128
130
 
129
131
  export const XL = DefaultTemplate.bind({});
130
132
  XL.args = {
131
133
  size: AvatarSize.XL,
132
- default: '<or-icon icon="person" size="inherit" />',
134
+ icon: 'person',
133
135
  colorSalt: 'Big Avatar',
134
136
  };
135
137
 
@@ -6,10 +6,16 @@
6
6
  >
7
7
  <slot>
8
8
  <img
9
+ v-if="src"
9
10
  :class="imageStyles"
10
11
  :src="src"
11
12
  :alt="''"
12
13
  >
14
+ <or-icon
15
+ v-else-if="icon"
16
+ :icon="icon"
17
+ size="inherit"
18
+ />
13
19
  </slot>
14
20
  </div>
15
21
  </template>
@@ -19,10 +25,14 @@ import { computed, defineComponent, PropType, ref, watchPostEffect } from 'vue-d
19
25
  import { useClassAttribute } from '../../hooks';
20
26
  import { generateHslFromString, hslToColorString } from '../../utils/functions/color';
21
27
  import { AvatarColor, AvatarSize } from './props';
22
- import { AvatarImage, AvatarRoot, AvatarRootColors, AvatarRootSizes } from './styles';
28
+ import { AvatarImage, AvatarRoot, AvatarRootColors, AvatarRootSizes, AvatarRootAbbreviationSizes, AvatarRootIconSizes } from './styles';
29
+ import { OrIconV3 as OrIcon } from '../or-icon-v3';
23
30
 
24
31
  export default defineComponent({
25
32
  name: 'OrAvatar',
33
+ components: {
34
+ OrIcon,
35
+ },
26
36
 
27
37
  inheritAttrs: false,
28
38
 
@@ -36,7 +46,10 @@ export default defineComponent({
36
46
  type: String as PropType<AvatarSize>,
37
47
  default: AvatarSize.M,
38
48
  },
39
-
49
+ icon: {
50
+ type: String,
51
+ default: undefined,
52
+ },
40
53
  color: {
41
54
  type: String as PropType<AvatarColor>,
42
55
  default: AvatarColor.auto,
@@ -58,6 +71,9 @@ export default defineComponent({
58
71
  // Refs
59
72
  const root = ref<HTMLElement>();
60
73
 
74
+ const isIcon = computed(() => {
75
+ return !props.icon;
76
+ });
61
77
  // Styles
62
78
  const classAttribute = useClassAttribute();
63
79
 
@@ -66,6 +82,10 @@ export default defineComponent({
66
82
  ...AvatarRoot,
67
83
  ...AvatarRootSizes[props.size],
68
84
  ...AvatarRootColors[props.color],
85
+ ...(isIcon.value
86
+ ? AvatarRootAbbreviationSizes[props.size]
87
+ : AvatarRootIconSizes[props.size]
88
+ ),
69
89
  classAttribute.value,
70
90
  ]);
71
91
 
@@ -3,6 +3,7 @@ export enum AvatarSize {
3
3
  L = 'l',
4
4
  M = 'm',
5
5
  S = 's',
6
+ XS = 'xs',
6
7
  }
7
8
 
8
9
  export enum AvatarColor {
@@ -27,36 +27,30 @@ export const AvatarRootSizes: Record<AvatarSize, string[]> = {
27
27
  // Box
28
28
  'w-[80px]',
29
29
  'h-[80px]',
30
-
31
- // Typography
32
- 'text-[32px]',
33
30
  ],
34
31
 
35
32
  'l': [
36
33
  // Box
37
34
  'w-[64px]',
38
35
  'h-[64px]',
39
-
40
- // Typography
41
- 'text-[24px]',
42
36
  ],
43
37
 
44
38
  'm': [
45
39
  // Box
46
40
  'w-[40px]',
47
41
  'h-[40px]',
48
-
49
- // Typography
50
- 'text-[16px]',
51
42
  ],
52
43
 
53
44
  's': [
54
45
  // Box
55
46
  'w-[32px]',
56
47
  'h-[32px]',
48
+ ],
57
49
 
58
- // Typography
59
- 'text-[16px]',
50
+ 'xs': [
51
+ // Box
52
+ 'w-[24px]',
53
+ 'h-[24px]',
60
54
  ],
61
55
  };
62
56
 
@@ -97,3 +91,47 @@ export const AvatarRootColors: Record<AvatarColor, string[]> = {
97
91
  'dark:text-overlay-dark',
98
92
  ],
99
93
  };
94
+
95
+ export const AvatarRootAbbreviationSizes: Record<AvatarSize, string[]> = {
96
+ 'xl': [
97
+ 'typography-headline-1',
98
+ ],
99
+
100
+ 'l': [
101
+ 'typography-headline-1',
102
+ ],
103
+
104
+ 'm': [
105
+ 'typography-body-1-bold',
106
+ ],
107
+
108
+ 's': [
109
+ 'typography-body-1-bold',
110
+ ],
111
+
112
+ 'xs': [
113
+ 'typography-caption-semibold',
114
+ ],
115
+ };
116
+
117
+ export const AvatarRootIconSizes: Record<AvatarSize, string[]> = {
118
+ 'xl': [
119
+ 'text-[40px]',
120
+ ],
121
+
122
+ 'l': [
123
+ 'text-[32px]',
124
+ ],
125
+
126
+ 'm': [
127
+ 'text-[20px]',
128
+ ],
129
+
130
+ 's': [
131
+ 'text-[16px]',
132
+ ],
133
+
134
+ 'xs': [
135
+ 'text-[16px]',
136
+ ],
137
+ };
@@ -7,9 +7,6 @@ export const ButtonRoot: string[] = [
7
7
  // Shape
8
8
  'rounded-md',
9
9
 
10
- // Sizing
11
- 'min-w-[96px]',
12
-
13
10
  // Interactivity
14
11
  'interactivity-auto',
15
12
 
@@ -49,9 +46,6 @@ export const ButtonRootVariants: Record<ButtonVariant, string[]> = {
49
46
  'link': [
50
47
  // Spacing
51
48
  'gap-sm md:gap-xs',
52
-
53
- // Sizing
54
- 'min-w-[auto]',
55
49
  ],
56
50
  };
57
51
 
@@ -136,7 +136,7 @@ const OrderDropdownTemplate: StoryFn<typeof OrMenu> = (args) => ({
136
136
  color="inherit"
137
137
  @click="menu.toggle()"
138
138
  >
139
- A-Z
139
+ Last Updated
140
140
  <OrIcon
141
141
  v-if="menu"
142
142
  :icon="menu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'"