@onereach/ui-components 2.68.0-beta.2016.0 → 2.68.0-beta.2017.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 (57) hide show
  1. package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +44 -0
  2. package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +146 -0
  3. package/dist/bundled/v2/components/or-empty-state-v3/index.d.ts +3 -0
  4. package/dist/bundled/v2/components/or-empty-state-v3/index.js +242 -0
  5. package/dist/bundled/v2/components/or-empty-state-v3/props.d.ts +4 -0
  6. package/dist/bundled/v2/components/or-empty-state-v3/styles.d.ts +15 -0
  7. package/dist/bundled/v2/components/or-empty-state-v3/types.d.ts +2 -0
  8. package/dist/bundled/v2/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
  9. package/dist/bundled/v2/index.js +1 -1
  10. package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +44 -0
  11. package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +146 -0
  12. package/dist/bundled/v3/components/or-empty-state-v3/index.d.ts +3 -0
  13. package/dist/bundled/v3/components/or-empty-state-v3/index.js +217 -0
  14. package/dist/bundled/v3/components/or-empty-state-v3/props.d.ts +4 -0
  15. package/dist/bundled/v3/components/or-empty-state-v3/styles.d.ts +15 -0
  16. package/dist/bundled/v3/components/or-empty-state-v3/types.d.ts +2 -0
  17. package/dist/bundled/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
  18. package/dist/bundled/v3/index.js +1 -1
  19. package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +44 -0
  20. package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +146 -0
  21. package/dist/esm/v2/components/or-empty-state-v3/index.d.ts +3 -0
  22. package/dist/esm/v2/components/or-empty-state-v3/index.js +240 -0
  23. package/dist/esm/v2/components/or-empty-state-v3/props.d.ts +4 -0
  24. package/dist/esm/v2/components/or-empty-state-v3/styles.d.ts +15 -0
  25. package/dist/esm/v2/components/or-empty-state-v3/types.d.ts +2 -0
  26. package/dist/esm/v2/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
  27. package/dist/esm/v3/OrInput-4f55c0eb.js +1 -1
  28. package/dist/esm/v3/{OrInputBox-542d2f2c.js → OrInputBox-634230b1.js} +1 -1
  29. package/dist/esm/v3/OrSearch-d74891a5.js +1 -1
  30. package/dist/esm/v3/OrSelect-b3a233cc.js +1 -1
  31. package/dist/esm/v3/OrTextarea-98895b2a.js +1 -1
  32. package/dist/esm/v3/components/index.js +1 -1
  33. package/dist/esm/v3/components/or-card-collection-v3/index.js +1 -1
  34. package/dist/esm/v3/components/or-confirm-v3/index.js +1 -1
  35. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +44 -0
  36. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +146 -0
  37. package/dist/esm/v3/components/or-empty-state-v3/index.d.ts +3 -0
  38. package/dist/esm/v3/components/or-empty-state-v3/index.js +217 -0
  39. package/dist/esm/v3/components/or-empty-state-v3/props.d.ts +4 -0
  40. package/dist/esm/v3/components/or-empty-state-v3/styles.d.ts +15 -0
  41. package/dist/esm/v3/components/or-empty-state-v3/types.d.ts +2 -0
  42. package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
  43. package/dist/esm/v3/components/or-input-box-v3/index.js +2 -2
  44. package/dist/esm/v3/components/or-input-v3/index.js +1 -1
  45. package/dist/esm/v3/components/or-search-v3/index.js +1 -1
  46. package/dist/esm/v3/components/or-select-v3/index.js +1 -1
  47. package/dist/esm/v3/components/or-textarea-v3/index.js +1 -1
  48. package/dist/esm/v3/index.js +1 -1
  49. package/package.json +2 -10
  50. package/src/components/or-empty-state-v3/OrEmptyState.stories3.ts +221 -0
  51. package/src/components/or-empty-state-v3/OrEmptyState.vue +185 -0
  52. package/src/components/or-empty-state-v3/index.ts +3 -0
  53. package/src/components/or-empty-state-v3/props.ts +4 -0
  54. package/src/components/or-empty-state-v3/styles.ts +121 -0
  55. package/src/components/or-empty-state-v3/types.ts +3 -0
  56. package/src/components/or-input-box-v3/OrInputBox.vue +1 -1
  57. package/src/utils/functions/text.ts +2 -2
