@elliemae/ds-accordion 3.0.0-next.1 → 3.0.0-next.13

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.
Files changed (96) hide show
  1. package/dist/cjs/DSAccordion.js +52 -0
  2. package/dist/cjs/DSAccordion.js.map +7 -0
  3. package/dist/cjs/DSAccordionCTX.js +46 -0
  4. package/dist/cjs/DSAccordionCTX.js.map +7 -0
  5. package/dist/cjs/DSAccordionDatatestid.js +42 -0
  6. package/dist/cjs/DSAccordionDatatestid.js.map +7 -0
  7. package/dist/cjs/DSAccordionTypes.js +27 -0
  8. package/dist/cjs/DSAccordionTypes.js.map +7 -0
  9. package/dist/cjs/config/useAccordion.js +73 -0
  10. package/dist/cjs/config/useAccordion.js.map +7 -0
  11. package/dist/cjs/config/useAccordionRefs.js +47 -0
  12. package/dist/cjs/config/useAccordionRefs.js.map +7 -0
  13. package/dist/cjs/defaultProps.js +64 -0
  14. package/dist/cjs/defaultProps.js.map +7 -0
  15. package/dist/cjs/index.js +37 -0
  16. package/dist/cjs/index.js.map +7 -0
  17. package/dist/cjs/parts/accordionContent/AccordionContent.js +66 -0
  18. package/dist/cjs/parts/accordionContent/AccordionContent.js.map +7 -0
  19. package/dist/cjs/parts/accordionItem/DSAccordionItem.js +210 -0
  20. package/dist/cjs/parts/accordionItem/DSAccordionItem.js.map +7 -0
  21. package/dist/cjs/parts/accordionItem/styles.js +143 -0
  22. package/dist/cjs/parts/accordionItem/styles.js.map +7 -0
  23. package/dist/cjs/parts/accordionItem/useAccordionItem.js +66 -0
  24. package/dist/cjs/parts/accordionItem/useAccordionItem.js.map +7 -0
  25. package/dist/cjs/propTypes.js +57 -0
  26. package/dist/cjs/propTypes.js.map +7 -0
  27. package/dist/esm/DSAccordion.js +23 -0
  28. package/dist/esm/DSAccordion.js.map +7 -0
  29. package/dist/esm/DSAccordionCTX.js +17 -0
  30. package/dist/esm/DSAccordionCTX.js.map +7 -0
  31. package/dist/esm/DSAccordionDatatestid.js +13 -0
  32. package/dist/esm/DSAccordionDatatestid.js.map +7 -0
  33. package/dist/esm/DSAccordionTypes.js +2 -0
  34. package/dist/esm/DSAccordionTypes.js.map +7 -0
  35. package/dist/esm/config/useAccordion.js +44 -0
  36. package/dist/esm/config/useAccordion.js.map +7 -0
  37. package/dist/esm/config/useAccordionRefs.js +18 -0
  38. package/dist/esm/config/useAccordionRefs.js.map +7 -0
  39. package/dist/esm/defaultProps.js +35 -0
  40. package/dist/esm/defaultProps.js.map +7 -0
  41. package/dist/esm/index.js +8 -0
  42. package/dist/esm/index.js.map +7 -0
  43. package/dist/esm/parts/accordionContent/AccordionContent.js +39 -0
  44. package/dist/esm/parts/accordionContent/AccordionContent.js.map +7 -0
  45. package/dist/esm/parts/accordionItem/DSAccordionItem.js +193 -0
  46. package/dist/esm/parts/accordionItem/DSAccordionItem.js.map +7 -0
  47. package/dist/esm/parts/accordionItem/styles.js +114 -0
  48. package/dist/esm/parts/accordionItem/styles.js.map +7 -0
  49. package/dist/esm/parts/accordionItem/useAccordionItem.js +37 -0
  50. package/dist/esm/parts/accordionItem/useAccordionItem.js.map +7 -0
  51. package/dist/esm/propTypes.js +28 -0
  52. package/dist/esm/propTypes.js.map +7 -0
  53. package/package.json +58 -50
  54. package/cjs/DSAccordion.js +0 -31
  55. package/cjs/DSAccordionCTX.js +0 -20
  56. package/cjs/DSAccordionDatatestid.js +0 -14
  57. package/cjs/DSAccordionTypes.js +0 -2
  58. package/cjs/config/useAccordion.js +0 -50
  59. package/cjs/config/useAccordionRefs.js +0 -40
  60. package/cjs/defaultProps.js +0 -54
  61. package/cjs/index.js +0 -14
  62. package/cjs/parts/accordionContent/AccordionContent.js +0 -41
  63. package/cjs/parts/accordionItem/DSAccordionItem.js +0 -206
  64. package/cjs/parts/accordionItem/styles.js +0 -133
  65. package/cjs/parts/accordionItem/useAccordionItem.js +0 -53
  66. package/cjs/parts/accordionItem/useIsShowingEllipsis.js +0 -37
  67. package/cjs/propTypes.js +0 -26
  68. package/esm/DSAccordion.js +0 -21
  69. package/esm/DSAccordionCTX.js +0 -16
  70. package/esm/DSAccordionDatatestid.js +0 -10
  71. package/esm/DSAccordionTypes.js +0 -1
  72. package/esm/config/useAccordion.js +0 -46
  73. package/esm/config/useAccordionRefs.js +0 -32
  74. package/esm/defaultProps.js +0 -45
  75. package/esm/index.js +0 -2
  76. package/esm/parts/accordionContent/AccordionContent.js +0 -32
  77. package/esm/parts/accordionItem/DSAccordionItem.js +0 -193
  78. package/esm/parts/accordionItem/styles.js +0 -117
  79. package/esm/parts/accordionItem/useAccordionItem.js +0 -49
  80. package/esm/parts/accordionItem/useIsShowingEllipsis.js +0 -33
  81. package/esm/propTypes.js +0 -21
  82. package/types/DSAccordion.d.ts +0 -45
  83. package/types/DSAccordionCTX.d.ts +0 -3
  84. package/types/DSAccordionDatatestid.d.ts +0 -8
  85. package/types/DSAccordionTypes.d.ts +0 -134
  86. package/types/config/useAccordion.d.ts +0 -2
  87. package/types/config/useAccordionRefs.d.ts +0 -2
  88. package/types/defaultProps.d.ts +0 -3
  89. package/types/index.d.ts +0 -4
  90. package/types/parts/accordionContent/AccordionContent.d.ts +0 -2
  91. package/types/parts/accordionItem/DSAccordionItem.d.ts +0 -53
  92. package/types/parts/accordionItem/styles.d.ts +0 -10
  93. package/types/parts/accordionItem/useAccordionItem.d.ts +0 -2
  94. package/types/parts/accordionItem/useIsShowingEllipsis.d.ts +0 -5
  95. package/types/propTypes.d.ts +0 -73
  96. package/types/tests/Accordion.test.d.ts +0 -1
