@bethinkpl/design-system 33.0.3 → 33.0.4

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.
@@ -185,13 +185,17 @@ describe('Checkbox', () => {
185
185
  });
186
186
 
187
187
  describe('user interactions', () => {
188
- it('should emit update:modelValue when clicked', async () => {
188
+ it('should change to checked state when clicked from unchecked', async () => {
189
189
  const wrapper = setup({ modelValue: CHECKBOX_VALUES.UNCHECKED });
190
190
 
191
191
  await wrapper.find('label').trigger('click');
192
192
 
193
- expect(wrapper.emitted('update:modelValue')).toBeTruthy();
194
- expect(wrapper.emitted('update:modelValue')?.[0]?.[0]).toBe(CHECKBOX_VALUES.CHECKED);
193
+ const checkboxRoot = wrapper.find('[role="checkbox"]');
194
+ const checkboxIndicator = wrapper.find('.ds-checkbox__indicator');
195
+
196
+ expect(checkboxRoot.attributes('data-state')).toBe('checked');
197
+ expect(checkboxRoot.attributes('aria-checked')).toBe('true');
198
+ expect(checkboxIndicator.attributes('data-state')).toBe('checked');
195
199
  });
196
200
 
197
201
  it('should toggle from checked to unchecked when clicked', async () => {
@@ -199,7 +203,9 @@ describe('Checkbox', () => {
199
203
 
200
204
  await wrapper.find('label').trigger('click');
201
205
 
202
- expect(wrapper.emitted('update:modelValue')?.[0]?.[0]).toBe(CHECKBOX_VALUES.UNCHECKED);
206
+ const checkboxRoot = wrapper.find('[role="checkbox"]');
207
+ expect(checkboxRoot.attributes('data-state')).toBe('unchecked');
208
+ expect(checkboxRoot.attributes('aria-checked')).toBe('false');
203
209
  });
204
210
 
205
211
  it('should toggle from indeterminate to checked when clicked', async () => {
@@ -207,19 +213,25 @@ describe('Checkbox', () => {
207
213
 
208
214
  await wrapper.find('label').trigger('click');
209
215
 
210
- expect(wrapper.emitted('update:modelValue')?.[0]?.[0]).toBe(CHECKBOX_VALUES.CHECKED);
216
+ const checkboxRoot = wrapper.find('[role="checkbox"]');
217
+ expect(checkboxRoot.attributes('data-state')).toBe('checked');
218
+ expect(checkboxRoot.attributes('aria-checked')).toBe('true');
211
219
  });
212
220
 
213
- it('should not emit when disabled and clicked', async () => {
221
+ it('should not change state when disabled and clicked', async () => {
214
222
  const wrapper = setup({
215
223
  modelValue: CHECKBOX_VALUES.UNCHECKED,
216
224
  state: CHECKBOX_STATES.DISABLED,
217
225
  });
218
226
 
227
+ const checkboxRoot = wrapper.find('[role="checkbox"]');
228
+ const initialState = checkboxRoot.attributes('data-state');
229
+
219
230
  await wrapper.find('label').trigger('click');
220
231
 
221
- // Should not emit because checkbox is disabled
222
- expect(wrapper.emitted('update:modelValue')).toBeFalsy();
232
+ // Should not change state because checkbox is disabled
233
+ expect(checkboxRoot.attributes('data-state')).toBe(initialState);
234
+ expect(checkboxRoot.attributes('aria-checked')).toBe('false');
223
235
  });
224
236
  });
225
237
 
@@ -2,14 +2,13 @@ import Checkbox from './Checkbox.vue';
2
2
 
3
3
  import { Meta, StoryFn } from '@storybook/vue3';
4
4
  import {
5
+ CHECKBOX_ELEVATIONS,
5
6
  CHECKBOX_SIZES,
6
7
  CHECKBOX_STATES,
7
8
  CHECKBOX_VALUES,
8
- CHECKBOX_ELEVATIONS,
9
9
  } from './Checkbox.consts';
10
10
  import { withActions } from '@storybook/addon-actions/decorator';
11
11
  import { computed } from 'vue';
12
- import Banner from '../../Banner';
13
12
  import { useArgs } from '@storybook/preview-api';
14
13
 
15
14
  export default {
@@ -22,7 +21,7 @@ const StoryTemplate: StoryFn<typeof Checkbox> = (args) => {
22
21
  const [_, updateArgs] = useArgs();
23
22
 
24
23
  return {
25
- components: { Checkbox, Banner },
24
+ components: { Checkbox },
26
25
  setup() {
27
26
  const props = computed(() => {
28
27
  const { default: defaultSlot, modelValue, ...rest } = args;
@@ -43,7 +42,6 @@ const StoryTemplate: StoryFn<typeof Checkbox> = (args) => {
43
42
  >
44
43
  <span v-if="defaultSlot" v-html="defaultSlot" />
45
44
  </Checkbox>
46
- <Banner color="danger" title="Uwaga! Mogą wystąpić problemy z pisaniem testów jednostkowych korzystających z tego komponentu. Unikaj jego używania. A jeśli jest rok 2026 i wciąż widzisz ten komunikat — nakrzycz na Karola!" title-in-color />
47
45
  `,
48
46
  };
49
47
  };
@@ -6,13 +6,12 @@ import { args, argTypes } from '../FormField/FormField.stories.shared';
6
6
  import { reactive, toRefs } from 'vue';
7
7
  import { ICONS } from '../../Icons/Icon';
8
8
  import HelpButton from '../../Buttons/HelpButton';
9
- import Banner from '../../Banner';
10
9
 
11
10
  const meta: Meta<typeof CheckboxGroupField> = {
12
11
  title: 'Components/Form/CheckboxGroupField',
13
12
  component: CheckboxGroupField,
14
13
  render: (args) => ({
15
- components: { CheckboxGroupField, Checkbox, HelpButton, Banner },
14
+ components: { CheckboxGroupField, Checkbox, HelpButton },
16
15
  setup() {
17
16
  const { help, labelAside, message, fieldStatus, field, ...restRefs } = toRefs(args);
18
17
  const props = reactive({ ...restRefs });
@@ -51,7 +50,6 @@ const meta: Meta<typeof CheckboxGroupField> = {
51
50
  <div v-if="message" v-html="message" />
52
51
  </template>
53
52
  </CheckboxGroupField>
54
- <Banner color="danger" title="Uwaga! Mogą wystąpić problemy z pisaniem testów jednostkowych korzystających z tego komponentu. Unikaj jego używania. A jeśli jest rok 2026 i wciąż widzisz ten komunikat — nakrzycz na Karola!" title-in-color />
55
53
  `,
56
54
  }),
57
55
  argTypes,
@@ -0,0 +1,7 @@
1
+ import { TranslateFunction, ValidI18nKey } from './i18n';
2
+
3
+ declare module '@vue/runtime-core' {
4
+ interface ComponentCustomProperties {
5
+ $t: TranslateFunction<ValidI18nKey | string>;
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bethinkpl/design-system",
3
- "version": "33.0.3",
3
+ "version": "33.0.4",
4
4
  "description": "Bethink universe design-system",
5
5
  "repository": {
6
6
  "type": "git",
@@ -112,7 +112,7 @@
112
112
  "@vueuse/core": "14.1.0",
113
113
  "lodash-es": "4.17.22",
114
114
  "primevue": "4.0.0-rc.3",
115
- "reka-ui": "2.6.0",
115
+ "reka-ui": "2.8.0",
116
116
  "vee-validate": "4.15.1",
117
117
  "vue-component-type-helpers": "2.2.10"
118
118
  },