@rocketui/vue 0.0.47 → 0.0.49
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/rocket-ui-vue.cjs.js +1 -0
- package/dist/rocket-ui-vue.d.ts +1812 -0
- package/dist/rocket-ui-vue.es.js +9270 -0
- package/dist/rocket-ui-vue.umd.js +1 -0
- package/dist/style.css +2 -0
- package/package.json +7 -1
- package/.eslintrc.cjs +0 -79
- package/.gitattributes +0 -2
- package/.github/workflows/chromatic.yml +0 -28
- package/.github/workflows/publish-storybook.yml +0 -41
- package/.husky/pre-commit +0 -4
- package/.prettierrc.cjs +0 -10
- package/.storybook/Theme.js +0 -17
- package/.storybook/main.ts +0 -20
- package/.storybook/manager-head.html +0 -3
- package/.storybook/manager.js +0 -8
- package/.storybook/preview-head.html +0 -3
- package/.storybook/preview.ts +0 -36
- package/.storybook/source-panel/manager.js +0 -28
- package/.storybook/withSource.js +0 -91
- package/.vscode/extensions.json +0 -11
- package/.vscode/settings.json +0 -20
- package/index.html +0 -13
- package/lib/main.ts +0 -48
- package/postcss.config.cjs +0 -9
- package/resources/rocket-ui-logo-dark.svg +0 -27
- package/resources/rocket-ui-logo-light.svg +0 -27
- package/shims-rocketui.d.ts +0 -9
- package/src/App.vue +0 -15
- package/src/assets/blank-avatar.svg +0 -3
- package/src/assets/icons/mdi.js +0 -7302
- package/src/assets/logo.svg +0 -1
- package/src/components/Accordion/Accordion.mdx +0 -88
- package/src/components/Accordion/Accordion.stories.ts +0 -257
- package/src/components/Accordion/RAccordion.vue +0 -73
- package/src/components/Accordion/accordion.css +0 -75
- package/src/components/Accordion/accordion.spec.ts +0 -123
- package/src/components/Alert/Alert.mdx +0 -120
- package/src/components/Alert/Alert.stories.ts +0 -118
- package/src/components/Alert/RAlert.vue +0 -119
- package/src/components/Alert/alert.css +0 -136
- package/src/components/Alert/alert.spec.ts +0 -32
- package/src/components/Avatar/Avatar.mdx +0 -96
- package/src/components/Avatar/Avatar.stories.ts +0 -65
- package/src/components/Avatar/RAvatar.vue +0 -115
- package/src/components/Avatar/avatar.css +0 -82
- package/src/components/Avatar/avatar.spec.ts +0 -38
- package/src/components/Badge/Badge.mdx +0 -112
- package/src/components/Badge/Badge.stories.ts +0 -99
- package/src/components/Badge/RBadge.vue +0 -89
- package/src/components/Badge/badge.css +0 -63
- package/src/components/Badge/badge.spec.ts +0 -20
- package/src/components/Box/Box.mdx +0 -20
- package/src/components/Box/Box.stories.ts +0 -56
- package/src/components/Box/RBox.vue +0 -97
- package/src/components/Breadcrumb/Breadcrumb.stories.ts +0 -115
- package/src/components/Breadcrumb/RBreadcrumb.vue +0 -43
- package/src/components/Breadcrumb/breadcrumb.css +0 -29
- package/src/components/Button/Button.mdx +0 -148
- package/src/components/Button/Button.spec.ts +0 -29
- package/src/components/Button/Button.stories.ts +0 -118
- package/src/components/Button/RButton.vue +0 -179
- package/src/components/Button/button.css +0 -146
- package/src/components/Checkbox/Checkbox.mdx +0 -100
- package/src/components/Checkbox/Checkbox.stories.ts +0 -67
- package/src/components/Checkbox/RCheckbox.vue +0 -195
- package/src/components/Checkbox/checkbox.css +0 -67
- package/src/components/Checkbox/checkbox.spec.ts +0 -60
- package/src/components/Chips/Chip.mdx +0 -113
- package/src/components/Chips/Chip.stories.ts +0 -122
- package/src/components/Chips/RChip.vue +0 -125
- package/src/components/Chips/chip.css +0 -62
- package/src/components/Chips/chip.spec.ts +0 -40
- package/src/components/Dropdown/Dropdown.mdx +0 -135
- package/src/components/Dropdown/Dropdown.stories.ts +0 -84
- package/src/components/Dropdown/RDropdown.vue +0 -392
- package/src/components/Dropdown/dropdown.css +0 -113
- package/src/components/Dropdown/dropdown.spec.ts +0 -98
- package/src/components/Flex/Flex.mdx +0 -20
- package/src/components/Flex/Flex.stories.js +0 -127
- package/src/components/Flex/RFlex.vue +0 -91
- package/src/components/Grid/Grid.mdx +0 -20
- package/src/components/Grid/Grid.stories.js +0 -107
- package/src/components/Grid/RGrid.vue +0 -138
- package/src/components/Icon/Icon.mdx +0 -68
- package/src/components/Icon/Icon.stories.ts +0 -33
- package/src/components/Icon/RIcon.vue +0 -56
- package/src/components/Icon/icon.spec.ts +0 -25
- package/src/components/ItemGroup/ItemGroup.stories.ts +0 -91
- package/src/components/ItemGroup/RItem.vue +0 -74
- package/src/components/ItemGroup/RItemGroup.vue +0 -122
- package/src/components/ItemGroup/__snapshots__/itemgroup.spec.ts.snap +0 -13
- package/src/components/ItemGroup/itemgroup.spec.ts +0 -67
- package/src/components/Label/Label.mdx +0 -50
- package/src/components/Label/Label.stories.ts +0 -38
- package/src/components/Label/RLabel.vue +0 -42
- package/src/components/Label/label.css +0 -0
- package/src/components/Modal/Modal.mdx +0 -91
- package/src/components/Modal/Modal.stories.ts +0 -125
- package/src/components/Modal/RModal.vue +0 -130
- package/src/components/Modal/modal.css +0 -41
- package/src/components/Modal/modal.spec.ts +0 -25
- package/src/components/Pagination/Pagination.stories.ts +0 -24
- package/src/components/Pagination/RPagination.vue +0 -103
- package/src/components/Pagination/pagination.css +0 -47
- package/src/components/Pagination/pagination.spec.ts +0 -17
- package/src/components/ProgressBar/ProgressBar.stories.ts +0 -34
- package/src/components/ProgressBar/RProgressBar.vue +0 -21
- package/src/components/ProgressBar/progressbar.css +0 -24
- package/src/components/ProgressBar/progressbar.spec.ts +0 -17
- package/src/components/Shared/Enums.ts +0 -1
- package/src/components/Sidebar/RSidebar.vue +0 -27
- package/src/components/Sidebar/Sidebar.mdx +0 -31
- package/src/components/Sidebar/Sidebar.stories.ts +0 -34
- package/src/components/Sidebar/sidebar.css +0 -18
- package/src/components/Sidebar/sidebar.spec.ts +0 -33
- package/src/components/Snackbar/RSnackbar.vue +0 -136
- package/src/components/Snackbar/Snackbar.mdx +0 -126
- package/src/components/Snackbar/Snackbar.stories.ts +0 -93
- package/src/components/Snackbar/snackbar.css +0 -99
- package/src/components/Snackbar/snackbar.spec.ts +0 -56
- package/src/components/Switch/RSwitch.vue +0 -147
- package/src/components/Switch/Switch.mdx +0 -102
- package/src/components/Switch/Switch.stories.ts +0 -79
- package/src/components/Switch/switch.css +0 -102
- package/src/components/Switch/switch.spec.ts +0 -31
- package/src/components/TabItem/RTabItem.vue +0 -175
- package/src/components/TabItem/TabItem.mdx +0 -95
- package/src/components/TabItem/TabItem.spec.ts +0 -29
- package/src/components/TabItem/TabItem.stories.ts +0 -97
- package/src/components/TabItem/common.ts +0 -6
- package/src/components/TabItem/tab-item.css +0 -29
- package/src/components/Tabs/RTabs.vue +0 -94
- package/src/components/Tabs/Tabs.mdx +0 -78
- package/src/components/Tabs/Tabs.spec.ts +0 -28
- package/src/components/Tabs/Tabs.stories.ts +0 -191
- package/src/components/Tabs/tabs.css +0 -13
- package/src/components/Tabs/types.ts +0 -11
- package/src/components/TextArea/RTextArea.vue +0 -142
- package/src/components/TextArea/TextArea.mdx +0 -108
- package/src/components/TextArea/TextArea.stories.ts +0 -55
- package/src/components/TextArea/textarea.css +0 -51
- package/src/components/TextArea/textarea.spec.ts +0 -36
- package/src/components/Textfield/RTextfield.vue +0 -372
- package/src/components/Textfield/Textfield.mdx +0 -159
- package/src/components/Textfield/Textfield.stories.ts +0 -121
- package/src/components/Textfield/textfield.css +0 -81
- package/src/components/Textfield/textfield.spec.ts +0 -34
- package/src/components/Tooltip/RTooltip.vue +0 -325
- package/src/components/Tooltip/Tooltip.mdx +0 -111
- package/src/components/Tooltip/Tooltip.stories.ts +0 -203
- package/src/components/Tooltip/common.ts +0 -91
- package/src/components/Tooltip/tooltip.css +0 -34
- package/src/components/Tooltip/tooltip.spec.ts +0 -81
- package/src/components/Typography/Typography.mdx +0 -109
- package/src/components/Typography/typography.css +0 -128
- package/src/directives/index.ts +0 -19
- package/src/index.css +0 -241
- package/src/main.ts +0 -5
- package/src/scripts/buildIcons.js +0 -21
- package/src/stories/Colors.mdx +0 -355
- package/src/stories/GettingStarted.mdx +0 -121
- package/src/stories/Layout.mdx +0 -15
- package/tailwind.config.cjs +0 -16
- package/tsconfig.json +0 -24
- package/vite.config.ts +0 -39
- package/vitest.config.ts +0 -12
- /package/{public → dist}/design-tokens.source.json +0 -0
- /package/{public → dist}/favicon.ico +0 -0
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
@import '../../index.css';
|
|
2
|
-
|
|
3
|
-
.dropdown-wrapper {
|
|
4
|
-
@apply relative;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.dropdown {
|
|
8
|
-
@apply flex items-center bg-white border border-[var(--neutral-200)] rounded-md shadow-sm py-3 px-4 text-left cursor-pointer sm:text-sm;
|
|
9
|
-
|
|
10
|
-
&--active {
|
|
11
|
-
@apply border border-[var(--primary-500)] ring-inset ring-2;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&--disabled {
|
|
15
|
-
@apply bg-[var(--neutral-100)] text-[var(--neutral-300)] border-[var(--neutral-200)] cursor-not-allowed;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&--loading {
|
|
19
|
-
@apply bg-[var(--neutral-100)] text-[var(--neutral-300)] border-[var(--neutral-200)] cursor-not-allowed animate-pulse;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&__prepend-icon {
|
|
23
|
-
@apply inset-y-0 right-0 flex items-center pointer-events-none pr-2;
|
|
24
|
-
|
|
25
|
-
&--active {
|
|
26
|
-
/* @apply text-[var(--primary-500)]; */
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&__tags {
|
|
31
|
-
@apply flex flex-wrap items-center gap-1;
|
|
32
|
-
|
|
33
|
-
&__chip {
|
|
34
|
-
@apply flex items-center gap-2 rounded-3xl text-xs text-[var(--neutral-900)] bg-[var(--neutral-100)];
|
|
35
|
-
|
|
36
|
-
& > .chip__text {
|
|
37
|
-
@apply whitespace-nowrap;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&__multiple {
|
|
43
|
-
@apply flex items-center gap-2;
|
|
44
|
-
& > * {
|
|
45
|
-
@apply flex-1 whitespace-nowrap;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&__input {
|
|
50
|
-
@apply text-[var(--neutral-900)] caret-[var(--primary-500)] block w-full placeholder-[var(--neutral-500)] focus:outline-none focus:ring-0 focus:border-transparent sm:text-sm disabled:bg-[var(--neutral-100)] disabled:text-[var(--neutral-300)] disabled:placeholder:text-[var(--neutral-300)];
|
|
51
|
-
|
|
52
|
-
&--loading {
|
|
53
|
-
@apply bg-[var(--neutral-100)] text-[var(--neutral-300)] border-[var(--neutral-200)] cursor-not-allowed animate-pulse;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&[readonly] {
|
|
57
|
-
@apply cursor-pointer;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&__append-icon {
|
|
62
|
-
@apply inset-y-0 right-0 flex items-center pointer-events-none;
|
|
63
|
-
|
|
64
|
-
&--active {
|
|
65
|
-
@apply transform rotate-180 transition-all duration-200 ease-in-out text-[var(--primary-500)];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.dropdown-options {
|
|
71
|
-
@apply hidden py-3 px-2 left-0 absolute z-10 w-full mt-1 bg-white border border-[var(--neutral-200)] rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm;
|
|
72
|
-
|
|
73
|
-
&--active {
|
|
74
|
-
@apply block;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&__option {
|
|
78
|
-
@apply text-[var(--neutral-900)] transition-all duration-200 ease-in
|
|
79
|
-
flex justify-between items-center w-full border border-transparent
|
|
80
|
-
rounded-md py-3 px-4 text-left cursor-pointer sm:text-sm min-h-[50px];
|
|
81
|
-
|
|
82
|
-
&:hover {
|
|
83
|
-
@apply bg-[var(--neutral-100)];
|
|
84
|
-
}
|
|
85
|
-
&--active {
|
|
86
|
-
@apply bg-[var(--primary-100)] text-[var(--primary-500)];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&__label {
|
|
90
|
-
@apply ml-2;
|
|
91
|
-
|
|
92
|
-
&--active {
|
|
93
|
-
/* @apply text-[var(--primary-500)]; */
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&__prepend-icon {
|
|
98
|
-
@apply text-[var(--neutral-900)] inset-y-0 right-0 flex items-center pointer-events-none;
|
|
99
|
-
|
|
100
|
-
&--active {
|
|
101
|
-
/* @apply text-[var(--primary-500)]; */
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&__append-icon {
|
|
106
|
-
@apply transition-colors duration-100 ease-in-out;
|
|
107
|
-
|
|
108
|
-
&--active {
|
|
109
|
-
/* @apply text-[var(--primary-500)]; */
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { mount } from '@vue/test-utils';
|
|
4
|
-
import Dropdown from './RDropdown.vue';
|
|
5
|
-
|
|
6
|
-
describe('Dropdown', () => {
|
|
7
|
-
it('renders properly', () => {
|
|
8
|
-
const wrapper = mount(Dropdown, {
|
|
9
|
-
props: {
|
|
10
|
-
options: [{ value: 1, label: '1' }],
|
|
11
|
-
placeholder: 'Select...',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
expect(wrapper.exists()).toBe(true);
|
|
16
|
-
expect(wrapper.find('input').exists()).toBe(true);
|
|
17
|
-
expect(wrapper.find('input').attributes('type')).toBe('text');
|
|
18
|
-
expect(wrapper.find('input').attributes('placeholder')).toBe('Select...');
|
|
19
|
-
expect(wrapper.classes()).toContain('dropdown');
|
|
20
|
-
expect(wrapper.find('ul').exists()).toBe(true);
|
|
21
|
-
expect(wrapper.find('.select').exists()).toBe(true);
|
|
22
|
-
expect(
|
|
23
|
-
wrapper
|
|
24
|
-
.find('.select')
|
|
25
|
-
.trigger('click')
|
|
26
|
-
.then(() => {
|
|
27
|
-
expect(wrapper.find('ul').classes()).toContain(
|
|
28
|
-
'select-options--active'
|
|
29
|
-
);
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('multiple', () => {
|
|
35
|
-
const wrapper = mount(Dropdown, {
|
|
36
|
-
props: {
|
|
37
|
-
options: [
|
|
38
|
-
{ value: 1, label: '1' },
|
|
39
|
-
{ value: 2, label: '2' },
|
|
40
|
-
],
|
|
41
|
-
multiple: true,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
expect(
|
|
45
|
-
wrapper
|
|
46
|
-
.find('.select')
|
|
47
|
-
.trigger('click')
|
|
48
|
-
.then(() => {
|
|
49
|
-
expect(wrapper.find('ul').classes()).toContain(
|
|
50
|
-
'select-options--active'
|
|
51
|
-
);
|
|
52
|
-
})
|
|
53
|
-
.then(() => {
|
|
54
|
-
document.addEventListener('click', () => {
|
|
55
|
-
expect(wrapper.find('ul').classes()).not.toContain(
|
|
56
|
-
'select-options--active'
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
})
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
expect(wrapper.find('.select__multiple').exists()).toBe(true);
|
|
63
|
-
expect(wrapper.find('.select-options__option__label').text()).toBe('1');
|
|
64
|
-
expect(
|
|
65
|
-
wrapper
|
|
66
|
-
.find('.select-options__option')
|
|
67
|
-
.trigger('click')
|
|
68
|
-
.then(() => {
|
|
69
|
-
expect(wrapper.find('.select__multiple').text()).toBe('1,');
|
|
70
|
-
})
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
it('taggable', () => {
|
|
74
|
-
const wrapper = mount(Dropdown, {
|
|
75
|
-
props: {
|
|
76
|
-
options: [
|
|
77
|
-
{ value: 1, label: '1' },
|
|
78
|
-
{ value: 2, label: '2' },
|
|
79
|
-
],
|
|
80
|
-
taggable: true,
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
expect(wrapper.find('.select__tags').exists()).toBe(true);
|
|
85
|
-
expect(wrapper.find('input').exists()).toBe(true);
|
|
86
|
-
expect(
|
|
87
|
-
wrapper
|
|
88
|
-
.find('.select-options__option')
|
|
89
|
-
.trigger('click')
|
|
90
|
-
.then(() => {
|
|
91
|
-
wrapper
|
|
92
|
-
.find('.select__tags')
|
|
93
|
-
.element.children[0].classList.contains('chip');
|
|
94
|
-
wrapper.find('.select__tags').element.children[0].textContent === '1';
|
|
95
|
-
})
|
|
96
|
-
);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as FlexStories from './Flex.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={FlexStories} />
|
|
5
|
-
|
|
6
|
-
# Flex
|
|
7
|
-
|
|
8
|
-
Flex is Box with display set to flex and comes with helpful style shorthand. It renders a `div` element.
|
|
9
|
-
|
|
10
|
-
### Overview
|
|
11
|
-
|
|
12
|
-
<Canvas>
|
|
13
|
-
<Story of={FlexStories.Overview} />
|
|
14
|
-
</Canvas>
|
|
15
|
-
|
|
16
|
-
### Playground
|
|
17
|
-
|
|
18
|
-
> Changes you make in the controls will be reflected in the example above.
|
|
19
|
-
|
|
20
|
-
<Controls of={FlexStories.Overview} exclude={/^(click|default|on.*)$/} />
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import Flex from './RFlex.vue';
|
|
2
|
-
import Box from '../Box/RBox.vue';
|
|
3
|
-
|
|
4
|
-
const Default = (args) => ({
|
|
5
|
-
components: { Flex, Box },
|
|
6
|
-
setup() {
|
|
7
|
-
return { args };
|
|
8
|
-
},
|
|
9
|
-
template: `
|
|
10
|
-
<Flex v-bind="args">
|
|
11
|
-
<Box>Box 1</Box>
|
|
12
|
-
<Box>Box 2</Box>
|
|
13
|
-
</Flex>`,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const defaultArgs = {
|
|
17
|
-
align: {
|
|
18
|
-
control: {
|
|
19
|
-
type: 'select',
|
|
20
|
-
options: [
|
|
21
|
-
'normal',
|
|
22
|
-
'stretch',
|
|
23
|
-
'center',
|
|
24
|
-
'start',
|
|
25
|
-
'end',
|
|
26
|
-
'flex-start',
|
|
27
|
-
'flex-end',
|
|
28
|
-
'baseline',
|
|
29
|
-
'first baseline',
|
|
30
|
-
'last baseline',
|
|
31
|
-
'safe center',
|
|
32
|
-
'unsafe center',
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
defaultValue: 'start',
|
|
36
|
-
},
|
|
37
|
-
justify: {
|
|
38
|
-
control: {
|
|
39
|
-
type: 'select',
|
|
40
|
-
options: [
|
|
41
|
-
'start',
|
|
42
|
-
'center',
|
|
43
|
-
'end',
|
|
44
|
-
'flex-start',
|
|
45
|
-
'flex-end',
|
|
46
|
-
'left',
|
|
47
|
-
'right',
|
|
48
|
-
'normal',
|
|
49
|
-
'space-between',
|
|
50
|
-
'space-around',
|
|
51
|
-
'space-evenly',
|
|
52
|
-
'stretch',
|
|
53
|
-
'safe center',
|
|
54
|
-
'unsafe center',
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
defaultValue: 'start',
|
|
58
|
-
},
|
|
59
|
-
wrap: {
|
|
60
|
-
control: {
|
|
61
|
-
type: 'select',
|
|
62
|
-
options: ['nowrap', 'wrap', 'wrap-reverse'],
|
|
63
|
-
},
|
|
64
|
-
defaultValue: 'nowrap',
|
|
65
|
-
},
|
|
66
|
-
direction: {
|
|
67
|
-
control: {
|
|
68
|
-
type: 'select',
|
|
69
|
-
options: ['row', 'row-reverse', 'column', 'column-reverse'],
|
|
70
|
-
},
|
|
71
|
-
defaultValue: 'row',
|
|
72
|
-
},
|
|
73
|
-
basis: {
|
|
74
|
-
control: {
|
|
75
|
-
type: 'select',
|
|
76
|
-
options: [
|
|
77
|
-
'auto',
|
|
78
|
-
'max-content',
|
|
79
|
-
'min-content',
|
|
80
|
-
'fit-content',
|
|
81
|
-
'content',
|
|
82
|
-
'inherit',
|
|
83
|
-
'initial',
|
|
84
|
-
'unset',
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
defaultValue: 'auto',
|
|
88
|
-
},
|
|
89
|
-
grow: {
|
|
90
|
-
control: {
|
|
91
|
-
type: 'select',
|
|
92
|
-
options: ['0', '1', '2', '3', '4', '5'],
|
|
93
|
-
},
|
|
94
|
-
defaultValue: '0',
|
|
95
|
-
},
|
|
96
|
-
shrink: {
|
|
97
|
-
control: {
|
|
98
|
-
type: 'select',
|
|
99
|
-
options: ['0', '1', '2', '3', '4', '5'],
|
|
100
|
-
},
|
|
101
|
-
defaultValue: '1',
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export default {
|
|
106
|
-
title: 'Layout/Flex',
|
|
107
|
-
component: Flex,
|
|
108
|
-
|
|
109
|
-
argTypes: {
|
|
110
|
-
...defaultArgs,
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
parameters: {
|
|
114
|
-
viewMode: 'docs',
|
|
115
|
-
},
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const Overview = {
|
|
119
|
-
render: Default.bind({}),
|
|
120
|
-
name: 'Overview',
|
|
121
|
-
|
|
122
|
-
argTypes: {
|
|
123
|
-
...Default.argTypes,
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
args: {},
|
|
127
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, type CSSProperties } from 'vue';
|
|
3
|
-
import '../../index.css';
|
|
4
|
-
|
|
5
|
-
export interface IProps {
|
|
6
|
-
/**
|
|
7
|
-
* Shorthand for `alignItems` style prop
|
|
8
|
-
* @type CSSProperties["alignItems"]
|
|
9
|
-
* @example
|
|
10
|
-
* <Flex align="center" />
|
|
11
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/align-items
|
|
12
|
-
*/
|
|
13
|
-
align?: CSSProperties['alignItems'];
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Shorthand for `justifyContent` style prop
|
|
17
|
-
* @type CSSProperties["justifyContent"]
|
|
18
|
-
* @example
|
|
19
|
-
* <Flex justify="center" />
|
|
20
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content
|
|
21
|
-
*/
|
|
22
|
-
justify?: CSSProperties['justifyContent'];
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Shorthand for `flexWrap` style prop
|
|
26
|
-
* @type CSSProperties["flexWrap"]
|
|
27
|
-
* @example
|
|
28
|
-
* <Flex wrap="wrap" />
|
|
29
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap
|
|
30
|
-
*/
|
|
31
|
-
wrap?: CSSProperties['flexWrap'];
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Shorthand for `flexDirection` style prop
|
|
35
|
-
* @type CSSProperties["flexDirection"]
|
|
36
|
-
* @example
|
|
37
|
-
* <Flex direction="column" />
|
|
38
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
|
|
39
|
-
*/
|
|
40
|
-
direction?: CSSProperties['flexDirection'];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Shorthand for `flexBasis` style prop
|
|
44
|
-
* @type CSSProperties["flexBasis"]
|
|
45
|
-
* @example
|
|
46
|
-
* <Flex basis="50%" />
|
|
47
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
|
|
48
|
-
*/
|
|
49
|
-
basis?: CSSProperties['flexBasis'];
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Shorthand for `flexGrow` style prop
|
|
53
|
-
* @type CSSProperties["flexGrow"]
|
|
54
|
-
* @example
|
|
55
|
-
* <Flex grow="1" />
|
|
56
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow
|
|
57
|
-
*/
|
|
58
|
-
grow?: CSSProperties['flexGrow'];
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Shorthand for `flexShrink` style prop
|
|
62
|
-
* @type CSSProperties["flexShrink"]
|
|
63
|
-
* @example
|
|
64
|
-
* <Flex shrink="1" />
|
|
65
|
-
* @link https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink
|
|
66
|
-
*/
|
|
67
|
-
shrink?: CSSProperties['flexShrink'];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const props = defineProps<IProps>();
|
|
71
|
-
const styles = computed(() => ({
|
|
72
|
-
alignItems: props.align,
|
|
73
|
-
justifyContent: props.justify,
|
|
74
|
-
flexWrap: props.wrap,
|
|
75
|
-
flexDirection: props.direction,
|
|
76
|
-
flexBasis: props.basis,
|
|
77
|
-
flexGrow: props.grow,
|
|
78
|
-
flexShrink: props.shrink,
|
|
79
|
-
}));
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<template>
|
|
83
|
-
<div class="flex" :style="styles">
|
|
84
|
-
<slot />
|
|
85
|
-
</div>
|
|
86
|
-
</template>
|
|
87
|
-
<style scoped>
|
|
88
|
-
.flex {
|
|
89
|
-
display: flex;
|
|
90
|
-
}
|
|
91
|
-
</style>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta, Story, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as GridStories from './Grid.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={GridStories} />
|
|
5
|
-
|
|
6
|
-
# Grid
|
|
7
|
-
|
|
8
|
-
Grid is a simple box component that can be used to create layouts.
|
|
9
|
-
|
|
10
|
-
> A simple box Components
|
|
11
|
-
|
|
12
|
-
<Canvas>
|
|
13
|
-
<Story of={GridStories.Overview} />
|
|
14
|
-
</Canvas>
|
|
15
|
-
|
|
16
|
-
### Playground <a id="playground" />
|
|
17
|
-
|
|
18
|
-
> Changes you make in the controls will be reflected in the example above.
|
|
19
|
-
|
|
20
|
-
<Controls of={GridStories.Overview} exclude={/^(click|default|on.*)$/} />
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import Grid from './RGrid.vue';
|
|
2
|
-
|
|
3
|
-
const Default = (args) => ({
|
|
4
|
-
components: { Grid },
|
|
5
|
-
setup() {
|
|
6
|
-
return { args };
|
|
7
|
-
},
|
|
8
|
-
template: `<Grid v-bind="args">
|
|
9
|
-
hello world
|
|
10
|
-
</Grid>`,
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const defaultArgs = {
|
|
14
|
-
templateColumns: {
|
|
15
|
-
control: {
|
|
16
|
-
type: 'text',
|
|
17
|
-
},
|
|
18
|
-
defaultValue: 'repeat(3, 1fr)',
|
|
19
|
-
},
|
|
20
|
-
gap: {
|
|
21
|
-
control: {
|
|
22
|
-
type: 'text',
|
|
23
|
-
},
|
|
24
|
-
defaultValue: '20px',
|
|
25
|
-
},
|
|
26
|
-
rowGap: {
|
|
27
|
-
control: {
|
|
28
|
-
type: 'text',
|
|
29
|
-
},
|
|
30
|
-
defaultValue: '20px',
|
|
31
|
-
},
|
|
32
|
-
columnGap: {
|
|
33
|
-
control: {
|
|
34
|
-
type: 'text',
|
|
35
|
-
},
|
|
36
|
-
defaultValue: '20px',
|
|
37
|
-
},
|
|
38
|
-
autoFlow: {
|
|
39
|
-
control: {
|
|
40
|
-
type: 'select',
|
|
41
|
-
options: ['row', 'column', 'dense', 'row dense', 'column dense'],
|
|
42
|
-
},
|
|
43
|
-
defaultValue: 'row',
|
|
44
|
-
},
|
|
45
|
-
autoRows: {
|
|
46
|
-
control: {
|
|
47
|
-
type: 'select',
|
|
48
|
-
options: ['auto', 'min-content', 'max-content', '1rem'],
|
|
49
|
-
},
|
|
50
|
-
defaultValue: 'auto',
|
|
51
|
-
},
|
|
52
|
-
autoColumns: {
|
|
53
|
-
control: {
|
|
54
|
-
type: 'select',
|
|
55
|
-
options: ['auto', 'min-content', 'max-content', '1rem'],
|
|
56
|
-
},
|
|
57
|
-
defaultValue: 'auto',
|
|
58
|
-
},
|
|
59
|
-
templateRows: {
|
|
60
|
-
control: {
|
|
61
|
-
type: 'text',
|
|
62
|
-
},
|
|
63
|
-
defaultValue: 'repeat(3, 1fr)',
|
|
64
|
-
},
|
|
65
|
-
templateAreas: {
|
|
66
|
-
control: {
|
|
67
|
-
type: 'text',
|
|
68
|
-
},
|
|
69
|
-
defaultValue: 'none',
|
|
70
|
-
},
|
|
71
|
-
column: {
|
|
72
|
-
control: {
|
|
73
|
-
type: 'text',
|
|
74
|
-
},
|
|
75
|
-
defaultValue: '1 / 2',
|
|
76
|
-
},
|
|
77
|
-
row: {
|
|
78
|
-
control: {
|
|
79
|
-
type: 'text',
|
|
80
|
-
},
|
|
81
|
-
defaultValue: '1 / 2',
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export default {
|
|
86
|
-
title: 'Layout/Grid',
|
|
87
|
-
component: Grid,
|
|
88
|
-
|
|
89
|
-
argTypes: {
|
|
90
|
-
...defaultArgs,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
parameters: {
|
|
94
|
-
viewMode: 'docs',
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const Overview = {
|
|
99
|
-
render: Default.bind({}),
|
|
100
|
-
name: 'Overview',
|
|
101
|
-
|
|
102
|
-
argTypes: {
|
|
103
|
-
...Default.argTypes,
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
args: {},
|
|
107
|
-
};
|