@flightlesslabs/dodo-ui 0.12.0 → 0.12.1
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/package.json +17 -19
- package/src/lib/stories/Home.mdx +59 -0
- package/src/lib/stories/assets/dark-theme-toggle.png +0 -0
- package/src/lib/stories/components/Form/Button/Button.stories.svelte +61 -0
- package/src/lib/stories/components/Form/Button/Color/Color.stories.svelte +43 -0
- package/src/lib/stories/components/Form/Button/Events/Events.stories.svelte +36 -0
- package/src/lib/stories/components/Form/Button/IconButton/IconButton.stories.svelte +43 -0
- package/src/lib/stories/components/Form/Button/Roundness/Roundness.stories.svelte +23 -0
- package/src/lib/stories/components/Form/Button/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/Button/Variant/Variant.stories.svelte +18 -0
- package/src/lib/stories/components/Form/DatePicker/Color/Color.stories.svelte +47 -0
- package/src/lib/stories/components/Form/DatePicker/Controls/Controls.stories.svelte +58 -0
- package/src/lib/stories/components/Form/DatePicker/Customize/Customize.stories.svelte +167 -0
- package/src/lib/stories/components/Form/DatePicker/DatePicker.stories.svelte +107 -0
- package/src/lib/stories/components/Form/DatePicker/Events/Events.stories.svelte +147 -0
- package/src/lib/stories/components/Form/DatePicker/FilterDates/FilterDates.stories.svelte +61 -0
- package/src/lib/stories/components/Form/DatePicker/Positions/AutoPosition/AutoPosition.stories.svelte +46 -0
- package/src/lib/stories/components/Form/DatePicker/Positions/Positions.stories.svelte +57 -0
- package/src/lib/stories/components/Form/DatePicker/Roundness/Roundness.stories.svelte +38 -0
- package/src/lib/stories/components/Form/DatePicker/Size/Size.stories.svelte +41 -0
- package/src/lib/stories/components/Form/DatePicker/WithIcon/WithIcon.stories.svelte +41 -0
- package/src/lib/stories/components/Form/FormControl/FormControl.stories.svelte +28 -0
- package/src/lib/stories/components/Form/Label/Label.stories.svelte +13 -0
- package/src/lib/stories/components/Form/Message/Color/Color.stories.svelte +36 -0
- package/src/lib/stories/components/Form/Message/Message.stories.svelte +27 -0
- package/src/lib/stories/components/Form/Message/Size/Size.stories.svelte +22 -0
- package/src/lib/stories/components/Form/NumericInput/Events/Events.stories.svelte +134 -0
- package/src/lib/stories/components/Form/NumericInput/NumericInput.stories.svelte +84 -0
- package/src/lib/stories/components/Form/NumericInput/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/components/Form/NumericInput/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/NumericInput/Validation/Validation.stories.svelte +87 -0
- package/src/lib/stories/components/Form/NumericInput/WithIcon/WithIcon.stories.svelte +31 -0
- package/src/lib/stories/components/Form/PasswordInput/Events/Events.stories.svelte +132 -0
- package/src/lib/stories/components/Form/PasswordInput/PasswordInput.stories.svelte +58 -0
- package/src/lib/stories/components/Form/PasswordInput/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/components/Form/PasswordInput/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/PasswordInput/WithIcon/WithIcon.stories.svelte +31 -0
- package/src/lib/stories/components/Form/RangeSlider/Color/Color.stories.svelte +19 -0
- package/src/lib/stories/components/Form/RangeSlider/Events/Events.stories.svelte +63 -0
- package/src/lib/stories/components/Form/RangeSlider/RangeSlider.stories.svelte +69 -0
- package/src/lib/stories/components/Form/RangeSlider/Roundness/Roundness.stories.svelte +30 -0
- package/src/lib/stories/components/Form/RangeSlider/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Form/RangeSlider/WithIcon/WithIcon.stories.svelte +33 -0
- package/src/lib/stories/components/Form/Select/Customize/Customize.stories.svelte +139 -0
- package/src/lib/stories/components/Form/Select/DropDownArrow/DropDownArrow.stories.svelte +63 -0
- package/src/lib/stories/components/Form/Select/Events/Events.stories.svelte +174 -0
- package/src/lib/stories/components/Form/Select/Options/OptionFormat.mdx +40 -0
- package/src/lib/stories/components/Form/Select/Positions/AutoPosition/AutoPosition.stories.svelte +58 -0
- package/src/lib/stories/components/Form/Select/Positions/Positions.stories.svelte +87 -0
- package/src/lib/stories/components/Form/Select/Roundness/Roundness.stories.svelte +32 -0
- package/src/lib/stories/components/Form/Select/Select.stories.svelte +125 -0
- package/src/lib/stories/components/Form/Select/Size/Size.stories.svelte +28 -0
- package/src/lib/stories/components/Form/Select/WithIcon/WithIcon.stories.svelte +43 -0
- package/src/lib/stories/components/Form/TextInput/Events/Events.stories.svelte +125 -0
- package/src/lib/stories/components/Form/TextInput/Roundness/Roundness.stories.svelte +21 -0
- package/src/lib/stories/components/Form/TextInput/Size/Size.stories.svelte +17 -0
- package/src/lib/stories/components/Form/TextInput/TextInput.stories.svelte +43 -0
- package/src/lib/stories/components/Form/TextInput/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/stories/components/Info/Calendar/Calendar.stories.svelte +121 -0
- package/src/lib/stories/components/Info/Calendar/Color/Color.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/Controls/Controls.stories.svelte +26 -0
- package/src/lib/stories/components/Info/Calendar/Customize/Customize.stories.svelte +160 -0
- package/src/lib/stories/components/Info/Calendar/Events/Events.stories.svelte +122 -0
- package/src/lib/stories/components/Info/Calendar/FilterDates/FilterDates.stories.svelte +70 -0
- package/src/lib/stories/components/Info/Calendar/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarControls.stories.svelte +36 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/CalendarMonthSelector.stories.svelte +58 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/Color/Color.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/Customize/Customize.stories.svelte +30 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/Events/Events.stories.svelte +25 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/NameTypes/NameTypes.stories.svelte +25 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/Roundness/Roundness.stories.svelte +26 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarMonthSelector/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarNavigation/CalendarNavigation.stories.svelte +36 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarNavigation/Color/Color.stories.svelte +19 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarNavigation/Customize/Customize.stories.svelte +33 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarNavigation/Events/Events.stories.svelte +37 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarNavigation/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarYearSelector/CalendarYearSelector.stories.svelte +58 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarYearSelector/Color/Color.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarYearSelector/Customize/Customize.stories.svelte +30 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarYearSelector/Events/Events.stories.svelte +25 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarYearSelector/Roundness/Roundness.stories.svelte +26 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/CalendarYearSelector/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/Color/Color.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/Controls/Controls.stories.svelte +21 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/Customize/Customize.stories.svelte +69 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/Events/Events.stories.svelte +61 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarControls/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/CalendarDateChip.stories.svelte +75 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/Color/Color.stories.svelte +41 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/Customize/Customize.stories.svelte +45 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/Events/Events.stories.svelte +28 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/Roundness/Roundness.stories.svelte +31 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/Size/Size.stories.svelte +24 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDateChip/SpecialChips/SpecialChips.stories.svelte +96 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarDatesChart.stories.svelte +104 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarWeek/CalendarWeek.stories.svelte +38 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarWeek/Customize/Customize.stories.svelte +32 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarWeek/NameTypes/NameTypes.stories.svelte +28 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/CalendarWeek/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/Color/Color.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/Customize/Customize.stories.svelte +68 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/Events/Events.stories.svelte +24 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarDatesChart/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthChip/CalendarMonthChip.stories.svelte +40 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthChip/Color/Color.stories.svelte +29 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthChip/Customize/Customize.stories.svelte +33 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthChip/Events/Events.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthChip/Roundness/Roundness.stories.svelte +26 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthChip/Size/Size.stories.svelte +19 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/CalendarMonthList.stories.svelte +45 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/Color/Color.stories.svelte +22 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/Customize/Customize.stories.svelte +36 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/Events/Events.stories.svelte +33 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarMonthList/Size/Size.stories.svelte +19 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/CalendarYearChip.stories.svelte +41 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/Color/Color.stories.svelte +30 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/Customize/Customize.stories.svelte +33 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/Events/Events.stories.svelte +24 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/Roundness/Roundness.stories.svelte +27 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearChip/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/CalendarYearList.stories.svelte +39 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/Color/Color.stories.svelte +23 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/Customize/Customize.stories.svelte +36 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/Events/Events.stories.svelte +24 -0
- package/src/lib/stories/components/Info/Calendar/SubComponents/CalendarYearList/Size/Size.stories.svelte +20 -0
- package/src/lib/stories/components/Info/Calendar/utils/createDateOfMonth/index.mdx +121 -0
- package/src/lib/stories/components/Info/Calendar/utils/getDatesOfMonth/index.mdx +37 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/Customize/Customize.stories.svelte +30 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/DynamicMenu.stories.svelte +56 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/Events/Events.stories.svelte +48 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/KeybaordNavigation/KeybaordNavigation.stories.svelte +29 -0
- package/src/lib/stories/components/Layout/Menu/DynamicMenu/Options/OptionFormat.mdx +72 -0
- package/src/lib/stories/components/Layout/Menu/Menu.stories.svelte +69 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/MenuItem.stories.svelte +34 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/components/Layout/Menu/MenuItem/Type/Type.stories.svelte +21 -0
- package/src/lib/stories/components/Layout/Menu/Size/Size.stories.svelte +37 -0
- package/src/lib/stories/components/Layout/Paper/Color/Color.stories.svelte +63 -0
- package/src/lib/stories/components/Layout/Paper/Paper.stories.svelte +50 -0
- package/src/lib/stories/components/Layout/Paper/Roundness/Roundness.stories.svelte +25 -0
- package/src/lib/stories/components/Layout/Paper/Shadow/Shadow.stories.svelte +24 -0
- package/src/lib/stories/components/Layout/Separator/Color/Color.stories.svelte +19 -0
- package/src/lib/stories/components/Layout/Separator/Separator.stories.svelte +30 -0
- package/src/lib/stories/developer tools/Intro.mdx +9 -0
- package/src/lib/stories/developer tools/components/DynamicInput/DynamicInput.stories.svelte +53 -0
- package/src/lib/stories/developer tools/components/DynamicInput/Events/Events.stories.svelte +121 -0
- package/src/lib/stories/developer tools/components/DynamicInput/Size/Size.stories.svelte +17 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte +38 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte +20 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/Size/Size.stories.svelte +16 -0
- package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte +47 -0
- package/src/lib/stories/developer tools/components/Popper/Popper.stories.svelte +140 -0
- package/src/lib/stories/developer tools/components/Popper/PopperPopup/PopperPopup.stories.svelte +64 -0
- package/src/lib/stories/developer tools/components/Popper/Positions/AutoPosition/AutoPosition.stories.svelte +92 -0
- package/src/lib/stories/developer tools/components/Popper/Positions/Positions.stories.svelte +114 -0
- package/src/lib/stories/developer tools/components/UtilityButton/Size/Size.stories.svelte +25 -0
- package/src/lib/stories/developer tools/components/UtilityButton/UtilityButton.stories.svelte +30 -0
- package/src/lib/stories/developer tools/directives/clickOutside/index.mdx +25 -0
- package/src/lib/stories/developer tools/helpers/Numbers/cleanNumericString/index.mdx +20 -0
- package/src/lib/stories/developer tools/helpers/Numbers/isValidNumberValue/index.mdx +71 -0
- package/src/lib/stories/developer tools/helpers/Time/getMoment/index.mdx +45 -0
- package/src/lib/stories/developer tools/helpers/logger/index.mdx +63 -0
- package/src/lib/stories/developer tools/philosophy/Colors/Colors.mdx +43 -0
- package/src/lib/stories/developer tools/philosophy/Colors/Colors.stories.svelte +22 -0
- package/src/lib/stories/developer tools/philosophy/Colors/Opacity.stories.svelte +11 -0
- package/src/lib/stories/developer tools/philosophy/Themes.mdx +23 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper, { paperColorArray } from './Paper.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentRoundnessArray } from '$lib/types/roundness.js';
|
|
6
|
+
import { componentShadowArray } from '$lib/types/shadow.js';
|
|
7
|
+
import { componentWeightArray } from '$lib/types/weight.js';
|
|
8
|
+
|
|
9
|
+
export const storyPaperArgTypes: StoryBookArgTypes = {
|
|
10
|
+
color: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: paperColorArray,
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: componentWeightArray,
|
|
17
|
+
},
|
|
18
|
+
roundness: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: componentRoundnessArray,
|
|
21
|
+
},
|
|
22
|
+
shadow: {
|
|
23
|
+
control: { type: 'select' },
|
|
24
|
+
options: componentShadowArray,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
29
|
+
const { Story } = defineMeta({
|
|
30
|
+
component: Paper,
|
|
31
|
+
tags: ['autodocs'],
|
|
32
|
+
argTypes: storyPaperArgTypes,
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<!-- Paper with default style -->
|
|
37
|
+
<Story name="Default">Hola!</Story>
|
|
38
|
+
|
|
39
|
+
<!-- Paper with width and height -->
|
|
40
|
+
<Story name="WidthAndHeight" args={{ width: '200px', height: '200px', color: 'primary' }}>
|
|
41
|
+
Hola!
|
|
42
|
+
</Story>
|
|
43
|
+
|
|
44
|
+
<!-- Paper with Custom Background and Border colors -->
|
|
45
|
+
<Story
|
|
46
|
+
name="Custom Color"
|
|
47
|
+
args={{ height: '100px', customBackgroundColor: '#ffdfad', customBorderColor: '#fbc674' }}
|
|
48
|
+
>
|
|
49
|
+
Hola!
|
|
50
|
+
</Story>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from '../Paper.svelte';
|
|
4
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Roundness 1" args={{ height: '100px', color: 'primary' }}></Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Roundness 2" args={{ roundness: 2, height: '100px', color: 'primary' }}></Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Roundness 3" args={{ roundness: 3, height: '100px', color: 'primary' }}></Story>
|
|
19
|
+
|
|
20
|
+
<Story name="Roundness 0" args={{ roundness: 0, height: '100px', color: 'primary' }}></Story>
|
|
21
|
+
|
|
22
|
+
<Story
|
|
23
|
+
name="Roundness Full"
|
|
24
|
+
args={{ roundness: 'full', height: '100px', width: '100%', color: 'primary' }}
|
|
25
|
+
></Story>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Paper from '../Paper.svelte';
|
|
4
|
+
import { storyPaperArgTypes } from '../Paper.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Paper,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyPaperArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Shadow 0" args={{ height: '100px' }}>Hola!</Story>
|
|
15
|
+
|
|
16
|
+
<Story name="Shadow 1" args={{ shadow: 1, height: '100px' }}>Hola!</Story>
|
|
17
|
+
|
|
18
|
+
<Story name="Shadow 2" args={{ shadow: 2, height: '100px' }}>Hola!</Story>
|
|
19
|
+
|
|
20
|
+
<Story name="Shadow 3" args={{ shadow: 3, height: '100px' }}>Hola!</Story>
|
|
21
|
+
|
|
22
|
+
<Story name="Shadow 4" args={{ shadow: 4, height: '100px' }}>Hola!</Story>
|
|
23
|
+
|
|
24
|
+
<Story name="Shadow 5" args={{ shadow: 5, height: '100px' }}>Hola!</Story>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { storySeparatorArgTypes } from '../Separator.stories.svelte';
|
|
4
|
+
import Separator from '../Separator.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: Separator,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storySeparatorArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Neutral">Hola!</Story>
|
|
15
|
+
<Story name="Primary" args={{ color: 'primary' }}>Hola!</Story>
|
|
16
|
+
<Story name="Secondary" args={{ color: 'secondary' }}>Hola!</Story>
|
|
17
|
+
<Story name="Safe" args={{ color: 'safe' }}>Hola!</Story>
|
|
18
|
+
<Story name="Warning" args={{ color: 'warning' }}>Hola!</Story>
|
|
19
|
+
<Story name="Danger" args={{ color: 'danger' }}>Hola!</Story>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import Separator, { separatorOrientationArray } from './Separator.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentColorArray } from '$lib/types/colors.js';
|
|
6
|
+
|
|
7
|
+
export const storySeparatorArgTypes: StoryBookArgTypes = {
|
|
8
|
+
color: {
|
|
9
|
+
control: { type: 'select' },
|
|
10
|
+
options: componentColorArray,
|
|
11
|
+
},
|
|
12
|
+
orientation: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: separatorOrientationArray,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
19
|
+
const { Story } = defineMeta({
|
|
20
|
+
component: Separator,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: storySeparatorArgTypes,
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<Story name="Default" />
|
|
27
|
+
|
|
28
|
+
<Story name="FixedWidth" args={{ width: '200px' }} />
|
|
29
|
+
|
|
30
|
+
<Story name="VerticalOrientation" args={{ orientation: 'vertical', height: '200px' }} />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Developer Tools
|
|
2
|
+
|
|
3
|
+
A set of components and tools used internally in dodo-ui.
|
|
4
|
+
|
|
5
|
+
## Explore More
|
|
6
|
+
|
|
7
|
+
- [Utility Button](?path=/docs/developer-tools-components-utilitybutton--docs)
|
|
8
|
+
- [Colors](?path=/docs/developer-tools-philosophy-colors--docs)
|
|
9
|
+
- [Adjust Color Opacity](?path=/docs/developer-tools-philosophy-colors--docs#adjusting-opacity)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import DynamicInput, { dynamicInputVariantArray } from './DynamicInput.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentSizeArray } from '$lib/types/size.js';
|
|
6
|
+
import { textInputTypeArray } from '$lib/stories/components/Form/TextInput/TextInput.svelte';
|
|
7
|
+
import Icon from '@iconify/svelte';
|
|
8
|
+
|
|
9
|
+
export const storyDynamicInputArgTypes: StoryBookArgTypes = {
|
|
10
|
+
type: {
|
|
11
|
+
control: { type: 'select' },
|
|
12
|
+
options: textInputTypeArray,
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: dynamicInputVariantArray,
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: { type: 'select' },
|
|
20
|
+
options: componentSizeArray,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
25
|
+
const { Story } = defineMeta({
|
|
26
|
+
component: DynamicInput,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
argTypes: storyDynamicInputArgTypes,
|
|
29
|
+
args: { value: 'Hello world!' },
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Story name="Default" />
|
|
34
|
+
|
|
35
|
+
<!-- Clickable button type Variant -->
|
|
36
|
+
<Story name="VariantButton" args={{ variant: 'button' }} />
|
|
37
|
+
|
|
38
|
+
<!-- Clickable button type Variant with placeholder -->
|
|
39
|
+
<Story
|
|
40
|
+
name="ButtonWithPlaceholder"
|
|
41
|
+
args={{ variant: 'button', placeholder: 'Type Something...', value: '' }}
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<Story name="CustomInputContent" asChild>
|
|
45
|
+
<DynamicInput variant="button" value="Hello world!">
|
|
46
|
+
{#snippet customInputContent(value)}
|
|
47
|
+
<div>
|
|
48
|
+
{`${value}`}
|
|
49
|
+
<Icon icon="material-symbols:ads-click" width="24" height="24" style="color: #d21313" />
|
|
50
|
+
</div>
|
|
51
|
+
{/snippet}
|
|
52
|
+
</DynamicInput>
|
|
53
|
+
</Story>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import { storyDynamicInputArgTypes } from '../DynamicInput.stories.svelte';
|
|
4
|
+
import DynamicInput, {
|
|
5
|
+
type DynamicInputFocusEvent,
|
|
6
|
+
type DynamicInputKeyboardEvent,
|
|
7
|
+
} from '../DynamicInput.svelte';
|
|
8
|
+
import type { TextInputClipboardEvent } from '$lib/stories/components/Form/TextInput/TextInput.svelte';
|
|
9
|
+
|
|
10
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
11
|
+
const { Story } = defineMeta({
|
|
12
|
+
component: DynamicInput,
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: storyDynamicInputArgTypes,
|
|
15
|
+
args: { value: 'Hello world!' },
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<Story
|
|
20
|
+
name="Input"
|
|
21
|
+
args={{
|
|
22
|
+
oninput: (e: Event) => {
|
|
23
|
+
const target = e.target as HTMLInputElement;
|
|
24
|
+
|
|
25
|
+
console.log('Input Event', target.value);
|
|
26
|
+
},
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<Story
|
|
31
|
+
name="Change"
|
|
32
|
+
args={{
|
|
33
|
+
onchange: (e: Event) => {
|
|
34
|
+
const target = e.target as HTMLInputElement;
|
|
35
|
+
|
|
36
|
+
console.log('onChange Event', target.value);
|
|
37
|
+
},
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<Story
|
|
42
|
+
name="Focus"
|
|
43
|
+
args={{
|
|
44
|
+
onfocus: (e: DynamicInputFocusEvent) => {
|
|
45
|
+
const target = e.target as HTMLInputElement;
|
|
46
|
+
|
|
47
|
+
console.log('onfocus Event', target);
|
|
48
|
+
},
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<Story
|
|
53
|
+
name="Blur"
|
|
54
|
+
args={{
|
|
55
|
+
onblur: (e: DynamicInputFocusEvent) => {
|
|
56
|
+
const target = e.target as HTMLInputElement;
|
|
57
|
+
|
|
58
|
+
console.log('onblur Event', target);
|
|
59
|
+
},
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<Story
|
|
64
|
+
name="Copy"
|
|
65
|
+
args={{
|
|
66
|
+
oncopy: (e: TextInputClipboardEvent) => {
|
|
67
|
+
const target = e.target as HTMLInputElement;
|
|
68
|
+
|
|
69
|
+
console.log('oncopy Event', target);
|
|
70
|
+
},
|
|
71
|
+
}}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<Story
|
|
75
|
+
name="Cut"
|
|
76
|
+
args={{
|
|
77
|
+
oncut: (e: TextInputClipboardEvent) => {
|
|
78
|
+
const target = e.target as HTMLInputElement;
|
|
79
|
+
|
|
80
|
+
console.log('oncut Event', target);
|
|
81
|
+
},
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<Story
|
|
86
|
+
name="Paste"
|
|
87
|
+
args={{
|
|
88
|
+
onpaste: (e: TextInputClipboardEvent) => {
|
|
89
|
+
const target = e.target as HTMLInputElement;
|
|
90
|
+
|
|
91
|
+
console.log('onpaste Event', target);
|
|
92
|
+
},
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<Story
|
|
97
|
+
name="KeyDown"
|
|
98
|
+
args={{
|
|
99
|
+
onkeydown: (e: DynamicInputKeyboardEvent) => {
|
|
100
|
+
console.log('onkeydown Event', e.key);
|
|
101
|
+
},
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<Story
|
|
106
|
+
name="KeyPress"
|
|
107
|
+
args={{
|
|
108
|
+
onkeypress: (e: DynamicInputKeyboardEvent) => {
|
|
109
|
+
console.log('onkeypress Event', e.key);
|
|
110
|
+
},
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
|
|
114
|
+
<Story
|
|
115
|
+
name="KeyUp"
|
|
116
|
+
args={{
|
|
117
|
+
onkeyup: (e: DynamicInputKeyboardEvent) => {
|
|
118
|
+
console.log('onkeyup Event', e.key);
|
|
119
|
+
},
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import DynamicInput from '../DynamicInput.svelte';
|
|
4
|
+
import { storyDynamicInputArgTypes } from '../DynamicInput.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: DynamicInput,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyDynamicInputArgTypes,
|
|
11
|
+
args: { value: 'Hello world!' },
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Story name="Normal" />
|
|
16
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
17
|
+
<Story name="Large" args={{ size: 'large' }} />
|
package/src/lib/stories/developer tools/components/InputEnclosure/InputEnclosure.stories.svelte
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from './InputEnclosure.svelte';
|
|
4
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
5
|
+
import { componentRoundnessArray } from '$lib/types/roundness.js';
|
|
6
|
+
import { componentSizeArray } from '$lib/types/size.js';
|
|
7
|
+
|
|
8
|
+
export const storyInputEnclosureArgTypes: StoryBookArgTypes = {
|
|
9
|
+
roundness: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: componentRoundnessArray,
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: componentSizeArray,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
20
|
+
const { Story } = defineMeta({
|
|
21
|
+
component: InputEnclosure,
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<!-- An ensloure for Form Inputs [TextInput](?path=/docs/components-form-textinput--docs) -->
|
|
28
|
+
<Story name="Default" />
|
|
29
|
+
|
|
30
|
+
<Story name="Focused" args={{ focused: true }} />
|
|
31
|
+
|
|
32
|
+
<Story name="Error" args={{ error: true }} />
|
|
33
|
+
|
|
34
|
+
<Story name="Disabled" args={{ disabled: true }} />
|
|
35
|
+
|
|
36
|
+
<Story name="Input example">
|
|
37
|
+
<input type="text" style="flex: 1; border: 0;" placeholder="Enter name" />
|
|
38
|
+
</Story>
|
package/src/lib/stories/developer tools/components/InputEnclosure/Roundness/Roundness.stories.svelte
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Roundness 1" />
|
|
15
|
+
|
|
16
|
+
<Story name="Roundness 2" args={{ roundness: 2 }} />
|
|
17
|
+
|
|
18
|
+
<Story name="Roundness 3" args={{ roundness: 3 }} />
|
|
19
|
+
|
|
20
|
+
<Story name="Roundness 0" args={{ roundness: 0 }} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
7
|
+
const { Story } = defineMeta({
|
|
8
|
+
component: InputEnclosure,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<Story name="Normal" />
|
|
15
|
+
<Story name="Small" args={{ size: 'small' }} />
|
|
16
|
+
<Story name="Large" args={{ size: 'large' }} />
|
package/src/lib/stories/developer tools/components/InputEnclosure/WithIcon/WithIcon.stories.svelte
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import InputEnclosure from '../InputEnclosure.svelte';
|
|
4
|
+
import { storyInputEnclosureArgTypes } from '../InputEnclosure.stories.svelte';
|
|
5
|
+
import Icon from '@iconify/svelte';
|
|
6
|
+
|
|
7
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
8
|
+
const { Story } = defineMeta({
|
|
9
|
+
component: InputEnclosure,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: storyInputEnclosureArgTypes,
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<!-- InputEnclosure icon in front. -->
|
|
16
|
+
<Story name="Icon Before" asChild>
|
|
17
|
+
<InputEnclosure>
|
|
18
|
+
{#snippet before()}
|
|
19
|
+
<Icon icon="material-symbols:content-copy" />
|
|
20
|
+
{/snippet}
|
|
21
|
+
</InputEnclosure>
|
|
22
|
+
</Story>
|
|
23
|
+
|
|
24
|
+
<!-- InputEnclosure icon in front. -->
|
|
25
|
+
<Story name="Icon After" asChild>
|
|
26
|
+
<InputEnclosure>
|
|
27
|
+
{#snippet after()}
|
|
28
|
+
<Icon icon="material-symbols:download-2" />
|
|
29
|
+
{/snippet}
|
|
30
|
+
</InputEnclosure>
|
|
31
|
+
</Story>
|
|
32
|
+
|
|
33
|
+
<Story name="Small" args={{ size: 'small' }} asChild>
|
|
34
|
+
<InputEnclosure size="small">
|
|
35
|
+
{#snippet before()}
|
|
36
|
+
<Icon icon="material-symbols:content-copy" />
|
|
37
|
+
{/snippet}
|
|
38
|
+
</InputEnclosure>
|
|
39
|
+
</Story>
|
|
40
|
+
|
|
41
|
+
<Story name="Large" args={{ size: 'large' }} asChild>
|
|
42
|
+
<InputEnclosure size="large">
|
|
43
|
+
{#snippet before()}
|
|
44
|
+
<Icon icon="material-symbols:content-copy" />
|
|
45
|
+
{/snippet}
|
|
46
|
+
</InputEnclosure>
|
|
47
|
+
</Story>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
4
|
+
import { Menu, MenuItem, Popper } from '$lib/index.js';
|
|
5
|
+
import Button from '$lib/stories/components/Form/Button/Button.svelte';
|
|
6
|
+
import { positionXArray, positionYArray } from '$lib/types/position.js';
|
|
7
|
+
|
|
8
|
+
export const storyPopperArgTypes: StoryBookArgTypes = {
|
|
9
|
+
popupPositionX: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: positionXArray,
|
|
12
|
+
},
|
|
13
|
+
popupPositionY: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: positionYArray,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
20
|
+
const { Story } = defineMeta({
|
|
21
|
+
component: Popper,
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
argTypes: storyPopperArgTypes,
|
|
24
|
+
parameters: {
|
|
25
|
+
docs: {
|
|
26
|
+
story: {
|
|
27
|
+
height: '200px',
|
|
28
|
+
inline: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
let open = $state(false);
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<Story name="Default" args={{ open, onClickOutside: () => (open = false) }} asChild>
|
|
38
|
+
<Popper {open} onClickOutside={() => (open = false)}>
|
|
39
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
40
|
+
{#snippet popupChildren()}
|
|
41
|
+
<Menu>
|
|
42
|
+
<MenuItem>One</MenuItem>
|
|
43
|
+
<MenuItem>Two</MenuItem>
|
|
44
|
+
<MenuItem>Three</MenuItem>
|
|
45
|
+
</Menu>
|
|
46
|
+
{/snippet}
|
|
47
|
+
</Popper>
|
|
48
|
+
</Story>
|
|
49
|
+
|
|
50
|
+
<Story name="MenuOpen" args={{ open: true }} asChild>
|
|
51
|
+
<Popper open>
|
|
52
|
+
Hello! how are you doing?
|
|
53
|
+
{#snippet popupChildren()}
|
|
54
|
+
<Menu>
|
|
55
|
+
<MenuItem>One</MenuItem>
|
|
56
|
+
<MenuItem>Two</MenuItem>
|
|
57
|
+
<MenuItem>Three</MenuItem>
|
|
58
|
+
</Menu>
|
|
59
|
+
{/snippet}
|
|
60
|
+
</Popper>
|
|
61
|
+
</Story>
|
|
62
|
+
|
|
63
|
+
<Story
|
|
64
|
+
name="CustomPaperProps"
|
|
65
|
+
args={{
|
|
66
|
+
open: true,
|
|
67
|
+
paperProps: {
|
|
68
|
+
color: 'primary',
|
|
69
|
+
},
|
|
70
|
+
}}
|
|
71
|
+
asChild
|
|
72
|
+
>
|
|
73
|
+
<Popper
|
|
74
|
+
open
|
|
75
|
+
paperProps={{
|
|
76
|
+
color: 'primary',
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
Hello! how are you doing?
|
|
80
|
+
{#snippet popupChildren()}
|
|
81
|
+
<Menu>
|
|
82
|
+
<MenuItem>One</MenuItem>
|
|
83
|
+
<MenuItem>Two</MenuItem>
|
|
84
|
+
<MenuItem>Three</MenuItem>
|
|
85
|
+
</Menu>
|
|
86
|
+
{/snippet}
|
|
87
|
+
</Popper>
|
|
88
|
+
</Story>
|
|
89
|
+
|
|
90
|
+
<!-- Expand the Popper to full width -->
|
|
91
|
+
<Story name="FullWidth" asChild>
|
|
92
|
+
<Popper {open} fullWidth onClickOutside={() => (open = false)}>
|
|
93
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
94
|
+
|
|
95
|
+
{#snippet popupChildren()}
|
|
96
|
+
<Menu>
|
|
97
|
+
<MenuItem>One</MenuItem>
|
|
98
|
+
<MenuItem>Two</MenuItem>
|
|
99
|
+
<MenuItem>Three</MenuItem>
|
|
100
|
+
</Menu>
|
|
101
|
+
{/snippet}
|
|
102
|
+
</Popper>
|
|
103
|
+
</Story>
|
|
104
|
+
|
|
105
|
+
<!-- Expand the Popper to full width but not the popup -->
|
|
106
|
+
<Story name="PopupFullWidthFalse" asChild>
|
|
107
|
+
<Popper {open} fullWidth popupFullWidth={false} onClickOutside={() => (open = false)}>
|
|
108
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
109
|
+
|
|
110
|
+
{#snippet popupChildren()}
|
|
111
|
+
<Menu>
|
|
112
|
+
<MenuItem>One</MenuItem>
|
|
113
|
+
<MenuItem>Two</MenuItem>
|
|
114
|
+
<MenuItem>Three</MenuItem>
|
|
115
|
+
</Menu>
|
|
116
|
+
{/snippet}
|
|
117
|
+
</Popper>
|
|
118
|
+
</Story>
|
|
119
|
+
|
|
120
|
+
<Story
|
|
121
|
+
name="CustomPopup"
|
|
122
|
+
args={{
|
|
123
|
+
open,
|
|
124
|
+
onClickOutside: () => (open = false),
|
|
125
|
+
}}
|
|
126
|
+
asChild
|
|
127
|
+
>
|
|
128
|
+
<Popper {open} onClickOutside={() => (open = false)}>
|
|
129
|
+
<Button onclick={() => (open = true)}>Click to see Popup</Button>
|
|
130
|
+
|
|
131
|
+
{#snippet customPopup(popperLocation)}
|
|
132
|
+
{#if open}
|
|
133
|
+
<Menu>
|
|
134
|
+
<MenuItem>{popperLocation?.height}</MenuItem>
|
|
135
|
+
<MenuItem>{popperLocation?.width}</MenuItem>
|
|
136
|
+
</Menu>
|
|
137
|
+
{/if}
|
|
138
|
+
{/snippet}
|
|
139
|
+
</Popper>
|
|
140
|
+
</Story>
|
package/src/lib/stories/developer tools/components/Popper/PopperPopup/PopperPopup.stories.svelte
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import type { StoryBookArgTypes } from '$lib/storybook-types.js';
|
|
4
|
+
import { Menu, MenuItem, PopperPopup } from '$lib/index.js';
|
|
5
|
+
import { positionXArray, positionYArray } from '$lib/types/position.js';
|
|
6
|
+
|
|
7
|
+
export const storyPopperPopupArgTypes: StoryBookArgTypes = {
|
|
8
|
+
popupPositionX: {
|
|
9
|
+
control: { type: 'select' },
|
|
10
|
+
options: positionXArray,
|
|
11
|
+
},
|
|
12
|
+
popupPositionY: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: positionYArray,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
|
|
19
|
+
const { Story } = defineMeta({
|
|
20
|
+
component: PopperPopup,
|
|
21
|
+
tags: ['autodocs'],
|
|
22
|
+
argTypes: storyPopperPopupArgTypes,
|
|
23
|
+
parameters: {
|
|
24
|
+
docs: {
|
|
25
|
+
story: {
|
|
26
|
+
height: '200px',
|
|
27
|
+
inline: false,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<Story name="Default" asChild>
|
|
35
|
+
<PopperPopup>
|
|
36
|
+
<Menu>
|
|
37
|
+
<MenuItem>One</MenuItem>
|
|
38
|
+
<MenuItem>Two</MenuItem>
|
|
39
|
+
<MenuItem>Three</MenuItem>
|
|
40
|
+
</Menu>
|
|
41
|
+
</PopperPopup>
|
|
42
|
+
</Story>
|
|
43
|
+
|
|
44
|
+
<Story
|
|
45
|
+
name="CustomPaperProps"
|
|
46
|
+
args={{
|
|
47
|
+
paperProps: {
|
|
48
|
+
color: 'primary',
|
|
49
|
+
},
|
|
50
|
+
}}
|
|
51
|
+
asChild
|
|
52
|
+
>
|
|
53
|
+
<PopperPopup
|
|
54
|
+
paperProps={{
|
|
55
|
+
color: 'primary',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<Menu>
|
|
59
|
+
<MenuItem>One</MenuItem>
|
|
60
|
+
<MenuItem>Two</MenuItem>
|
|
61
|
+
<MenuItem>Three</MenuItem>
|
|
62
|
+
</Menu>
|
|
63
|
+
</PopperPopup>
|
|
64
|
+
</Story>
|