@weni/unnnic-system 2.0.8 → 2.0.10

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.
@@ -1,15 +1,18 @@
1
- {
2
- "upload_area": {
3
- "title": {
4
- "text": "Arraste seu arquivo aqui, ou",
5
- "highlight": "procure-o"
6
- },
7
- "invalid": {
8
- "subtitle": "Arquivo não compatível, selecione formatos suportados:"
9
- },
10
- "subtitle": "Formatos suportados:"
11
- },
12
- "import_card": {
13
- "importing": "Importando"
14
- }
15
- }
1
+ {
2
+ "upload_area": {
3
+ "title": {
4
+ "text": "Arraste seu arquivo aqui, ou",
5
+ "highlight": "procure-o"
6
+ },
7
+ "invalid": {
8
+ "subtitle": "Arquivo não compatível, selecione formatos suportados:"
9
+ },
10
+ "subtitle": "Formatos suportados:"
11
+ },
12
+ "import_card": {
13
+ "importing": "Importando"
14
+ },
15
+ "audio_recorder": {
16
+ "discard_button" : "Descartar"
17
+ }
18
+ }
@@ -14,7 +14,20 @@ export default {
14
14
  i18n(...args) {
15
15
  const [key, defaults] = args;
16
16
 
17
- const locale = (this.locale || get(this, '$i18n.locale'))?.toLowerCase();
17
+ const validLocaleValues = Object.keys(this.$i18n.messages);
18
+
19
+ let { locale } = this;
20
+
21
+ const treatedSelectedLocale =
22
+ get(this, '$i18n.locale') === 'en-us'
23
+ ? 'en'
24
+ : get(this, '$i18n.locale');
25
+
26
+ locale = validLocaleValues.includes(locale)
27
+ ? locale
28
+ : treatedSelectedLocale;
29
+
30
+ locale = locale.toLowerCase();
18
31
 
19
32
  let text = get(
20
33
  this.translations,
@@ -1,12 +1,15 @@
1
+ import alertCaller from '../components/Alert/AlertCaller.vue';
2
+ import alert from '../utils/call';
1
3
  import unnnicAlert from '../components/Alert/Alert.vue';
2
- import { unnnicCallAlert } from '../components';
4
+ import alertBanner from '../components/Alert/AlertBanner.vue';
3
5
 
4
6
  export default {
5
7
  title: 'example/Alert',
6
8
  component: unnnicAlert,
7
9
  argTypes: {
8
- type: { control: { type: 'text' } },
9
10
  text: { control: { type: 'text' } },
11
+ showCloseButton: { control: { type: 'boolean' } },
12
+ title: { control: { type: 'text' } },
10
13
  closeText: { control: { type: 'text' } },
11
14
  scheme: {
12
15
  control: {
@@ -55,7 +58,7 @@ export default {
55
58
 
56
59
  const Template = (args, { argTypes }) => ({
57
60
  props: Object.keys(argTypes),
58
- components: { unnnicCallAlert },
61
+ components: { alertCaller, unnnicAlert },
59
62
  template: `
60
63
  <div>
61
64
  <button @click="unnnicCallAlert">Click for alert</button>
@@ -84,21 +87,14 @@ Recommended use:
84
87
  </div>`,
85
88
  methods: {
86
89
  unnnicCallAlert() {
87
- unnnicCallAlert({
88
- props: {
89
- type: 'success',
90
- text: 'Alert'
91
- },
92
- containerRef: this.$refs.divContainer,
93
- })
90
+ alert.callAlert({ props: this.$props, seconds: this.$props.seconds });
94
91
  },
95
-
96
92
  },
97
93
  });
98
94
 
99
95
  const TemplateWithContainerRef = (args, { argTypes }) => ({
100
96
  props: Object.keys(argTypes),
101
- components: { unnnicCallAlert },
97
+ components: { alertCaller, unnnicAlert },
102
98
  template: `
103
99
  <div ref="divContainer" style="height: 200px; position: relative; border: 1px solid black">
104
100
  <button @click="unnnicCallAlert">Click for alert</button>
@@ -114,25 +110,55 @@ const TemplateWithContainerRef = (args, { argTypes }) => ({
114
110
  </div>`,
115
111
  methods: {
116
112
  unnnicCallAlert() {
117
- unnnicCallAlert({
118
- props: {
119
- type: 'success',
120
- text: 'Alert'
121
- },
113
+ alert.callAlert({
114
+ props: this.$props,
122
115
  containerRef: this.$refs.divContainer,
123
- })
116
+ });
124
117
  },
125
118
  },
126
119
  });
127
120
 
121
+ const TemplateBanner = (args, { argTypes }) => ({
122
+ props: Object.keys(argTypes),
123
+ components: { alertBanner },
124
+ template: `
125
+ <div>
126
+ <alert-banner v-bind="$props" />
127
+
128
+ <pre>
129
+ Recommended use:
130
+
131
+ &lt;unnnic-alert-banner
132
+ type String default 'info' ('info', 'warning', 'danger')
133
+ text String required
134
+ showCloseButton Boolean default false
135
+ @close Event
136
+ link-href String
137
+ ┠ link-text String default 'Learn more'
138
+ ┖ link-target String default '_blank'
139
+ /&gt;
140
+ </pre>
141
+ </div>`,
142
+ });
143
+
128
144
  export const Normal = Template.bind({});
129
145
  Normal.args = {
130
- type: 'success',
146
+ title: 'Title',
131
147
  text: 'Text',
148
+ icon: 'check-circle-1-1',
149
+ scheme: 'feedback-green',
132
150
  };
133
151
 
134
152
  export const WithContainerRef = TemplateWithContainerRef.bind({});
135
153
  WithContainerRef.args = {
136
- type: 'error',
154
+ title: 'Title',
155
+ text: 'Text',
156
+ icon: 'check-circle-1-1',
157
+ scheme: 'feedback-green',
158
+ };
159
+
160
+ export const Banner = TemplateBanner.bind({});
161
+ Banner.args = {
137
162
  text: 'Text',
163
+ showCloseButton: false,
138
164
  };
@@ -5,44 +5,40 @@ export default {
5
5
  title: 'Form/AudioRecorder',
6
6
  component: unnnicAudioRecorder,
7
7
  argTypes: {},
8
- };
9
-
10
- const Template = (args, { argTypes }) => ({
11
- props: Object.keys(argTypes),
12
-
13
- components: {
14
- unnnicAudioRecorder,
15
- },
16
-
17
- data() {
18
- return {
19
- audio: null,
20
- status: '',
21
- };
22
- },
23
-
24
- template: `
8
+ render: (args) => ({
9
+ components: {
10
+ unnnicAudioRecorder,
11
+ },
12
+ setup() {
13
+ return { args };
14
+ },
15
+ data() {
16
+ return {
17
+ audio: null,
18
+ status: '',
19
+ };
20
+ },
21
+ template: `
25
22
  <div>
26
23
  <button @click="$refs['audio-recorder'].record()">Gravar</button>
27
24
 
28
25
  <pre>v-model: {{ audio }}</pre>
29
26
  <pre>status: {{ status }}</pre>
30
27
 
31
- <unnnic-audio-recorder v-bind="$props" ref="audio-recorder" v-model="audio" @status="(value) => this.status = value" />
28
+ <unnnic-audio-recorder v-bind="args" ref="audio-recorder" v-model="audio" @status="(value) => this.status = value" />
32
29
  </div>
33
30
  `,
34
-
35
- methods: {},
36
- });
37
-
38
- export const Default = Template.bind({});
39
-
40
- Default.args = {
41
- canDiscard: true,
31
+ }),
42
32
  };
43
33
 
44
- export const Player = Template.bind({});
34
+ export const Default = {
35
+ args: {
36
+ canDiscard: true,
37
+ },
38
+ };
45
39
 
46
- Player.args = {
47
- src: AudioSample,
40
+ export const Player = {
41
+ args: {
42
+ src: AudioSample,
43
+ },
48
44
  };
@@ -1,196 +1,196 @@
1
- import { Meta } from '@storybook/blocks'
2
-
3
- <Meta title="Example/Introduction" />
4
-
5
- <style>
6
- {`
7
- .subheading {
8
- --mediumdark: '#999999';
9
- font-weight: 700;
10
- font-size: 13px;
11
- color: #999;
12
- letter-spacing: 6px;
13
- line-height: 24px;
14
- text-transform: uppercase;
15
- margin-bottom: 12px;
16
- margin-top: 40px;
17
- }
18
-
19
- .link-list {
20
- display: grid;
21
- grid-template-columns: 1fr;
22
- grid-template-rows: 1fr 1fr;
23
- row-gap: 10px;
24
- }
25
-
26
- @media (min-width: 620px) {
27
- .link-list {
28
- row-gap: 20px;
29
- column-gap: 20px;
30
- grid-template-columns: 1fr 1fr;
31
- }
32
- }
33
-
34
- @media all and (-ms-high-contrast:none) {
35
- .link-list {
36
- display: -ms-grid;
37
- -ms-grid-columns: 1fr 1fr;
38
- -ms-grid-rows: 1fr 1fr;
39
- }
40
- }
41
-
42
- .link-item {
43
- display: block;
44
- padding: 20px;
45
- border: 1px solid #00000010;
46
- border-radius: 5px;
47
- transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
48
- color: #333333;
49
- display: flex;
50
- align-items: flex-start;
51
- }
52
-
53
- .link-item:hover {
54
- border-color: #1EA7FD50;
55
- transform: translate3d(0, -3px, 0);
56
- box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
57
- }
58
-
59
- .link-item:active {
60
- border-color: #1EA7FD;
61
- transform: translate3d(0, 0, 0);
62
- }
63
-
64
- .link-item strong {
65
- font-weight: 700;
66
- display: block;
67
- margin-bottom: 2px;
68
- }
69
-
70
- .link-item img {
71
- height: 40px;
72
- width: 40px;
73
- margin-right: 15px;
74
- flex: none;
75
- }
76
-
77
- .link-item span,
78
- .link-item p {
79
- margin: 0;
80
- font-size: 14px;
81
- line-height: 20px;
82
- }
83
-
84
- .tip {
85
- display: inline-block;
86
- border-radius: 1em;
87
- font-size: 11px;
88
- line-height: 12px;
89
- font-weight: 700;
90
- background: #E7FDD8;
91
- color: #66BF3C;
92
- padding: 4px 12px;
93
- margin-right: 10px;
94
- vertical-align: top;
95
- }
96
-
97
- .tip-wrapper {
98
- font-size: 13px;
99
- line-height: 20px;
100
- margin-top: 40px;
101
- margin-bottom: 40px;
102
- }
103
-
104
- .tip-wrapper code {
105
- font-size: 12px;
106
- display: inline-block;
107
- }
108
- `}
109
- </style>
110
-
111
- # Welcome to Storybook
112
-
113
- Storybook helps you build UI components in isolation from your app's business logic, data, and context.
114
- That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
115
-
116
- Browse example stories now by navigating to them in the sidebar.
117
- View their code in the `stories` directory to learn how they work.
118
- We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
119
-
120
- <div className="subheading">Configure</div>
121
-
122
- <div className="link-list">
123
- <a
124
- className="link-item"
125
- href="https://storybook.js.org/docs/react/addons/addon-types"
126
- target="_blank"
127
- >
128
- <span>
129
- <strong>Presets for popular tools</strong>
130
- Easy setup for TypeScript, SCSS and more.
131
- </span>
132
- </a>
133
- <a
134
- className="link-item"
135
- href="https://storybook.js.org/docs/react/configure/webpack"
136
- target="_blank"
137
- >
138
- <span>
139
- <strong>Build configuration</strong>
140
- How to customize webpack and Babel
141
- </span>
142
- </a>
143
- <a
144
- className="link-item"
145
- href="https://storybook.js.org/docs/react/configure/styling-and-css"
146
- target="_blank"
147
- >
148
- <span>
149
- <strong>Styling</strong>
150
- How to load and configure CSS libraries
151
- </span>
152
- </a>
153
- <a
154
- className="link-item"
155
- href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
156
- target="_blank"
157
- >
158
- <span>
159
- <strong>Data</strong>
160
- Providers and mocking for data libraries
161
- </span>
162
- </a>
163
- </div>
164
-
165
- <div className="subheading">Learn</div>
166
-
167
- <div className="link-list">
168
- <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
169
- <span>
170
- <strong>Storybook documentation</strong>
171
- Configure, customize, and extend
172
- </span>
173
- </a>
174
- <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
175
- <span>
176
- <strong>In-depth guides</strong>
177
- Best practices from leading teams
178
- </span>
179
- </a>
180
- <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
181
- <span>
182
- <strong>GitHub project</strong>
183
- View the source and add issues
184
- </span>
185
- </a>
186
- <a className="link-item" href="https://discord.gg/storybook" target="_blank">
187
- <span>
188
- <strong>Discord chat</strong>
189
- Chat with maintainers and the community
190
- </span>
191
- </a>
192
- </div>
193
-
194
- <div className="tip-wrapper">
195
- <span className="tip">Tip</span>Edit the Markdown in <code>stories/Introduction.stories.mdx</code>
196
- </div>
1
+ import { Meta } from '@storybook/blocks'
2
+
3
+ <Meta title="Example/Introduction" />
4
+
5
+ <style>
6
+ {`
7
+ .subheading {
8
+ --mediumdark: '#999999';
9
+ font-weight: 700;
10
+ font-size: 13px;
11
+ color: #999;
12
+ letter-spacing: 6px;
13
+ line-height: 24px;
14
+ text-transform: uppercase;
15
+ margin-bottom: 12px;
16
+ margin-top: 40px;
17
+ }
18
+
19
+ .link-list {
20
+ display: grid;
21
+ grid-template-columns: 1fr;
22
+ grid-template-rows: 1fr 1fr;
23
+ row-gap: 10px;
24
+ }
25
+
26
+ @media (min-width: 620px) {
27
+ .link-list {
28
+ row-gap: 20px;
29
+ column-gap: 20px;
30
+ grid-template-columns: 1fr 1fr;
31
+ }
32
+ }
33
+
34
+ @media all and (-ms-high-contrast:none) {
35
+ .link-list {
36
+ display: -ms-grid;
37
+ -ms-grid-columns: 1fr 1fr;
38
+ -ms-grid-rows: 1fr 1fr;
39
+ }
40
+ }
41
+
42
+ .link-item {
43
+ display: block;
44
+ padding: 20px;
45
+ border: 1px solid #00000010;
46
+ border-radius: 5px;
47
+ transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
48
+ color: #333333;
49
+ display: flex;
50
+ align-items: flex-start;
51
+ }
52
+
53
+ .link-item:hover {
54
+ border-color: #1EA7FD50;
55
+ transform: translate3d(0, -3px, 0);
56
+ box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
57
+ }
58
+
59
+ .link-item:active {
60
+ border-color: #1EA7FD;
61
+ transform: translate3d(0, 0, 0);
62
+ }
63
+
64
+ .link-item strong {
65
+ font-weight: 700;
66
+ display: block;
67
+ margin-bottom: 2px;
68
+ }
69
+
70
+ .link-item img {
71
+ height: 40px;
72
+ width: 40px;
73
+ margin-right: 15px;
74
+ flex: none;
75
+ }
76
+
77
+ .link-item span,
78
+ .link-item p {
79
+ margin: 0;
80
+ font-size: 14px;
81
+ line-height: 20px;
82
+ }
83
+
84
+ .tip {
85
+ display: inline-block;
86
+ border-radius: 1em;
87
+ font-size: 11px;
88
+ line-height: 12px;
89
+ font-weight: 700;
90
+ background: #E7FDD8;
91
+ color: #66BF3C;
92
+ padding: 4px 12px;
93
+ margin-right: 10px;
94
+ vertical-align: top;
95
+ }
96
+
97
+ .tip-wrapper {
98
+ font-size: 13px;
99
+ line-height: 20px;
100
+ margin-top: 40px;
101
+ margin-bottom: 40px;
102
+ }
103
+
104
+ .tip-wrapper code {
105
+ font-size: 12px;
106
+ display: inline-block;
107
+ }
108
+ `}
109
+ </style>
110
+
111
+ # Welcome to Storybook
112
+
113
+ Storybook helps you build UI components in isolation from your app's business logic, data, and context.
114
+ That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
115
+
116
+ Browse example stories now by navigating to them in the sidebar.
117
+ View their code in the `stories` directory to learn how they work.
118
+ We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
119
+
120
+ <div className="subheading">Configure</div>
121
+
122
+ <div className="link-list">
123
+ <a
124
+ className="link-item"
125
+ href="https://storybook.js.org/docs/react/addons/addon-types"
126
+ target="_blank"
127
+ >
128
+ <span>
129
+ <strong>Presets for popular tools</strong>
130
+ Easy setup for TypeScript, SCSS and more.
131
+ </span>
132
+ </a>
133
+ <a
134
+ className="link-item"
135
+ href="https://storybook.js.org/docs/react/configure/webpack"
136
+ target="_blank"
137
+ >
138
+ <span>
139
+ <strong>Build configuration</strong>
140
+ How to customize webpack and Babel
141
+ </span>
142
+ </a>
143
+ <a
144
+ className="link-item"
145
+ href="https://storybook.js.org/docs/react/configure/styling-and-css"
146
+ target="_blank"
147
+ >
148
+ <span>
149
+ <strong>Styling</strong>
150
+ How to load and configure CSS libraries
151
+ </span>
152
+ </a>
153
+ <a
154
+ className="link-item"
155
+ href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
156
+ target="_blank"
157
+ >
158
+ <span>
159
+ <strong>Data</strong>
160
+ Providers and mocking for data libraries
161
+ </span>
162
+ </a>
163
+ </div>
164
+
165
+ <div className="subheading">Learn</div>
166
+
167
+ <div className="link-list">
168
+ <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
169
+ <span>
170
+ <strong>Storybook documentation</strong>
171
+ Configure, customize, and extend
172
+ </span>
173
+ </a>
174
+ <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
175
+ <span>
176
+ <strong>In-depth guides</strong>
177
+ Best practices from leading teams
178
+ </span>
179
+ </a>
180
+ <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
181
+ <span>
182
+ <strong>GitHub project</strong>
183
+ View the source and add issues
184
+ </span>
185
+ </a>
186
+ <a className="link-item" href="https://discord.gg/storybook" target="_blank">
187
+ <span>
188
+ <strong>Discord chat</strong>
189
+ Chat with maintainers and the community
190
+ </span>
191
+ </a>
192
+ </div>
193
+
194
+ <div className="tip-wrapper">
195
+ <span className="tip">Tip</span>Edit the Markdown in <code>stories/Introduction.stories.mdx</code>
196
+ </div>
@@ -3,25 +3,21 @@ import unnnicSlider from '../components/Slider/Slider.vue';
3
3
  export default {
4
4
  title: 'Form/Slider',
5
5
  component: unnnicSlider,
6
+ argTypes: {
7
+ size: { control: { type: 'select', options: ['small', 'medium'] } },
8
+ textLeft: { control: { type: 'text' } },
9
+ textRight: { control: { type: 'text' } },
10
+ disabled: { control: { type: 'boolean' } },
11
+ },
6
12
  };
7
13
 
8
- const Template = (args, { argTypes }) => ({
9
- props: Object.keys(argTypes),
10
- components: { unnnicSlider },
11
- template: '<unnnicSlider v-bind="$props" @valueChange="onChange"/>',
12
- methods: {
13
- onChange: (value) => {
14
- console.log(value);
15
- },
14
+ export const Default = {
15
+ args: {
16
+ initialValue: 1,
17
+ minValue: 1,
18
+ maxValue: 4,
19
+ step: 1,
20
+ minLabel: '1',
21
+ maxLabel: '4',
16
22
  },
17
- });
18
-
19
- export const Default = Template.bind({});
20
- Default.args = {
21
- initialValue: 1,
22
- minValue: 1,
23
- maxValue: 4,
24
- step: 1,
25
- minLabel: '1',
26
- maxLabel: '4',
27
23
  };