@momentum-design/components 0.100.1 → 0.101.0
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/browser/index.js +1370 -1142
- package/dist/browser/index.js.map +4 -4
- package/dist/components/accordion/accordion.component.d.ts +76 -0
- package/dist/components/accordion/accordion.component.js +130 -0
- package/dist/components/accordion/accordion.constants.d.ts +2 -0
- package/dist/components/accordion/accordion.constants.js +3 -0
- package/dist/components/accordion/accordion.styles.d.ts +2 -0
- package/dist/components/accordion/accordion.styles.js +17 -0
- package/dist/components/accordion/index.d.ts +10 -0
- package/dist/components/accordion/index.js +7 -0
- package/dist/components/accordionbutton/accordionbutton.component.d.ts +121 -0
- package/dist/components/accordionbutton/accordionbutton.component.js +240 -0
- package/dist/components/accordionbutton/accordionbutton.constants.d.ts +17 -0
- package/dist/components/accordionbutton/accordionbutton.constants.js +19 -0
- package/dist/components/accordionbutton/accordionbutton.styles.d.ts +2 -0
- package/dist/components/accordionbutton/accordionbutton.styles.js +121 -0
- package/dist/components/accordionbutton/accordionbutton.types.d.ts +8 -0
- package/dist/components/accordionbutton/accordionbutton.types.js +1 -0
- package/dist/components/accordionbutton/index.d.ts +10 -0
- package/dist/components/accordionbutton/index.js +7 -0
- package/dist/components/accordiongroup/accordiongroup.component.d.ts +73 -0
- package/dist/components/accordiongroup/accordiongroup.component.js +134 -0
- package/dist/components/accordiongroup/accordiongroup.constants.d.ts +15 -0
- package/dist/components/accordiongroup/accordiongroup.constants.js +16 -0
- package/dist/components/accordiongroup/accordiongroup.styles.d.ts +2 -0
- package/dist/components/accordiongroup/accordiongroup.styles.js +48 -0
- package/dist/components/accordiongroup/accordiongroup.types.d.ts +5 -0
- package/dist/components/accordiongroup/accordiongroup.types.js +1 -0
- package/dist/components/accordiongroup/index.d.ts +7 -0
- package/dist/components/accordiongroup/index.js +4 -0
- package/dist/custom-elements.json +966 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +10 -7
- package/dist/react/accordion/index.d.ts +55 -0
- package/dist/react/accordion/index.js +63 -0
- package/dist/react/accordionbutton/index.d.ts +52 -0
- package/dist/react/accordionbutton/index.js +60 -0
- package/dist/react/accordiongroup/index.d.ts +32 -0
- package/dist/react/accordiongroup/index.js +41 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +3 -0
- package/dist/utils/keys.d.ts +1 -0
- package/dist/utils/keys.js +1 -0
- package/dist/utils/roles.d.ts +2 -0
- package/dist/utils/roles.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
import Accordion from './components/accordion';
|
2
|
+
import AccordionGroup from './components/accordiongroup';
|
3
|
+
import AccordionButton from './components/accordionbutton';
|
1
4
|
import AlertChip from './components/alertchip';
|
2
5
|
import Animation from './components/animation';
|
3
6
|
import Appheader from './components/appheader';
|
@@ -28,6 +31,7 @@ import Link from './components/link';
|
|
28
31
|
import LinkButton from './components/linkbutton';
|
29
32
|
import Linksimple from './components/linksimple';
|
30
33
|
import List from './components/list';
|
34
|
+
import Listheader from './components/listheader';
|
31
35
|
import ListItem from './components/listitem';
|
32
36
|
import Marker from './components/marker';
|
33
37
|
import MenuBar from './components/menubar';
|
@@ -49,27 +53,26 @@ import RadioGroup from './components/radiogroup';
|
|
49
53
|
import ScreenreaderAnnouncer from './components/screenreaderannouncer';
|
50
54
|
import Searchfield from './components/searchfield';
|
51
55
|
import Select from './components/select';
|
56
|
+
import SelectListbox from './components/selectlistbox';
|
52
57
|
import SideNavigation from './components/sidenavigation';
|
53
58
|
import Skeleton from './components/skeleton';
|
54
59
|
import Spinner from './components/spinner';
|
55
60
|
import StaticCheckbox from './components/staticcheckbox';
|
56
61
|
import StaticRadio from './components/staticradio';
|
57
62
|
import StaticToggle from './components/statictoggle';
|
58
|
-
import
|
63
|
+
import Stepper from './components/stepper';
|
64
|
+
import StepperConnector from './components/stepperconnector';
|
65
|
+
import StepperItem from './components/stepperitem';
|
59
66
|
import Tab from './components/tab';
|
60
67
|
import TabList from './components/tablist';
|
61
68
|
import Text from './components/text';
|
62
69
|
import Textarea from './components/textarea';
|
63
70
|
import ThemeProvider from './components/themeprovider';
|
71
|
+
import Toast from './components/toast';
|
64
72
|
import Toggle from './components/toggle';
|
65
73
|
import ToggleTip from './components/toggletip';
|
66
74
|
import Tooltip from './components/tooltip';
|
67
75
|
import VirtualizedList from './components/virtualizedlist';
|
68
|
-
import Listheader from './components/listheader';
|
69
|
-
import SelectListbox from './components/selectlistbox';
|
70
|
-
import StepperItem from './components/stepperitem';
|
71
|
-
import StepperConnector from './components/stepperconnector';
|
72
|
-
import Stepper from './components/stepper';
|
73
76
|
import type { BadgeType } from './components/badge/badge.types';
|
74
77
|
import type { ButtonColor, ButtonVariant, IconButtonSize, PillButtonSize } from './components/button/button.types';
|
75
78
|
import type { PopoverPlacement } from './components/popover/popover.types';
|
@@ -82,6 +85,6 @@ import type { MenuSectionChangeEvent } from './components/menusection/menusectio
|
|
82
85
|
import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES } from './components/button/button.constants';
|
83
86
|
import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
84
87
|
import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
|
85
|
-
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList,
|
88
|
+
export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList, };
|
86
89
|
export type { BadgeType, ButtonColor, ButtonVariant, IconButtonSize, MenuPopoverActionEvent, MenuPopoverChangeEvent, MenuSectionChangeEvent, PillButtonSize, PopoverPlacement, SkeletonVariant, SelectChangeEvent, SelectInputEvent, SpinnerSize, SpinnerVariant, TextType, };
|
87
90
|
export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
|
package/dist/index.js
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
/* eslint-disable import/order */
|
2
2
|
// Components Imports
|
3
|
+
import Accordion from './components/accordion';
|
4
|
+
import AccordionGroup from './components/accordiongroup';
|
5
|
+
import AccordionButton from './components/accordionbutton';
|
3
6
|
import AlertChip from './components/alertchip';
|
4
7
|
import Animation from './components/animation';
|
5
8
|
import Appheader from './components/appheader';
|
@@ -30,6 +33,7 @@ import Link from './components/link';
|
|
30
33
|
import LinkButton from './components/linkbutton';
|
31
34
|
import Linksimple from './components/linksimple';
|
32
35
|
import List from './components/list';
|
36
|
+
import Listheader from './components/listheader';
|
33
37
|
import ListItem from './components/listitem';
|
34
38
|
import Marker from './components/marker';
|
35
39
|
import MenuBar from './components/menubar';
|
@@ -51,32 +55,31 @@ import RadioGroup from './components/radiogroup';
|
|
51
55
|
import ScreenreaderAnnouncer from './components/screenreaderannouncer';
|
52
56
|
import Searchfield from './components/searchfield';
|
53
57
|
import Select from './components/select';
|
58
|
+
import SelectListbox from './components/selectlistbox';
|
54
59
|
import SideNavigation from './components/sidenavigation';
|
55
60
|
import Skeleton from './components/skeleton';
|
56
61
|
import Spinner from './components/spinner';
|
57
62
|
import StaticCheckbox from './components/staticcheckbox';
|
58
63
|
import StaticRadio from './components/staticradio';
|
59
64
|
import StaticToggle from './components/statictoggle';
|
60
|
-
import
|
65
|
+
import Stepper from './components/stepper';
|
66
|
+
import StepperConnector from './components/stepperconnector';
|
67
|
+
import StepperItem from './components/stepperitem';
|
61
68
|
import Tab from './components/tab';
|
62
69
|
import TabList from './components/tablist';
|
63
70
|
import Text from './components/text';
|
64
71
|
import Textarea from './components/textarea';
|
65
72
|
import ThemeProvider from './components/themeprovider';
|
73
|
+
import Toast from './components/toast';
|
66
74
|
import Toggle from './components/toggle';
|
67
75
|
import ToggleTip from './components/toggletip';
|
68
76
|
import Tooltip from './components/tooltip';
|
69
77
|
import VirtualizedList from './components/virtualizedlist';
|
70
|
-
import Listheader from './components/listheader';
|
71
|
-
import SelectListbox from './components/selectlistbox';
|
72
|
-
import StepperItem from './components/stepperitem';
|
73
|
-
import StepperConnector from './components/stepperconnector';
|
74
|
-
import Stepper from './components/stepper';
|
75
78
|
// Constants / Utils Imports
|
76
79
|
import { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, PILL_BUTTON_SIZES, } from './components/button/button.constants';
|
77
80
|
import { SKELETON_VARIANTS } from './components/skeleton/skeleton.constants';
|
78
81
|
import { inMemoryCache, webAPIIconsCache } from './utils/icon-cache';
|
79
82
|
// Components Exports
|
80
|
-
export { AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList,
|
83
|
+
export { Accordion, AccordionButton, AccordionGroup, AlertChip, Animation, Appheader, Avatar, AvatarButton, Badge, Brandvisual, Bullet, Button, ButtonGroup, ButtonLink, Card, CardButton, CardCheckbox, CardRadio, Checkbox, Chip, Coachmark, Dialog, Divider, FilterChip, FormfieldGroup, Icon, IconProvider, Input, InputChip, Link, LinkButton, Linksimple, List, Listheader, ListItem, Marker, MenuBar, MenuItem, MenuItemCheckbox, MenuItemRadio, MenuPopover, MenuSection, NavMenuItem, OptGroup, Option, Password, Popover, Presence, Progressbar, Progressspinner, Radio, RadioGroup, ScreenreaderAnnouncer, Searchfield, Select, SelectListbox, SideNavigation, Skeleton, Spinner, StaticCheckbox, StaticRadio, StaticToggle, Stepper, StepperConnector, StepperItem, Tab, TabList, Text, Textarea, ThemeProvider, Toast, Toggle, ToggleTip, Tooltip, VirtualizedList, };
|
81
84
|
// Constants / Utils Exports
|
82
85
|
export { BUTTON_COLORS, BUTTON_VARIANTS, ICON_BUTTON_SIZES, inMemoryCache, PILL_BUTTON_SIZES, SKELETON_VARIANTS, webAPIIconsCache, };
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { type EventName } from '@lit/react';
|
2
|
+
import Component from '../../components/accordion';
|
3
|
+
/**
|
4
|
+
* An accordion contains a header and body section with a focusable heading that can be expanded or collapsed.
|
5
|
+
*
|
6
|
+
* The header section contains:
|
7
|
+
* - Prefix Icon
|
8
|
+
* - Header Text
|
9
|
+
* - Leading Slot - Contains the leading controls of the accordion on the header section. This will be placed on the leading side, after the header text.
|
10
|
+
* - Trailing Slot - Contains the trailing controls of the accordion on the header section. This will be placed on the trailing side, before the expand/collapse button.
|
11
|
+
*
|
12
|
+
* The body section contains:
|
13
|
+
* - Default slot - User can place any content inside the body section.
|
14
|
+
*
|
15
|
+
* The accordion can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
|
16
|
+
* There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
|
17
|
+
* There are two sizes of accordion, one is small and the other is large.
|
18
|
+
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
19
|
+
*
|
20
|
+
* By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
|
21
|
+
* If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
|
22
|
+
*
|
23
|
+
* An accordion can be disabled, and when it's disabled, the header section will not be clickable.
|
24
|
+
*
|
25
|
+
* If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
|
26
|
+
*
|
27
|
+
* If an accordion is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion.
|
28
|
+
*
|
29
|
+
* @tagname mdc-accordion
|
30
|
+
*
|
31
|
+
* @dependency mdc-button
|
32
|
+
* @dependency mdc-icon
|
33
|
+
* @dependency mdc-text
|
34
|
+
*
|
35
|
+
* @slot leading-controls - The leading controls slot of the accordion on the header section.
|
36
|
+
* @slot trailing-controls - The trailing controls slot of the accordion on the header section.
|
37
|
+
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
38
|
+
*
|
39
|
+
* @event shown - (React: onShown) This event is triggered when the accordion is expanded.
|
40
|
+
*
|
41
|
+
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion.
|
42
|
+
* @cssproperty --mdc-accordionbutton-hover-color - The hover color of the accordion.
|
43
|
+
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion.
|
44
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion.
|
45
|
+
*
|
46
|
+
* @csspart header-section - The header section of the accordion.
|
47
|
+
* @csspart leading-header - The leading header of the accordion.
|
48
|
+
* @csspart trailing-header - The trailing header of the accordion.
|
49
|
+
* @csspart trailing-header__button - The trailing header button of the accordion.
|
50
|
+
* @csspart body-section - The body section of the accordion.
|
51
|
+
*/
|
52
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
53
|
+
onShown: EventName<Event>;
|
54
|
+
}>;
|
55
|
+
export default reactWrapper;
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { createComponent } from '@lit/react';
|
3
|
+
import Component from '../../components/accordion';
|
4
|
+
import { TAG_NAME } from '../../components/accordion/accordion.constants';
|
5
|
+
/**
|
6
|
+
* An accordion contains a header and body section with a focusable heading that can be expanded or collapsed.
|
7
|
+
*
|
8
|
+
* The header section contains:
|
9
|
+
* - Prefix Icon
|
10
|
+
* - Header Text
|
11
|
+
* - Leading Slot - Contains the leading controls of the accordion on the header section. This will be placed on the leading side, after the header text.
|
12
|
+
* - Trailing Slot - Contains the trailing controls of the accordion on the header section. This will be placed on the trailing side, before the expand/collapse button.
|
13
|
+
*
|
14
|
+
* The body section contains:
|
15
|
+
* - Default slot - User can place any content inside the body section.
|
16
|
+
*
|
17
|
+
* The accordion can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
|
18
|
+
* There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
|
19
|
+
* There are two sizes of accordion, one is small and the other is large.
|
20
|
+
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
21
|
+
*
|
22
|
+
* By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
|
23
|
+
* If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
|
24
|
+
*
|
25
|
+
* An accordion can be disabled, and when it's disabled, the header section will not be clickable.
|
26
|
+
*
|
27
|
+
* If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
|
28
|
+
*
|
29
|
+
* If an accordion is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion.
|
30
|
+
*
|
31
|
+
* @tagname mdc-accordion
|
32
|
+
*
|
33
|
+
* @dependency mdc-button
|
34
|
+
* @dependency mdc-icon
|
35
|
+
* @dependency mdc-text
|
36
|
+
*
|
37
|
+
* @slot leading-controls - The leading controls slot of the accordion on the header section.
|
38
|
+
* @slot trailing-controls - The trailing controls slot of the accordion on the header section.
|
39
|
+
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
40
|
+
*
|
41
|
+
* @event shown - (React: onShown) This event is triggered when the accordion is expanded.
|
42
|
+
*
|
43
|
+
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion.
|
44
|
+
* @cssproperty --mdc-accordionbutton-hover-color - The hover color of the accordion.
|
45
|
+
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion.
|
46
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion.
|
47
|
+
*
|
48
|
+
* @csspart header-section - The header section of the accordion.
|
49
|
+
* @csspart leading-header - The leading header of the accordion.
|
50
|
+
* @csspart trailing-header - The trailing header of the accordion.
|
51
|
+
* @csspart trailing-header__button - The trailing header button of the accordion.
|
52
|
+
* @csspart body-section - The body section of the accordion.
|
53
|
+
*/
|
54
|
+
const reactWrapper = createComponent({
|
55
|
+
tagName: TAG_NAME,
|
56
|
+
elementClass: Component,
|
57
|
+
react: React,
|
58
|
+
events: {
|
59
|
+
onShown: 'shown',
|
60
|
+
},
|
61
|
+
displayName: 'Accordion',
|
62
|
+
});
|
63
|
+
export default reactWrapper;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { type EventName } from '@lit/react';
|
2
|
+
import Component from '../../components/accordionbutton';
|
3
|
+
/**
|
4
|
+
* An accordion button contains a header and body section with optional slots inside the heading which are focusable.
|
5
|
+
*
|
6
|
+
* The header section contains:
|
7
|
+
* - Prefix Icon
|
8
|
+
* - Header Text
|
9
|
+
*
|
10
|
+
* The body section contains:
|
11
|
+
* - Default slot - User can place any content inside the body section.
|
12
|
+
*
|
13
|
+
* The accordion button can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
|
14
|
+
* There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
|
15
|
+
* There are two sizes of accordion, one is small and the other is large.
|
16
|
+
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
17
|
+
*
|
18
|
+
* By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
|
19
|
+
* If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
|
20
|
+
*
|
21
|
+
* An accordion can be disabled, and when it's disabled, the header section will not be clickable.
|
22
|
+
*
|
23
|
+
* If you do need any controls on your accordion heading, then it's advised to use `accordion` component.
|
24
|
+
*
|
25
|
+
* If an accordion button is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion button.
|
26
|
+
*
|
27
|
+
* @tagname mdc-accordionbutton
|
28
|
+
*
|
29
|
+
* @dependency mdc-button
|
30
|
+
* @dependency mdc-icon
|
31
|
+
* @dependency mdc-text
|
32
|
+
*
|
33
|
+
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
34
|
+
*
|
35
|
+
* @event shown - (React: onShown) This event is triggered when the accordion button is expanded.
|
36
|
+
*
|
37
|
+
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion button.
|
38
|
+
* @cssproperty --mdc-accordionbutton-hover-color - The hover color of the accordion button.
|
39
|
+
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion button.
|
40
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion button.
|
41
|
+
*
|
42
|
+
* @csspart header-section - The header section of the accordion button.
|
43
|
+
* @csspart header-button-section - The header button section of the accordion button.
|
44
|
+
* @csspart leading-header - The leading header of the accordion button.
|
45
|
+
* @csspart trailing-header - The trailing header of the accordion button.
|
46
|
+
* @csspart trailing-header__icon - The trailing header icon of the accordion button.
|
47
|
+
* @csspart body-section - The body section of the accordion button.
|
48
|
+
*/
|
49
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {
|
50
|
+
onShown: EventName<Event>;
|
51
|
+
}>;
|
52
|
+
export default reactWrapper;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { createComponent } from '@lit/react';
|
3
|
+
import Component from '../../components/accordionbutton';
|
4
|
+
import { TAG_NAME } from '../../components/accordionbutton/accordionbutton.constants';
|
5
|
+
/**
|
6
|
+
* An accordion button contains a header and body section with optional slots inside the heading which are focusable.
|
7
|
+
*
|
8
|
+
* The header section contains:
|
9
|
+
* - Prefix Icon
|
10
|
+
* - Header Text
|
11
|
+
*
|
12
|
+
* The body section contains:
|
13
|
+
* - Default slot - User can place any content inside the body section.
|
14
|
+
*
|
15
|
+
* The accordion button can be expanded or collapsed. The visibility of the body section can be controlled by `expanded` attribute. <br/>
|
16
|
+
* There are two types of variants based on that the border styling of the accordion gets reflected. <br/>
|
17
|
+
* There are two sizes of accordion, one is small and the other is large.
|
18
|
+
* Small size has a padding of 1rem (16px) and large size has a padding of 1.5rem (24px) for the body section of accordion.
|
19
|
+
*
|
20
|
+
* By default, the header text in the accordion heading is of H3 with an aria-level of '3'.
|
21
|
+
* If this accordion is placed on any other level in the entire webpage, then do adjust the aria-level number based on that.
|
22
|
+
*
|
23
|
+
* An accordion can be disabled, and when it's disabled, the header section will not be clickable.
|
24
|
+
*
|
25
|
+
* If you do need any controls on your accordion heading, then it's advised to use `accordion` component.
|
26
|
+
*
|
27
|
+
* If an accordion button is expanded by default, then the screen reader might loose focus when toggling the visibilty of the accordion button.
|
28
|
+
*
|
29
|
+
* @tagname mdc-accordionbutton
|
30
|
+
*
|
31
|
+
* @dependency mdc-button
|
32
|
+
* @dependency mdc-icon
|
33
|
+
* @dependency mdc-text
|
34
|
+
*
|
35
|
+
* @slot default - The default slot contains the body section of the accordion. User can place anything inside this body slot.
|
36
|
+
*
|
37
|
+
* @event shown - (React: onShown) This event is triggered when the accordion button is expanded.
|
38
|
+
*
|
39
|
+
* @cssproperty --mdc-accordionbutton-border-color - The border color of the accordion button.
|
40
|
+
* @cssproperty --mdc-accordionbutton-hover-color - The hover color of the accordion button.
|
41
|
+
* @cssproperty --mdc-accordionbutton-active-color - The active color of the accordion button.
|
42
|
+
* @cssproperty --mdc-accordionbutton-disabled-color - The disabled color of the accordion button.
|
43
|
+
*
|
44
|
+
* @csspart header-section - The header section of the accordion button.
|
45
|
+
* @csspart header-button-section - The header button section of the accordion button.
|
46
|
+
* @csspart leading-header - The leading header of the accordion button.
|
47
|
+
* @csspart trailing-header - The trailing header of the accordion button.
|
48
|
+
* @csspart trailing-header__icon - The trailing header icon of the accordion button.
|
49
|
+
* @csspart body-section - The body section of the accordion button.
|
50
|
+
*/
|
51
|
+
const reactWrapper = createComponent({
|
52
|
+
tagName: TAG_NAME,
|
53
|
+
elementClass: Component,
|
54
|
+
react: React,
|
55
|
+
events: {
|
56
|
+
onShown: 'shown',
|
57
|
+
},
|
58
|
+
displayName: 'AccordionButton',
|
59
|
+
});
|
60
|
+
export default reactWrapper;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import Component from '../../components/accordiongroup';
|
2
|
+
/**
|
3
|
+
* An accordion group is a vertically stacked set of interactive headings that each contain a header and body content.
|
4
|
+
* Each heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.
|
5
|
+
* Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
|
6
|
+
*
|
7
|
+
* - Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.
|
8
|
+
*
|
9
|
+
* There are three types of variants:
|
10
|
+
* - Stacked - Each accordion will have a gap of 1.5rem (24px).
|
11
|
+
* - Borderless - Each accordion will not have any border and the group will also not have any border.
|
12
|
+
* - Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.
|
13
|
+
*
|
14
|
+
* There are two types of sizes:
|
15
|
+
* - Small: Small size has a padding of 1rem (16px) for both heading and body sections.
|
16
|
+
* - Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.
|
17
|
+
*
|
18
|
+
* The variant and size will be applied to all accordions inside this accordion group.
|
19
|
+
* To show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.
|
20
|
+
*
|
21
|
+
* If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
|
22
|
+
*
|
23
|
+
* If the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.
|
24
|
+
*
|
25
|
+
* @tagname mdc-accordiongroup
|
26
|
+
*
|
27
|
+
* @slot default - The default slot can contain the `accordion` or `accordionbutton` components.
|
28
|
+
*
|
29
|
+
* @cssproperty --mdc-accordiongroup-border-color - The border color of the entire accordiongroup
|
30
|
+
*/
|
31
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
32
|
+
export default reactWrapper;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { createComponent } from '@lit/react';
|
3
|
+
import Component from '../../components/accordiongroup';
|
4
|
+
import { TAG_NAME } from '../../components/accordiongroup/accordiongroup.constants';
|
5
|
+
/**
|
6
|
+
* An accordion group is a vertically stacked set of interactive headings that each contain a header and body content.
|
7
|
+
* Each heading of the accordion acts as a control that enable users to expand or hide their associated body sections of content.
|
8
|
+
* Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
|
9
|
+
*
|
10
|
+
* - Default Slot: The accordion group component only accepts, `accordion` and `accordionbutton` components as the children, rest are ignored.
|
11
|
+
*
|
12
|
+
* There are three types of variants:
|
13
|
+
* - Stacked - Each accordion will have a gap of 1.5rem (24px).
|
14
|
+
* - Borderless - Each accordion will not have any border and the group will also not have any border.
|
15
|
+
* - Contained - Each accordion will have no gap in between them and the border of the entire accordiongroup will be continuous.
|
16
|
+
*
|
17
|
+
* There are two types of sizes:
|
18
|
+
* - Small: Small size has a padding of 1rem (16px) for both heading and body sections.
|
19
|
+
* - Large: Large size has a padding of 1.5rem (24px) for both heading and body sections.
|
20
|
+
*
|
21
|
+
* The variant and size will be applied to all accordions inside this accordion group.
|
22
|
+
* To show/expand more than one accordion at any given time, then set `allow-multiple` to `true`. By default, it's `false`.
|
23
|
+
*
|
24
|
+
* If you don't need any controls on your accordion heading, then it's advised to use `accordionbutton` component.
|
25
|
+
*
|
26
|
+
* If the first accordion of the accordion group is expanded by default, then the screen reader might loose focus when toggling the visibilty of the first accordion.
|
27
|
+
*
|
28
|
+
* @tagname mdc-accordiongroup
|
29
|
+
*
|
30
|
+
* @slot default - The default slot can contain the `accordion` or `accordionbutton` components.
|
31
|
+
*
|
32
|
+
* @cssproperty --mdc-accordiongroup-border-color - The border color of the entire accordiongroup
|
33
|
+
*/
|
34
|
+
const reactWrapper = createComponent({
|
35
|
+
tagName: TAG_NAME,
|
36
|
+
elementClass: Component,
|
37
|
+
react: React,
|
38
|
+
events: {},
|
39
|
+
displayName: 'AccordionGroup',
|
40
|
+
});
|
41
|
+
export default reactWrapper;
|
package/dist/react/index.d.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
export { default as Accordion } from './accordion';
|
2
|
+
export { default as AccordionButton } from './accordionbutton';
|
3
|
+
export { default as AccordionGroup } from './accordiongroup';
|
1
4
|
export { default as AlertChip } from './alertchip';
|
2
5
|
export { default as Animation } from './animation';
|
3
6
|
export { default as Appheader } from './appheader';
|
package/dist/react/index.js
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
export { default as Accordion } from './accordion';
|
2
|
+
export { default as AccordionButton } from './accordionbutton';
|
3
|
+
export { default as AccordionGroup } from './accordiongroup';
|
1
4
|
export { default as AlertChip } from './alertchip';
|
2
5
|
export { default as Animation } from './animation';
|
3
6
|
export { default as Appheader } from './appheader';
|
package/dist/utils/keys.d.ts
CHANGED
package/dist/utils/keys.js
CHANGED
package/dist/utils/roles.d.ts
CHANGED
@@ -6,6 +6,7 @@ declare const ROLE: {
|
|
6
6
|
readonly COMBOBOX: "combobox";
|
7
7
|
readonly DIALOG: "dialog";
|
8
8
|
readonly GROUP: "group";
|
9
|
+
readonly HEADING: "heading";
|
9
10
|
readonly IMG: "img";
|
10
11
|
readonly LIST: "list";
|
11
12
|
readonly LISTBOX: "listbox";
|
@@ -20,6 +21,7 @@ declare const ROLE: {
|
|
20
21
|
readonly PROGRESSBAR: "progressbar";
|
21
22
|
readonly RADIO: "radio";
|
22
23
|
readonly RADIOGROUP: "radiogroup";
|
24
|
+
readonly REGION: "region";
|
23
25
|
readonly TAB: "tab";
|
24
26
|
readonly TABLIST: "tablist";
|
25
27
|
readonly TOOLTIP: "tooltip";
|
package/dist/utils/roles.js
CHANGED
@@ -6,6 +6,7 @@ const ROLE = {
|
|
6
6
|
COMBOBOX: 'combobox',
|
7
7
|
DIALOG: 'dialog',
|
8
8
|
GROUP: 'group',
|
9
|
+
HEADING: 'heading',
|
9
10
|
IMG: 'img',
|
10
11
|
LIST: 'list',
|
11
12
|
LISTBOX: 'listbox',
|
@@ -20,6 +21,7 @@ const ROLE = {
|
|
20
21
|
PROGRESSBAR: 'progressbar',
|
21
22
|
RADIO: 'radio',
|
22
23
|
RADIOGROUP: 'radiogroup',
|
24
|
+
REGION: 'region',
|
23
25
|
TAB: 'tab',
|
24
26
|
TABLIST: 'tablist',
|
25
27
|
TOOLTIP: 'tooltip',
|