@@ -1,117 +0,0 @@
1
- import styled from 'styled-components';
2
-
3
- const StyledItemContainer = /*#__PURE__*/styled.div.withConfig({
4
- componentId: "sc-fnpjby-0"
5
- })(["display:grid;grid-template-rows:auto auto;border-bottom:1px solid ", ";align-items:center;"], _ref => {
6
- let {
7
- theme
8
- } = _ref;
9
- return theme.colors.neutral[200];
10
- });
11
- const StyledItemHeader = /*#__PURE__*/styled.button.withConfig({
12
- componentId: "sc-fnpjby-1"
13
- })(["display:grid;height:", ";grid-template-columns:", ";width:100%;align-items:center;border:none;outline:none;background:none;&:hover{cursor:", ";}padding:", ";", " &:focus{&:after{position:absolute;content:'';left:0;top:0;width:100%;height:100%;border-radius:2px;border:2px solid ", ";pointer-events:none;}}"], _ref2 => {
14
- let {
15
- withSecondaryTitle
16
- } = _ref2;
17
- return withSecondaryTitle ? '48px' : '32px';
18
- }, _ref3 => {
19
- let {
20
- withCustomActions,
21
- isDSMobile
22
- } = _ref3;
23
- return withCustomActions ? '32px auto' : "".concat(isDSMobile ? "auto 32px" : "32px auto");
24
- }, _ref4 => {
25
- let {
26
- disabled
27
- } = _ref4;
28
- return disabled ? 'not-allowed' : 'pointer';
29
- }, _ref5 => {
30
- let {
31
- isDSMobile
32
- } = _ref5;
33
- return isDSMobile ? "0 16px" : "0";
34
- }, _ref6 => {
35
- let {
36
- isDSMobile
37
- } = _ref6;
38
- return isDSMobile ? "grid-template-areas: 'title addon';" : "";
39
- }, _ref7 => {
40
- let {
41
- theme
42
- } = _ref7;
43
- return theme.colors.brand[700];
44
- });
45
- const StyledItemContent = /*#__PURE__*/styled.div.withConfig({
46
- componentId: "sc-fnpjby-2"
47
- })(["margin:", ";grid-column:1/2;"], _ref8 => {
48
- let {
49
- isDSMobile
50
- } = _ref8;
51
- return isDSMobile ? "16px 16px 24px 16px" : "16px 16px 16px 32px";
52
- });
53
- const StyledItemAddon = /*#__PURE__*/styled.div.withConfig({
54
- componentId: "sc-fnpjby-3"
55
- })(["", " height:100%;display:grid;place-items:center;& .em-ds-icon svg{fill:", ";}"], _ref9 => {
56
- let {
57
- isDSMobile
58
- } = _ref9;
59
- return !isDSMobile ? " padding: 0 8px;\n \n" : "\n grid-area: addon;\n ";
60
- }, _ref10 => {
61
- let {
62
- disabled,
63
- theme
64
- } = _ref10;
65
- return disabled ? theme.colors.neutral[200] : theme.colors.brand[800];
66
- });
67
- const StyledItemTitles = /*#__PURE__*/styled.div.withConfig({
68
- componentId: "sc-fnpjby-4"
69
- })(["display:grid;grid-template-columns:100%;align-content:center;", ""], _ref11 => {
70
- let {
71
- isDSMobile
72
- } = _ref11;
73
- return isDSMobile ? "grid-area: title;" : "";
74
- });
75
- const StyledPrimaryTitle = /*#__PURE__*/styled.div.withConfig({
76
- componentId: "sc-fnpjby-5"
77
- })(["margin:0;font-size:16px;color:", ";font-weight:", ";text-overflow:ellipsis;overflow:hidden;height:16px;width:100%;text-align:left;display:block;white-space:nowrap;"], _ref12 => {
78
- let {
79
- disabled,
80
- theme
81
- } = _ref12;
82
- return disabled ? theme.colors.neutral[200] : theme.colors.neutral[700];
83
- }, _ref13 => {
84
- let {
85
- theme,
86
- isDSMobile
87
- } = _ref13;
88
- return isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular;
89
- });
90
- const StyledSecondaryTitle = /*#__PURE__*/styled.span.withConfig({
91
- componentId: "sc-fnpjby-6"
92
- })(["margin:0;font-size:", ";text-align:left;color:", ";text-overflow:ellipsis;overflow:hidden;height:16px;width:100%;text-align:left;display:block;white-space:nowrap;"], _ref14 => {
93
- let {
94
- theme
95
- } = _ref14;
96
- return theme.fontSizes.label[200];
97
- }, _ref15 => {
98
- let {
99
- disabled,
100
- theme
101
- } = _ref15;
102
- return disabled ? theme.colors.neutral[200] : theme.colors.neutral[500];
103
- });
104
- const StyledItemCustomActions = /*#__PURE__*/styled.div.withConfig({
105
- componentId: "sc-fnpjby-7"
106
- })(["display:grid;grid-auto-flow:column;grid-gap:8px;margin:0 16px;justify-content:flex-end;"]);
107
- const StyledItemHeaderContainer = /*#__PURE__*/styled.div.withConfig({
108
- componentId: "sc-fnpjby-8"
109
- })(["display:grid;grid-template-columns:auto max-content;place-items:center;position:relative;&:hover{", ";}"], _ref16 => {
110
- let {
111
- disabled,
112
- theme
113
- } = _ref16;
114
- return !disabled ? "background: ".concat(theme.colors.brand[200]) : "";
115
- });
116
-
117
- export { StyledItemAddon, StyledItemContainer, StyledItemContent, StyledItemCustomActions, StyledItemHeader, StyledItemHeaderContainer, StyledItemTitles, StyledPrimaryTitle, StyledSecondaryTitle };
@@ -1,49 +0,0 @@
1
- import 'core-js/modules/esnext.async-iterator.some.js';
2
- import 'core-js/modules/esnext.iterator.constructor.js';
3
- import 'core-js/modules/esnext.iterator.some.js';
4
- import { useContext, useMemo, useCallback } from 'react';
5
- import { DSAccordionContext } from '../../DSAccordionCTX.js';
6
-
7
- const useAccordionItem = _ref => {
8
- let {
9
- value,
10
- disabled
11
- } = _ref;
12
- const {
13
- actualActiveValue,
14
- setActiveValues,
15
- focusableChildrenReferences
16
- } = useContext(DSAccordionContext);
17
- const selected = useMemo(() => {
18
- if (Array.isArray(actualActiveValue)) {
19
- return actualActiveValue.some(currentValue => currentValue === value);
20
- }
21
-
22
- return value === actualActiveValue;
23
- }, [actualActiveValue, value]);
24
- const handleOnClick = useCallback(e => {
25
- if (!disabled) setActiveValues(value, e);
26
- }, [disabled, setActiveValues, value]);
27
- const handleOnKeyDown = useCallback((e, _dsIndex) => {
28
- if (!disabled && e.key === 'ArrowDown') {
29
- var _focusableChildrenRef, _focusableChildrenRef2, _focusableChildrenRef3, _focusableChildrenRef4, _focusableChildrenRef5;
30
-
31
- const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
32
- if ((_focusableChildrenRef = focusableChildrenReferences[currentIndex + 1]) !== null && _focusableChildrenRef !== void 0 && (_focusableChildrenRef2 = _focusableChildrenRef.ref) !== null && _focusableChildrenRef2 !== void 0 && _focusableChildrenRef2.current) (_focusableChildrenRef3 = focusableChildrenReferences[currentIndex + 1]) === null || _focusableChildrenRef3 === void 0 ? void 0 : (_focusableChildrenRef4 = _focusableChildrenRef3.ref) === null || _focusableChildrenRef4 === void 0 ? void 0 : (_focusableChildrenRef5 = _focusableChildrenRef4.current) === null || _focusableChildrenRef5 === void 0 ? void 0 : _focusableChildrenRef5.focus();
33
- }
34
-
35
- if (!disabled && e.key === 'ArrowUp') {
36
- var _focusableChildrenRef6, _focusableChildrenRef7, _focusableChildrenRef8, _focusableChildrenRef9, _focusableChildrenRef10;
37
-
38
- const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
39
- if ((_focusableChildrenRef6 = focusableChildrenReferences[currentIndex - 1]) !== null && _focusableChildrenRef6 !== void 0 && (_focusableChildrenRef7 = _focusableChildrenRef6.ref) !== null && _focusableChildrenRef7 !== void 0 && _focusableChildrenRef7.current) (_focusableChildrenRef8 = focusableChildrenReferences[currentIndex - 1]) === null || _focusableChildrenRef8 === void 0 ? void 0 : (_focusableChildrenRef9 = _focusableChildrenRef8.ref) === null || _focusableChildrenRef9 === void 0 ? void 0 : (_focusableChildrenRef10 = _focusableChildrenRef9.current) === null || _focusableChildrenRef10 === void 0 ? void 0 : _focusableChildrenRef10.focus();
40
- }
41
- }, [disabled, focusableChildrenReferences]);
42
- return {
43
- handleOnClick,
44
- handleOnKeyDown,
45
- selected
46
- };
47
- };
48
-
49
- export { useAccordionItem };
@@ -1,33 +0,0 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
- import { useState, useMemo, useEffect } from 'react';
3
-
4
- const useIsShowingEllipsis = () => {
5
- const [element, setElement] = useState();
6
- const [isShowingEllipsis, setIsShowingEllipsis] = useState(false); // const isShowingEllipsis = element?.scrollWidth > primaryTitleWrapperEl?.clientWidth;
7
-
8
- const resizeObserver = useMemo(() => new ResizeObserver(entries => {
9
- if (entries.length) {
10
- const [textWrapperEntry] = entries;
11
- const el = textWrapperEntry.target;
12
- setIsShowingEllipsis((el === null || el === void 0 ? void 0 : el.scrollWidth) > (el === null || el === void 0 ? void 0 : el.clientWidth));
13
- }
14
- }), []);
15
- useEffect(() => {
16
- if (element) {
17
- setIsShowingEllipsis((element === null || element === void 0 ? void 0 : element.scrollWidth) > (element === null || element === void 0 ? void 0 : element.clientWidth));
18
- resizeObserver.observe(element);
19
- }
20
-
21
- return () => {
22
- if (element) {
23
- resizeObserver.unobserve(element);
24
- }
25
- };
26
- }, [resizeObserver, element]);
27
- return {
28
- setElement,
29
- isShowingEllipsis
30
- };
31
- };
32
-
33
- export { useIsShowingEllipsis };
package/esm/propTypes.js DELETED
@@ -1,21 +0,0 @@
1
- import { PropTypes } from 'react-desc';
2
-
3
- const accordionItemPropTypes = {
4
- children: PropTypes.node.description('Dimsum AccordionItem content.').isRequired,
5
- title: PropTypes.string.description('Set a primary title.'),
6
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Dimsum AccordionItem value, this value should be unique.').isRequired,
7
- iconClosed: PropTypes.node.description('Custom Dimsum Icon when it is closed.'),
8
- iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.'),
9
- secondaryTitle: PropTypes.string.description('Set a secondary title'),
10
- customActions: PropTypes.arrayOf(PropTypes.object).description('Set Dimsum AccordionItem custom actions.'),
11
- renderCustomActions: PropTypes.func.description('This property will render any JSX in the custom actions area. You can access to all references and active values within the props.')
12
- };
13
- const accordionPropTypes = {
14
- containerProps: PropTypes.object.description('Adds props to the container.'),
15
- activeValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), PropTypes.string, PropTypes.number]).description('Selected active value. This property makes the component a controlled one.'),
16
- children: PropTypes.node.description('Dimsum AccordionItems to show.'),
17
- allowMultipleOpen: PropTypes.bool.description('Allows multiple Dimsum AccordionItems to be open at the same time.'),
18
- onChange: PropTypes.func.description('Callback function once the Dimsum Accordion changes.')
19
- };
20
-
21
- export { accordionItemPropTypes, accordionPropTypes };
@@ -1,45 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- import type { DSAccordionPropsT } from './DSAccordionTypes';
4
- declare const DSAccordion: {
5
- (props: DSAccordionPropsT): JSX.Element;
6
- propTypes: {
7
- containerProps: {
8
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
9
- deprecated: import("react-desc").PropTypesDescValidator;
10
- };
11
- isRequired: import("react-desc").PropTypesDescValue;
12
- };
13
- activeValue: {
14
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
15
- deprecated: import("react-desc").PropTypesDescValidator;
16
- };
17
- isRequired: import("react-desc").PropTypesDescValue;
18
- };
19
- children: {
20
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
21
- deprecated: import("react-desc").PropTypesDescValidator;
22
- };
23
- isRequired: import("react-desc").PropTypesDescValue;
24
- };
25
- allowMultipleOpen: {
26
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
- deprecated: import("react-desc").PropTypesDescValidator;
28
- };
29
- isRequired: import("react-desc").PropTypesDescValue;
30
- };
31
- onChange: {
32
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
33
- deprecated: import("react-desc").PropTypesDescValidator;
34
- };
35
- isRequired: import("react-desc").PropTypesDescValue;
36
- };
37
- };
38
- };
39
- declare const DSAccordionWithSchema: {
40
- (props?: DSAccordionPropsT | undefined): JSX.Element;
41
- propTypes: unknown;
42
- toTypescript: () => import("react-desc").TypescriptSchema;
43
- };
44
- export { DSAccordion, DSAccordionWithSchema };
45
- export default DSAccordion;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import type { DSAccordionContextT } from './DSAccordionTypes';
3
- export declare const DSAccordionContext: import("react").Context<DSAccordionContextT>;
@@ -1,8 +0,0 @@
1
- export declare const DSAccordionDataTestid: {
2
- ITEM: {
3
- CONTENT: string;
4
- HEADER: string;
5
- CONTAINER: string;
6
- };
7
- GROUP: string;
8
- };
@@ -1,134 +0,0 @@
1
- import React from 'react';
2
- export declare type InternalActiveValueT = (string | number)[] | string | number | null | undefined;
3
- export interface DefaultIconPropsT {
4
- isDSMobile: boolean;
5
- }
6
- export interface CustomActionsT {
7
- onClick: (e: React.MouseEvent) => void;
8
- id: string;
9
- }
10
- export interface FocusableChildrenReferences {
11
- index: number;
12
- value: string | number;
13
- ref: React.MutableRefObject<HTMLButtonElement | null>;
14
- }
15
- export interface AllChildrenReferences {
16
- [index: string]: React.MutableRefObject<HTMLButtonElement | null>;
17
- }
18
- export interface DSAccordionPropsT {
19
- containerProps?: Record<string, unknown>;
20
- activeValue?: (string | number)[] | string | number | null;
21
- children?: React.ReactElement<DSAccordionItemPropsT>[];
22
- allowMultipleOpen?: boolean;
23
- contentExpandable?: boolean;
24
- onChange?: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;
25
- disabled?: boolean;
26
- isDSMobile?: boolean;
27
- }
28
- export interface DSAccordionDefaultPropsT {
29
- containerProps: Record<string, unknown>;
30
- allowMultipleOpen: boolean;
31
- contentExpandable: boolean;
32
- onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;
33
- children: React.ReactElement<DSAccordionItemPropsT>[];
34
- isDSMobile: boolean;
35
- }
36
- export interface DSAccordionPropsWithDefaultsT {
37
- containerProps: Record<string, unknown>;
38
- activeValue?: (string | number)[] | string | number | null;
39
- children: React.ReactElement<DSAccordionItemPropsT>[];
40
- allowMultipleOpen: boolean;
41
- contentExpandable: boolean;
42
- onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;
43
- isDSMobile: boolean;
44
- }
45
- export interface DSAccordionItemPropsT {
46
- title?: string;
47
- value: string | number;
48
- iconClosed?: React.FunctionComponent<DefaultIconPropsT>;
49
- iconOpened?: React.FunctionComponent<DefaultIconPropsT>;
50
- children?: React.ReactNode;
51
- secondaryTitle?: string;
52
- customActions?: CustomActionsT[];
53
- disabled?: boolean;
54
- dsIndex: number;
55
- renderCustomActions?: (props: {
56
- allRefs: AllChildrenReferences;
57
- actualActiveValue: InternalActiveValueT;
58
- }) => JSX.Element;
59
- }
60
- export interface DSAccordionItemDefaultPropsT {
61
- iconClosed: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>>;
62
- iconOpened: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>>;
63
- title: string;
64
- customActions: CustomActionsT[];
65
- disabled: boolean;
66
- }
67
- export interface DSAccordionItemPropsWithDefaultsT {
68
- title: string;
69
- value: string | number;
70
- iconClosed: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>> | React.FunctionComponent<DefaultIconPropsT>;
71
- iconOpened: React.MemoExoticComponent<React.FunctionComponent<DefaultIconPropsT>> | React.FunctionComponent<DefaultIconPropsT>;
72
- children?: React.ReactNode;
73
- secondaryTitle?: string;
74
- customActions: CustomActionsT[];
75
- disabled: boolean;
76
- dsIndex: number;
77
- renderCustomActions?: (props: {
78
- allRefs: AllChildrenReferences;
79
- actualActiveValue: InternalActiveValueT;
80
- }) => JSX.Element;
81
- }
82
- export interface DSAccordionContextT {
83
- props: DSAccordionPropsWithDefaultsT;
84
- actualActiveValue: InternalActiveValueT;
85
- setActiveValues: (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => void;
86
- focusableChildrenReferences: FocusableChildrenReferences[];
87
- allChildrenReferences: AllChildrenReferences;
88
- }
89
- export interface DSAccordionUseAccordionContextT {
90
- props: DSAccordionPropsWithDefaultsT;
91
- actualActiveValue: InternalActiveValueT;
92
- setActiveValues: (value: string | number, e: React.MouseEvent | React.KeyboardEvent) => void;
93
- focusableChildrenReferences: FocusableChildrenReferences[];
94
- allChildrenReferences: AllChildrenReferences;
95
- }
96
- export interface UseAccordionPropsT {
97
- value: string | number;
98
- disabled: boolean;
99
- }
100
- export interface UseAccordionItemReturnTypeT {
101
- handleOnClick: (e: React.MouseEvent) => void;
102
- handleOnKeyDown: (e: React.KeyboardEvent, dsIndex: number) => void;
103
- selected: boolean;
104
- }
105
- export interface UseAccordionRefsPropsT {
106
- children: React.ReactElement<DSAccordionItemPropsT>[];
107
- }
108
- export interface UseAccordionRefsReturnTypeT {
109
- focusableChildrenReferences: FocusableChildrenReferences[];
110
- allChildrenReferences: AllChildrenReferences;
111
- }
112
- export interface StyledItemHeaderPropsT {
113
- withCustomActions: boolean;
114
- withSecondaryTitle?: string;
115
- isDSMobile: boolean;
116
- }
117
- export interface StyledItemTitlesPropsT {
118
- withSecondaryTitle?: string;
119
- isDSMobile: boolean;
120
- }
121
- export interface StyledPrimaryTitlePropsT {
122
- disabled: boolean;
123
- isDSMobile: boolean;
124
- }
125
- export interface StyledItemContentPropsT {
126
- isDSMobile: boolean;
127
- }
128
- export interface StyledSecondaryTitlePropsT {
129
- disabled: boolean;
130
- }
131
- export interface StyledItemAddonPropsT {
132
- disabled: boolean;
133
- isDSMobile: boolean;
134
- }
@@ -1,2 +0,0 @@
1
- import type { DSAccordionPropsT, DSAccordionUseAccordionContextT } from '../DSAccordionTypes';
2
- export declare const useAccordion: (props: DSAccordionPropsT) => DSAccordionUseAccordionContextT;
@@ -1,2 +0,0 @@
1
- import type { UseAccordionRefsPropsT, UseAccordionRefsReturnTypeT } from '../DSAccordionTypes';
2
- export declare const useAccordionRefs: ({ children }: UseAccordionRefsPropsT) => UseAccordionRefsReturnTypeT;
@@ -1,3 +0,0 @@
1
- import type { DSAccordionDefaultPropsT, DSAccordionItemDefaultPropsT } from './DSAccordionTypes';
2
- export declare const defaultProps: DSAccordionDefaultPropsT;
3
- export declare const accordionItemDefaultProps: DSAccordionItemDefaultPropsT;
package/types/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './DSAccordion';
2
- export * from './parts/accordionItem/DSAccordionItem';
3
- export type { DSAccordionPropsT, DSAccordionItemPropsT } from './DSAccordionTypes';
4
- export { default } from './DSAccordion';
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const AccordionContent: () => JSX.Element;
@@ -1,53 +0,0 @@
1
- /// <reference path="../../../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- import type { DSAccordionItemPropsT } from '../../DSAccordionTypes';
4
- declare const DSAccordionItem: {
5
- (props: DSAccordionItemPropsT): JSX.Element;
6
- propTypes: {
7
- children: import("react-desc").PropTypesDescValue;
8
- title: {
9
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
10
- deprecated: import("react-desc").PropTypesDescValidator;
11
- };
12
- isRequired: import("react-desc").PropTypesDescValue;
13
- };
14
- value: import("react-desc").PropTypesDescValue;
15
- iconClosed: {
16
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
17
- deprecated: import("react-desc").PropTypesDescValidator;
18
- };
19
- isRequired: import("react-desc").PropTypesDescValue;
20
- };
21
- iconOpened: {
22
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
23
- deprecated: import("react-desc").PropTypesDescValidator;
24
- };
25
- isRequired: import("react-desc").PropTypesDescValue;
26
- };
27
- secondaryTitle: {
28
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
29
- deprecated: import("react-desc").PropTypesDescValidator;
30
- };
31
- isRequired: import("react-desc").PropTypesDescValue;
32
- };
33
- customActions: {
34
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
35
- deprecated: import("react-desc").PropTypesDescValidator;
36
- };
37
- isRequired: import("react-desc").PropTypesDescValue;
38
- };
39
- renderCustomActions: {
40
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
41
- deprecated: import("react-desc").PropTypesDescValidator;
42
- };
43
- isRequired: import("react-desc").PropTypesDescValue;
44
- };
45
- };
46
- };
47
- declare const DSAccordionItemWithSchema: {
48
- (props?: DSAccordionItemPropsT | undefined): JSX.Element;
49
- propTypes: unknown;
50
- toTypescript: () => import("react-desc").TypescriptSchema;
51
- };
52
- export { DSAccordionItem, DSAccordionItemWithSchema };
53
- export default DSAccordionItem;
@@ -1,10 +0,0 @@
1
- import type { StyledItemAddonPropsT, StyledItemHeaderPropsT, StyledItemTitlesPropsT, StyledPrimaryTitlePropsT, StyledSecondaryTitlePropsT, StyledItemContentPropsT } from '../../DSAccordionTypes';
2
- export declare const StyledItemContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
- export declare const StyledItemHeader: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, StyledItemHeaderPropsT, never>;
4
- export declare const StyledItemContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemContentPropsT, never>;
5
- export declare const StyledItemAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemAddonPropsT, never>;
6
- export declare const StyledItemTitles: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledItemTitlesPropsT, never>;
7
- export declare const StyledPrimaryTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledPrimaryTitlePropsT, never>;
8
- export declare const StyledSecondaryTitle: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, StyledSecondaryTitlePropsT, never>;
9
- export declare const StyledItemCustomActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
10
- export declare const StyledItemHeaderContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,2 +0,0 @@
1
- import type { UseAccordionPropsT, UseAccordionItemReturnTypeT } from '../../DSAccordionTypes';
2
- export declare const useAccordionItem: ({ value, disabled }: UseAccordionPropsT) => UseAccordionItemReturnTypeT;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const useIsShowingEllipsis: () => {
3
- setElement: React.Dispatch<React.SetStateAction<HTMLSpanElement | undefined>>;
4
- isShowingEllipsis: boolean;
5
- };
@@ -1,73 +0,0 @@
1
- /// <reference path="../../../../shared/typings/react-desc.d.ts" />
2
- export declare const accordionItemPropTypes: {
3
- children: import("react-desc").PropTypesDescValue;
4
- title: {
5
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
6
- deprecated: import("react-desc").PropTypesDescValidator;
7
- };
8
- isRequired: import("react-desc").PropTypesDescValue;
9
- };
10
- value: import("react-desc").PropTypesDescValue;
11
- iconClosed: {
12
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
13
- deprecated: import("react-desc").PropTypesDescValidator;
14
- };
15
- isRequired: import("react-desc").PropTypesDescValue;
16
- };
17
- iconOpened: {
18
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
19
- deprecated: import("react-desc").PropTypesDescValidator;
20
- };
21
- isRequired: import("react-desc").PropTypesDescValue;
22
- };
23
- secondaryTitle: {
24
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
25
- deprecated: import("react-desc").PropTypesDescValidator;
26
- };
27
- isRequired: import("react-desc").PropTypesDescValue;
28
- };
29
- customActions: {
30
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
31
- deprecated: import("react-desc").PropTypesDescValidator;
32
- };
33
- isRequired: import("react-desc").PropTypesDescValue;
34
- };
35
- renderCustomActions: {
36
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
37
- deprecated: import("react-desc").PropTypesDescValidator;
38
- };
39
- isRequired: import("react-desc").PropTypesDescValue;
40
- };
41
- };
42
- export declare const accordionPropTypes: {
43
- containerProps: {
44
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
45
- deprecated: import("react-desc").PropTypesDescValidator;
46
- };
47
- isRequired: import("react-desc").PropTypesDescValue;
48
- };
49
- activeValue: {
50
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
51
- deprecated: import("react-desc").PropTypesDescValidator;
52
- };
53
- isRequired: import("react-desc").PropTypesDescValue;
54
- };
55
- children: {
56
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
57
- deprecated: import("react-desc").PropTypesDescValidator;
58
- };
59
- isRequired: import("react-desc").PropTypesDescValue;
60
- };
61
- allowMultipleOpen: {
62
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
63
- deprecated: import("react-desc").PropTypesDescValidator;
64
- };
65
- isRequired: import("react-desc").PropTypesDescValue;
66
- };
67
- onChange: {
68
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
69
- deprecated: import("react-desc").PropTypesDescValidator;
70
- };
71
- isRequired: import("react-desc").PropTypesDescValue;
72
- };
73
- };
@@ -1 +0,0 @@
1
- export {};