@bethinkpl/design-system 33.0.3 → 33.0.5
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.
- package/dist/design-system.js +5723 -5707
- package/dist/design-system.js.map +1 -1
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +1 -0
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +1 -0
- package/dist/lib/js/components/Chip/Chip.vue.d.ts +2 -0
- package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +1 -0
- package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +4 -0
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +3 -0
- package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +1 -0
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +2 -0
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +1 -0
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +1 -0
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +2 -0
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +2 -0
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +3 -0
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +1 -0
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +1 -0
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +1 -0
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +1 -0
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +1 -0
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +1 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +3 -0
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +3 -0
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +1 -0
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +1 -0
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +1 -0
- package/dist/storybook/localhost:8080/node_modules/.vite/deps/@bethinkpl_design-system.js?v=62a0baa6 +7919 -0
- package/lib/images/icons/ballot-check-time.svg +1 -0
- package/lib/js/components/Form/Checkbox/Checkbox.spec.ts +20 -8
- package/lib/js/components/Form/Checkbox/Checkbox.stories.ts +2 -4
- package/lib/js/components/Form/CheckboxGroupField/CheckboxGroupField.stories.ts +1 -3
- package/lib/js/components/Icons/Icon/Icon.consts.ts +2 -0
- package/lib/js/vue-custom.d.ts +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none"><path d="M41 0C45.375 0 49 3.625 49 8V20C49 21.6569 47.6569 23 46 23C44.3431 23 43 21.6569 43 20V8C43 6.875 42.125 6 41 6H9C7.875 6 7 6.875 7 8V56C7 57.125 7.875 58 9 58H26C27.6569 58 29 59.3431 29 61C29 62.6569 27.6569 64 26 64H9C4.625 64 1 60.375 1 56V8C1 3.625 4.625 0 9 0H41Z" fill="currentColor"/><path d="M44.5 35C45.9548 35 47.166 36.2112 47.166 37.666V44.0645L52.4902 47.6357C53.7414 48.432 54.0528 50.0998 53.2842 51.3076C52.488 52.5583 50.8209 52.8687 49.6133 52.1006L43.043 47.7197C42.2403 47.2291 41.834 46.3383 41.834 45.5V37.666C41.834 36.2112 43.0452 35 44.5 35Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M44.5 27C54.691 27 63 35.309 63 45.5C63 55.691 54.691 64 44.5 64C34.309 64 26 55.691 26 45.5C26 35.309 34.309 27 44.5 27ZM44.5 32.332C37.2188 32.332 31.332 38.2188 31.332 45.5C31.332 52.7812 37.2188 58.668 44.5 58.668C51.7812 58.668 57.668 52.7812 57.668 45.5C57.668 38.2188 51.7812 32.332 44.5 32.332Z" fill="currentColor"/><path d="M20 43C21.625 43 23 44.375 23 46C23 47.625 21.625 49 20 49H14C12.375 49 11 47.625 11 46C11 44.375 12.375 43 14 43H20Z" fill="currentColor"/><path d="M15 29C17.25 29 19 30.75 19 33C19 35.25 17.25 37 15 37C12.75 37 11 35.25 11 33C11 30.75 12.75 29 15 29Z" fill="currentColor"/><path d="M19.125 11.5C19.875 10.5 21.375 10.25 22.5 11.125C23.5 11.875 23.75 13.375 22.875 14.5L16.875 22.5C16.5 23 15.75 23.375 15 23.375C14.25 23.375 13.5 23 13.125 22.5L10.125 18.5C9.25 17.375 9.5 15.875 10.625 15.125C11.625 14.25 13.125 14.5 13.875 15.625L15 17L19.125 11.5Z" fill="currentColor"/><path d="M37 16C38.625 16 40 17.375 40 19C40 20.625 38.625 22 37 22H29C27.375 22 26 20.625 26 19C26 17.375 27.375 16 29 16H37Z" fill="currentColor"/></svg>
|
|
@@ -185,13 +185,17 @@ describe('Checkbox', () => {
|
|
|
185
185
|
});
|
|
186
186
|
|
|
187
187
|
describe('user interactions', () => {
|
|
188
|
-
it('should
|
|
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
|
-
|
|
194
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
222
|
-
expect(
|
|
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
|
|
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
|
|
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,
|
|
@@ -7,6 +7,7 @@ import HideAnswers from '../../../../images/icons/icon-hide-answers.svg';
|
|
|
7
7
|
import SidebarFlipSolid from '../../../../images/icons/sidebar-flip-solid.svg';
|
|
8
8
|
import Change from '../../../../images/icons/change.svg';
|
|
9
9
|
import CloudDisconnected from '../../../../images/icons/cloud-disconnected.svg';
|
|
10
|
+
import BallotCheckTime from '../../../../images/icons/ballot-check-time.svg';
|
|
10
11
|
|
|
11
12
|
import { FONTAWESOME_ICONS } from '../../../icons/fontawesome';
|
|
12
13
|
import { Value } from '../../../utils/type.utils';
|
|
@@ -52,6 +53,7 @@ const BETHINK_ICONS = {
|
|
|
52
53
|
SIDEBAR_FLIP_SOLID: SidebarFlipSolid,
|
|
53
54
|
SLIDERS_SEARCH: SlidersSearch,
|
|
54
55
|
CLOUD_DISCONNECTED: CloudDisconnected,
|
|
56
|
+
BALLOT_CHECK_TIME: BallotCheckTime,
|
|
55
57
|
} as const;
|
|
56
58
|
|
|
57
59
|
export const ICONS = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bethinkpl/design-system",
|
|
3
|
-
"version": "33.0.
|
|
3
|
+
"version": "33.0.5",
|
|
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.
|
|
115
|
+
"reka-ui": "2.8.0",
|
|
116
116
|
"vee-validate": "4.15.1",
|
|
117
117
|
"vue-component-type-helpers": "2.2.10"
|
|
118
118
|
},
|