@@ -0,0 +1,221 @@
1
+ import { Meta, StoryFn } from '@storybook/vue3';
2
+ import OrEmptyState from './OrEmptyState.vue';
3
+ import successPng from '../../assets/success.png';
4
+ import { EmptyStateSize } from './props';
5
+
6
+ export default {
7
+ title: 'Components/Empty State',
8
+ component: OrEmptyState,
9
+ argTypes: {
10
+ loader: {
11
+ control: {
12
+ type: 'inline-radio',
13
+ labels: {
14
+ 'linear': "'linear'",
15
+ 'circular': "'circular'",
16
+ }
17
+ },
18
+ options: [false, true, 'linear', 'circular'],
19
+ },
20
+ size: {
21
+ control: {
22
+ type: 'inline-radio',
23
+ labels: {
24
+ [EmptyStateSize.M]: 'Medium',
25
+ [EmptyStateSize.L]: 'Large',
26
+ },
27
+ },
28
+ options: Object.values(EmptyStateSize),
29
+ },
30
+ },
31
+ parameters: {
32
+ layout: 'centered',
33
+ },
34
+ } as Meta<typeof OrEmptyState>
35
+
36
+ const Template: StoryFn<typeof OrEmptyState> = (args) => ({
37
+ components: { OrEmptyState },
38
+ setup() {
39
+ return { args };
40
+ },
41
+ template: `
42
+ <OrEmptyState v-bind="args"/>
43
+ `,
44
+ });
45
+
46
+ export const Default = Template.bind({});
47
+ Default.args = {
48
+ heading: 'No aliens detected',
49
+ text: 'Invite some aliens to your planet.'
50
+ };
51
+ Default.parameters = {
52
+ layout: 'fullscreen',
53
+ };
54
+ Default.decorators = [
55
+ () => ({
56
+ template: `
57
+ <div class="
58
+ demo-wrapper w-full min-h-[200px] h-screen box-border relative
59
+ gap-sm p-md bg-surface-variant
60
+ flex flex-col
61
+ text-body-2-regular">
62
+ <div>
63
+ Note: This frame is added for demo purpose.<br>
64
+ The OrEmptyState component is transparent and has <code>width:100%</code> and <code>flex-grow:1</code> attributes.<br>
65
+ It is recommended to put it inside a column flex container or a row flex container that wraps.
66
+ </div>
67
+ <div class="demo-container grow bg-background dark:bg-background-dark flex flex-col"><story /></div>
68
+ </div>
69
+ `
70
+ })
71
+ ];
72
+
73
+ export const LinearLoader = Template.bind({});
74
+ LinearLoader.args = {
75
+ heading: 'Looking for aliens',
76
+ text: '27 aliens detected so far.',
77
+ loader: true,
78
+ size: EmptyStateSize.L,
79
+ };
80
+ LinearLoader.parameters = {
81
+ layout: 'fullscreen',
82
+ };
83
+ LinearLoader.decorators = [
84
+ () => ({
85
+ template: `
86
+ <div class="
87
+ demo-wrapper w-full h-[200px] box-border relative
88
+ gap-sm p-md bg-surface-variant
89
+ flex flex-col
90
+ text-body-2-regular">
91
+ <div>Note: Use linear loader (values <b>true</b> or <b>'linear'</b>) on pages and inside wide containers.</div>
92
+ <div class="demo-container grow bg-background dark:bg-background-dark flex flex-col"><story /></div>
93
+ </div>
94
+ `
95
+ })
96
+ ];
97
+
98
+ export const CircularLoader = Template.bind({});
99
+ CircularLoader.args = {
100
+ heading: 'Looking for aliens',
101
+ text: '27 aliens detected so far.',
102
+ loader: 'circular',
103
+ };
104
+ CircularLoader.parameters = {
105
+ layout: 'fullscreen',
106
+ };
107
+ CircularLoader.decorators = [
108
+ () => ({
109
+ template: `
110
+ <div class="
111
+ demo-wrapper w-full min-h-[200px] h-screen box-border relative
112
+ gap-sm p-md bg-surface-variant
113
+ flex flex-col
114
+ text-body-2-regular">
115
+ <div>Note: Use circular loader (value <b>'circular'</b>) in narrow containers and sidebars.</div>
116
+ <div class="demo-container w-[300px] grow bg-background dark:bg-background-dark flex flex-col"><story /></div>
117
+ </div>
118
+ `
119
+ })
120
+ ];
121
+
122
+ export const MaterialIcon = Template.bind({});
123
+ MaterialIcon.args = {
124
+ ...Default.args,
125
+ icon: 'travel_explore',
126
+ };
127
+
128
+ export const ImageIcon = Template.bind({});
129
+ ImageIcon.args = {
130
+ heading: 'Planet populated',
131
+ text: 'So many aliens on this planet!',
132
+ imageSrc: successPng,
133
+ };
134
+
135
+ export const LargeSize = Template.bind({});
136
+ LargeSize.args = {
137
+ ...ImageIcon.args,
138
+ size: EmptyStateSize.L,
139
+ };
140
+
141
+ export const ExtraContentInSlot: StoryFn<typeof OrEmptyState> = (args) => ({
142
+ components: { OrEmptyState },
143
+ setup() {
144
+ return { args };
145
+ },
146
+ template: `
147
+ <OrEmptyState v-bind="args" heading="Alien not found" text="Pass formatted content via a default slot.">
148
+ Alien named <b>Garry</b> not found.<br>
149
+ The text in the slot is by default formatted as a component's text prop.
150
+ </OrEmptyState>
151
+ `,
152
+ });
153
+
154
+ export const Containers = Template.bind({});
155
+ Containers.args = {
156
+ ...Default.args,
157
+ };
158
+ Containers.parameters = {
159
+ layout: 'fullscreen',
160
+ };
161
+ Containers.decorators = [
162
+ () => ({
163
+ template: `
164
+ <div class="
165
+ demo-wrapper w-full min-h-screen box-border relative
166
+ gap-md p-md bg-surface-variant dark:bg-surface-variant-dark
167
+ grid grid-cols-3 grid-rows-[1fr_repeat(auto)]
168
+ text-caption-regular dark:text-secondary-dark dark:text-[12px]">
169
+ <!--Demo Container 1. Narrow-->
170
+ <div class="demo-1 demo-container row-span-3 flex flex-col gap-sm">
171
+ <div>
172
+ Narrow vertical container; flex flex-col;<br>
173
+ Background <code>bg-background</code> applied directly to the component
174
+ </div>
175
+ <story class="bg-background dark:bg-background-dark" loader="circular"/>
176
+ </div>
177
+ <!--Demo Container 2. Fixed-->
178
+ <div class="demo-2 flex flex-col gap-sm justify-center items-center">
179
+ <div>
180
+ Fixed size container; flex flex-col;<br>
181
+ Background bg-surface-1 applied to the container
182
+ </div>
183
+ <div class="demo-container w-[240px] h-[200px] bg-surface-1 dark:bg-surface-1-dark flex flex-col">
184
+ <story />
185
+ </div>
186
+ </div>
187
+ <!--Demo Container 3. No container-->
188
+ <div class="demo-3">
189
+ <div>No container or simple block container; no background </div>
190
+ <div class="demo-container w-fit"><story /></div>
191
+ </div>
192
+ <!--Demo Container 4. Wide not wrap-->
193
+ <div class="demo-4 col-span-2 flex flex-col gap-sm">
194
+ <div class="w-full">
195
+ Wide horizontal <b>no-wrap</b> container; flex flex-row;<br>
196
+ Background <code>bg-surface-1</code> applied to the container<br>
197
+ Background <code>bg-surface-4</code> applied to the component
198
+ </div>
199
+ <div class="demo-container bg-surface-1 dark:bg-surface-1-dark flex">
200
+ <div>Left item</div>
201
+ <story class="bg-surface-4 dark:bg-surface-4-dark" loader="linear"/>
202
+ <div>Right item</div>
203
+ </div>
204
+ </div>
205
+ <!--Demo Container 5. Wide wrap-->
206
+ <div class="demo-5 col-span-2 flex flex-col gap-sm">
207
+ <div class="w-full">
208
+ Wide horizontal <b>wrap</b> container; flex flex-row flex-wrap;<br>
209
+ Background <code>bg-surface-1</code> applied to the container<br>
210
+ Background <code>bg-surface-4</code> applied to the component
211
+ </div>
212
+ <div class="demo-container bg-surface-1 dark:bg-surface-1-dark flex flex-wrap">
213
+ <div>Left item</div>
214
+ <story class="bg-surface-4 dark:bg-surface-4-dark" loader="linear"/>
215
+ <div>Right item</div>
216
+ </div>
217
+ </div>
218
+ </div>
219
+ `
220
+ })
221
+ ];
@@ -0,0 +1,185 @@
1
+ <template>
2
+ <div :class="rootClasses">
3
+ <div :class="iconContainerClasses">
4
+ <OrIcon v-if="icon"
5
+ :icon="icon"
6
+ size="inherit"
7
+ :class="iconClasses" />
8
+ </div>
9
+ <img v-if="imageSrc"
10
+ :src="imageSrc"
11
+ :class="imageClasses"
12
+ alt="">
13
+ <div :class="headingClasses">
14
+ {{ heading }}
15
+ </div>
16
+ <div v-if="loader" :class="loaderClasses">
17
+ <OrLoader :variant="loaderVariant" />
18
+ </div>
19
+ <div v-if="$slots.default" :class="slotClasses">
20
+ <!-- @slot Additional content can be inserted via default slot. The slot uses the same font as a 'text' prop. -->
21
+ <slot/>
22
+ </div>
23
+ <div :class="textClasses">
24
+ {{ text }}
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script lang="ts">
30
+ import { defineComponent, PropType } from 'vue-demi';
31
+ import { EmptyStateLoader, EmptyStateSize } from '.';
32
+ import { OrIconV3 as OrIcon, } from '../or-icon-v3';
33
+ import { LoaderVariant, OrLoaderV3 as OrLoader, } from '../or-loader-v3';
34
+ import {
35
+ EmptyStateContent,
36
+ EmptyStateContentSizes,
37
+ EmptyStateHeading,
38
+ EmptyStateHeadingSizes,
39
+ EmptyStateIconContainer,
40
+ EmptyStateIconContainerSizes,
41
+ EmptyStateIcon,
42
+ EmptyStateIconSizes,
43
+ EmptyStateImage,
44
+ EmptyStateImageSizes,
45
+ EmptyStateLoaderStyles,
46
+ EmptyStateRoot,
47
+ EmptyStateText,
48
+ EmptyStateTextSizes
49
+ } from './styles';
50
+
51
+ /**
52
+ * The component to display when there is no content on a page,
53
+ * no records found or selected, or while the data is being loaded.
54
+ * Provides a hint to the user on what to do.
55
+ * Consists of text message, optional icon and optional loader.
56
+ */
57
+ export default defineComponent({
58
+ name: 'OrEmptyState',
59
+ components: {
60
+ OrIcon,
61
+ OrLoader,
62
+ },
63
+ props: {
64
+ /**
65
+ * Size of the component, affects font and icon size.
66
+ * Use Large if the component takes all screen space,
67
+ * and Medium if it is a part of the complex layout.
68
+ */
69
+ size: {
70
+ type: String as PropType<EmptyStateSize>,
71
+ default: EmptyStateSize.M,
72
+ },
73
+ /**
74
+ * The heading of the empty state block.
75
+ */
76
+ heading: {
77
+ type: String,
78
+ default: '',
79
+ },
80
+ /**
81
+ * Additional text such as a hint for a user with proposed next steps.
82
+ */
83
+ text: {
84
+ type: String,
85
+ default: '',
86
+ },
87
+ /**
88
+ * Material icon name to display above the heading.
89
+ */
90
+ icon: {
91
+ type: String,
92
+ default: undefined,
93
+ },
94
+ /**
95
+ * Path to the image to display above the heading.
96
+ * Image height is scaled to 48px, width is undefined to preserve aspect ratio.
97
+ */
98
+ imageSrc: {
99
+ type: String,
100
+ default: undefined,
101
+ },
102
+ /**
103
+ * If provided, then loader is being displayed.
104
+ * Accepts booleans and OrLoader::variant values. `true` falls back to 'linear'.
105
+ */
106
+ loader: {
107
+ type: [String, Boolean] as PropType<EmptyStateLoader>,
108
+ default: false,
109
+ },
110
+ },
111
+ computed: {
112
+ loaderVariant(): LoaderVariant | undefined {
113
+ if (typeof this.loader === 'string') {
114
+ return this.loader;
115
+ } else if (this.loader === true) {
116
+ return LoaderVariant.Linear;
117
+ } else {
118
+ return undefined;
119
+ }
120
+ },
121
+ rootClasses(): string[] {
122
+ return [
123
+ 'or-empty-state',
124
+ ...EmptyStateRoot,
125
+ ];
126
+ },
127
+ iconContainerClasses(): string[] {
128
+ return [
129
+ 'or-empty-state_icon-container',
130
+ ...EmptyStateIconContainer,
131
+ ...EmptyStateIconContainerSizes[this.size],
132
+
133
+ ];
134
+ },
135
+ iconClasses(): string[] {
136
+ return [
137
+ 'or-empty-state_icon',
138
+ ...EmptyStateIcon,
139
+ ...EmptyStateIconSizes[this.size],
140
+
141
+ ];
142
+ },
143
+ imageClasses(): string[] {
144
+ return [
145
+ 'or-empty-state_image',
146
+ ...EmptyStateImage,
147
+ ...EmptyStateImageSizes[this.size],
148
+
149
+ ];
150
+ },
151
+ headingClasses(): string[] {
152
+ return [
153
+ 'or-empty-state_heading',
154
+ ...EmptyStateHeading,
155
+ ...EmptyStateHeadingSizes[this.size],
156
+
157
+ ];
158
+ },
159
+ textClasses(): string[] {
160
+ return [
161
+ 'or-empty-state_text',
162
+ ...EmptyStateText,
163
+ ...EmptyStateTextSizes[this.size],
164
+
165
+ ];
166
+ },
167
+ slotClasses(): string[] {
168
+ return [
169
+ 'or-empty-state_content',
170
+ ...EmptyStateContent,
171
+ ...EmptyStateContentSizes[this.size],
172
+ ];
173
+ },
174
+ loaderClasses(): string[] {
175
+ return [
176
+ 'or-empty-state_loader',
177
+ ...EmptyStateLoaderStyles,
178
+ ];
179
+ },
180
+ },
181
+ });
182
+ </script>
183
+
184
+ <style scoped>
185
+ </style>
@@ -0,0 +1,3 @@
1
+ export { default as OrEmptyStateV3 } from './OrEmptyState.vue';
2
+ export * from './types';
3
+ export * from './props';
@@ -0,0 +1,4 @@
1
+ export enum EmptyStateSize {
2
+ L = 'l',
3
+ M = 'm',
4
+ }
@@ -0,0 +1,121 @@
1
+ import { EmptyStateSize } from './props';
2
+
3
+ export const EmptyStateRoot: string[] = [
4
+ // Layout
5
+ 'grow',
6
+ 'flex',
7
+ 'flex-col',
8
+ 'justify-center',
9
+ 'items-center',
10
+
11
+ // Box
12
+ 'w-full',
13
+
14
+ // Sizing
15
+ 'gap-sm',
16
+ ];
17
+
18
+ export const EmptyStateIconContainer: string[] = [
19
+ // Theme
20
+ 'text-on-surface-variant',
21
+ 'dark:text-on-surface-variant-dark',
22
+ ];
23
+
24
+ export const EmptyStateIconContainerSizes: Record<EmptyStateSize, string[]> = {
25
+ [EmptyStateSize.L]: [
26
+ // Typography
27
+ 'text-[64px]',
28
+ ],
29
+ [EmptyStateSize.M]: [
30
+ // Typography
31
+ 'text-[48px]',
32
+ ],
33
+ }
34
+
35
+ export const EmptyStateIcon: string[] = [
36
+ // Sizing
37
+ 'mb-sm',
38
+ ];
39
+
40
+ export const EmptyStateIconSizes: Record<EmptyStateSize, string[]> = {
41
+ [EmptyStateSize.L]: [
42
+ // Box
43
+ 'w-3xl',
44
+ 'h-3xl',
45
+ ],
46
+ [EmptyStateSize.M]: [
47
+ // Box
48
+ 'w-2xl',
49
+ 'h-2xl',
50
+ ],
51
+ };
52
+
53
+ export const EmptyStateImage = EmptyStateIcon;
54
+
55
+ export const EmptyStateImageSizes: Record<EmptyStateSize, string[]> = {
56
+ [EmptyStateSize.L]: [
57
+ // Box
58
+ 'h-3xl',
59
+ ],
60
+ [EmptyStateSize.M]: [
61
+ // Box
62
+ 'h-2xl',
63
+ ],
64
+ }
65
+
66
+ export const EmptyStateHeading: string[] = [
67
+ // Theme
68
+ 'text-on-background',
69
+ 'dark:text-on-background-dark'
70
+ ];
71
+
72
+ export const EmptyStateHeadingSizes: Record<EmptyStateSize, string[]> = {
73
+ [EmptyStateSize.L]: [
74
+ // Typography
75
+ 'text-headline-2',
76
+ 'font-headline-2',
77
+ ],
78
+ [EmptyStateSize.M]: [
79
+ // Typography
80
+ 'text-headline-4',
81
+ 'font-headline-4',
82
+ ],
83
+ }
84
+
85
+ export const EmptyStateText: string[] = [
86
+ 'text-center',
87
+
88
+ // Theme
89
+ 'text-outline',
90
+ 'dark:text-outline-dark',
91
+ ];
92
+
93
+ export const EmptyStateContent = EmptyStateText;
94
+
95
+ export const EmptyStateTextSizes: Record<EmptyStateSize, string[]> = {
96
+ [EmptyStateSize.L]: [
97
+ // Typography
98
+ 'text-body-2-regular',
99
+ 'font-body-2-regular',
100
+ ],
101
+ [EmptyStateSize.M]: [
102
+ // Typography
103
+ 'text-caption-regular',
104
+ 'font-caption-regular',
105
+ ],
106
+ };
107
+
108
+ export const EmptyStateContentSizes = EmptyStateTextSizes;
109
+
110
+ export const EmptyStateLoaderStyles: string[] = [
111
+ // Layout
112
+ 'flex',
113
+ 'justify-center',
114
+
115
+ // Box
116
+ 'w-2/5',
117
+ 'max-w-[432px]',
118
+
119
+ // Sizing
120
+ 'my-sm'
121
+ ];
@@ -0,0 +1,3 @@
1
+ import { LoaderVariant } from '../or-loader-v3';
2
+
3
+ export type EmptyStateLoader = boolean | LoaderVariant | undefined;
@@ -13,7 +13,7 @@
13
13
 
14
14
  <script lang="ts">
15
15
  import { computed, defineComponent, PropType, ref } from 'vue-demi';
16
- import { InputBoxVariant } from './props';
16
+ import { InputBoxVariant } from '.';
17
17
  import { useClassAttribute } from '../../hooks';
18
18
  import { InputBoxSize } from './props';
19
19
  import { InputBoxRoot, InputBoxRootSizes, InputBoxRootVariants } from './styles';
@@ -2,7 +2,7 @@ import { RX_ABBREVIATION_FROM_STRING } from '../constants/regex';
2
2
 
3
3
  export function getAbbreviation(text: string | null, limit?: number): string {
4
4
  if (typeof text != 'string' || !text) return '';
5
- return ((text.match(RX_ABBREVIATION_FROM_STRING) ?? []) as string[])
6
- .reduce((previous: string, next: string) => previous + ((+next === 0 || parseInt(next)) ? parseInt(next) : next[0] || ''), '')
5
+ return (text.match(RX_ABBREVIATION_FROM_STRING) ?? [])
6
+ .reduce((previous, next) => previous + ((+next === 0 || parseInt(next)) ? parseInt(next) : next[0] || ''), '')
7
7
  .toUpperCase().substring(0, limit);
8
8
  }