@elliemae/ds-legacy-chip 1.0.0-rc.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/dist/cjs/DSChip.js +67 -0
- package/dist/cjs/DSChip.js.map +7 -0
- package/dist/cjs/config/useConfig.js +45 -0
- package/dist/cjs/config/useConfig.js.map +7 -0
- package/dist/cjs/constants.js +82 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/exported_related/data-test-ids.js +40 -0
- package/dist/cjs/exported_related/data-test-ids.js.map +7 -0
- package/dist/cjs/exported_related/index.js +31 -0
- package/dist/cjs/exported_related/index.js.map +7 -0
- package/dist/cjs/exported_related/theming.js +43 -0
- package/dist/cjs/exported_related/theming.js.map +7 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +53 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/sharedTypes.js +28 -0
- package/dist/cjs/sharedTypes.js.map +7 -0
- package/dist/cjs/styles.js +226 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/esm/DSChip.js +37 -0
- package/dist/esm/DSChip.js.map +7 -0
- package/dist/esm/config/useConfig.js +20 -0
- package/dist/esm/config/useConfig.js.map +7 -0
- package/dist/esm/constants.js +52 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/exported_related/data-test-ids.js +10 -0
- package/dist/esm/exported_related/data-test-ids.js.map +7 -0
- package/dist/esm/exported_related/index.js +4 -0
- package/dist/esm/exported_related/index.js.map +7 -0
- package/dist/esm/exported_related/theming.js +13 -0
- package/dist/esm/exported_related/theming.js.map +7 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +30 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/sharedTypes.js +2 -0
- package/dist/esm/sharedTypes.js.map +7 -0
- package/dist/esm/styles.js +196 -0
- package/dist/esm/styles.js.map +7 -0
- package/dist/types/DSChip.d.ts +5 -0
- package/dist/types/config/useConfig.d.ts +12 -0
- package/dist/types/constants.d.ts +36 -0
- package/dist/types/exported_related/data-test-ids.d.ts +5 -0
- package/dist/types/exported_related/index.d.ts +2 -0
- package/dist/types/exported_related/theming.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/sharedTypes.d.ts +4 -0
- package/dist/types/styles.d.ts +18 -0
- package/dist/types/tests/DSChip.axe.test.d.ts +1 -0
- package/dist/types/tests/DSChip.test.d.ts +1 -0
- package/package.json +97 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var styles_exports = {};
|
|
30
|
+
__export(styles_exports, {
|
|
31
|
+
StyledChildrenWrapper: () => StyledChildrenWrapper,
|
|
32
|
+
StyledChip: () => StyledChip,
|
|
33
|
+
StyledChipLabel: () => StyledChipLabel,
|
|
34
|
+
StyledRoundShape: () => StyledRoundShape,
|
|
35
|
+
StyledSpanWithEllipsis: () => StyledSpanWithEllipsis,
|
|
36
|
+
StyledWrapper: () => StyledWrapper
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(styles_exports);
|
|
39
|
+
var React = __toESM(require("react"));
|
|
40
|
+
var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
|
|
41
|
+
var import_constants = require("./constants.js");
|
|
42
|
+
var import_exported_related = require("./exported_related/index.js");
|
|
43
|
+
const getChipSize = (shape) => shape === import_constants.CHIP_SHAPES.ROUND ? import_constants.shapeSizes : import_constants.basicSizes;
|
|
44
|
+
const StyledChipLabel = (0, import_ds_legacy_system.styled)("div", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.LABEL })`
|
|
45
|
+
font-size: ${({ theme }) => theme.fontSizes.label[200]};
|
|
46
|
+
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
47
|
+
word-wrap: break-word;
|
|
48
|
+
text-align: center;
|
|
49
|
+
padding: ${({ size }) => size === import_constants.CHIP_SIZES.L ? "2px" : "4px"} 6px 6px 6px;
|
|
50
|
+
z-index: 0;
|
|
51
|
+
line-height: 1.27;
|
|
52
|
+
width: inherit;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
`;
|
|
57
|
+
const StyledSpanWithEllipsis = import_ds_legacy_system.styled.span`
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
`;
|
|
63
|
+
const StyledWrapper = (0, import_ds_legacy_system.styled)("div")`
|
|
64
|
+
display: flex;
|
|
65
|
+
height: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].height};
|
|
66
|
+
width: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].width};
|
|
67
|
+
${import_ds_legacy_system.xStyledCommonProps}
|
|
68
|
+
`;
|
|
69
|
+
const disabledRoundShape = import_ds_legacy_system.css`
|
|
70
|
+
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
71
|
+
|
|
72
|
+
& .DSIcon-root .DSIcon-svg {
|
|
73
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
const StyledRoundShape = (0, import_ds_legacy_system.styled)("div", {
|
|
77
|
+
name: import_exported_related.DSChipName,
|
|
78
|
+
slot: import_exported_related.DSChipSlots.ROUND_SHAPE
|
|
79
|
+
})`
|
|
80
|
+
background-color: ${({ theme }) => theme.colors.brand[600]};
|
|
81
|
+
width: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
|
|
82
|
+
height: ${({ size }) => size === import_constants.CHIP_SIZES.L ? import_constants.roundShapeLarge : import_constants.roundShapeSmall};
|
|
83
|
+
border-radius: 50px;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
margin-top: ${({ size }) => size === import_constants.CHIP_SIZES.L ? "5px" : "10px"};
|
|
88
|
+
`;
|
|
89
|
+
const StyledChildrenWrapper = (0, import_ds_legacy_system.styled)("div", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.CHILDREN_WRAPPER })`
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
`;
|
|
93
|
+
const styledChipSelectedCss = import_ds_legacy_system.css`
|
|
94
|
+
${StyledRoundShape} {
|
|
95
|
+
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
96
|
+
}
|
|
97
|
+
color: ${({ theme }) => theme.colors.brand[800]};
|
|
98
|
+
background-color: ${({ theme }) => theme.colors.brand[200]};
|
|
99
|
+
|
|
100
|
+
.DSIcon-svg {
|
|
101
|
+
fill: ${({ theme }) => theme.colors.brand[800]};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:before {
|
|
105
|
+
border: 1px solid ${({ theme }) => theme.colors.brand[600]};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:focus {
|
|
109
|
+
&:before {
|
|
110
|
+
border: 2px solid ${({ theme }) => theme.colors.brand[800]};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
const StyledChip = (0, import_ds_legacy_system.styled)("button", { name: import_exported_related.DSChipName, slot: import_exported_related.DSChipSlots.BUTTON })`
|
|
115
|
+
position: relative;
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
align-items: center;
|
|
119
|
+
padding: 0;
|
|
120
|
+
padding-top: ${(props) => props.buttonShape === import_constants.CHIP_SHAPES.ROUND ? "0" : "10px"};
|
|
121
|
+
border: none;
|
|
122
|
+
min-height: 100%;
|
|
123
|
+
height: fit-content;
|
|
124
|
+
width: 100%;
|
|
125
|
+
background-color: #fff;
|
|
126
|
+
color: ${({ theme }) => theme.colors.brand[600]};
|
|
127
|
+
border-radius: 4px;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
outline: none;
|
|
130
|
+
|
|
131
|
+
${StyledRoundShape} {
|
|
132
|
+
& .DSIcon-root .DSIcon-svg {
|
|
133
|
+
fill: #fff;
|
|
134
|
+
height: 24px;
|
|
135
|
+
width: 24px;
|
|
136
|
+
}
|
|
137
|
+
${({ disabled }) => disabled && disabledRoundShape}
|
|
138
|
+
}
|
|
139
|
+
&:before {
|
|
140
|
+
content: '';
|
|
141
|
+
position: absolute;
|
|
142
|
+
z-index: 20;
|
|
143
|
+
top: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
width: 100%;
|
|
146
|
+
height: 100%;
|
|
147
|
+
border-radius: 4px;
|
|
148
|
+
border: 2px solid transparent;
|
|
149
|
+
pointer-events: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
& .DSIcon-root .DSIcon-svg {
|
|
153
|
+
fill: ${({ theme }) => theme.colors.brand[600]};
|
|
154
|
+
height: 24px;
|
|
155
|
+
width: 24px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
& .DSIcon-root {
|
|
159
|
+
height: 24px;
|
|
160
|
+
width: 24px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&:hover,
|
|
164
|
+
&:focus {
|
|
165
|
+
z-index: 10;
|
|
166
|
+
|
|
167
|
+
${StyledChipLabel} {
|
|
168
|
+
text-align: left;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
${StyledSpanWithEllipsis} {
|
|
172
|
+
overflow-wrap: break-word;
|
|
173
|
+
white-space: pre-wrap;
|
|
174
|
+
overflow: visible;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&:hover {
|
|
179
|
+
${StyledRoundShape} {
|
|
180
|
+
background-color: ${({ theme }) => theme.colors.brand[800]};
|
|
181
|
+
}
|
|
182
|
+
color: ${({ theme }) => theme.colors.brand[800]};
|
|
183
|
+
background-color: ${({ theme }) => theme.colors.brand[200]};
|
|
184
|
+
.DSIcon-svg {
|
|
185
|
+
fill: ${({ theme }) => theme.colors.brand[800]};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&:focus {
|
|
190
|
+
&:before {
|
|
191
|
+
border-color: ${({ theme }) => theme.colors.brand[800]};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&:disabled {
|
|
196
|
+
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
197
|
+
cursor: not-allowed;
|
|
198
|
+
|
|
199
|
+
.DSIcon-svg {
|
|
200
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&:focus,
|
|
204
|
+
&:hover {
|
|
205
|
+
${StyledRoundShape} {
|
|
206
|
+
background-color: ${({ theme }) => theme.colors.neutral[200]};
|
|
207
|
+
}
|
|
208
|
+
background-color: #fff;
|
|
209
|
+
cursor: not-allowed;
|
|
210
|
+
&:before {
|
|
211
|
+
border-color: transparent;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
${StyledChipLabel} {
|
|
215
|
+
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&:hover .DSIcon-svg {
|
|
220
|
+
fill: ${({ theme }) => theme.colors.neutral[500]};
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
${({ selected }) => !selected ? "" : styledChipSelectedCss}
|
|
225
|
+
`;
|
|
226
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled, css, xStyledCommonProps } from '@elliemae/ds-legacy-system';\nimport { basicSizes, shapeSizes, CHIP_SHAPES, CHIP_SIZES, roundShapeLarge, roundShapeSmall } from './constants.js';\nimport type { ChipShapesT, ChipSizesT } from './sharedTypes.js';\nimport { DSChipName, DSChipSlots } from './exported_related/index.js';\n\nexport interface StyledChipPropsT {\n buttonSize: ChipSizesT;\n buttonShape: ChipShapesT;\n selected?: boolean;\n}\n\nexport interface StyledRoundShapePropsT {\n size: ChipSizesT;\n disabled?: boolean;\n}\n\nconst getChipSize = (shape: ChipShapesT) => (shape === CHIP_SHAPES.ROUND ? shapeSizes : basicSizes);\n\nexport const StyledChipLabel = styled('div', { name: DSChipName, slot: DSChipSlots.LABEL })<{ size: ChipSizesT }>`\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n word-wrap: break-word;\n text-align: center;\n padding: ${({ size }) => (size === CHIP_SIZES.L ? '2px' : '4px')} 6px 6px 6px;\n z-index: 0;\n line-height: 1.27;\n width: inherit;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nexport const StyledSpanWithEllipsis = styled.span`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n`;\n\nexport const StyledWrapper = styled('div')<StyledChipPropsT>`\n display: flex;\n height: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].height};\n width: ${({ buttonSize, buttonShape }) => getChipSize(buttonShape)[buttonSize].width};\n ${xStyledCommonProps}\n`;\n\nconst disabledRoundShape = css`\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n\n & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n`;\n\nexport const StyledRoundShape = styled('div', {\n name: DSChipName,\n slot: DSChipSlots.ROUND_SHAPE,\n})<StyledRoundShapePropsT>`\n background-color: ${({ theme }) => theme.colors.brand[600]};\n width: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n height: ${({ size }) => (size === CHIP_SIZES.L ? roundShapeLarge : roundShapeSmall)};\n border-radius: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: ${({ size }) => (size === CHIP_SIZES.L ? '5px' : '10px')};\n`;\n\nexport const StyledChildrenWrapper = styled('div', { name: DSChipName, slot: DSChipSlots.CHILDREN_WRAPPER })`\n width: 100%;\n height: 100%;\n`;\n\nconst styledChipSelectedCss = css`\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n\n &:before {\n border: 1px solid ${({ theme }) => theme.colors.brand[600]};\n }\n\n &:focus {\n &:before {\n border: 2px solid ${({ theme }) => theme.colors.brand[800]};\n }\n }\n`;\n\nexport const StyledChip = styled('button', { name: DSChipName, slot: DSChipSlots.BUTTON })<\n Pick<StyledChipPropsT, 'selected' | 'buttonShape'>\n>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0;\n padding-top: ${(props) => (props.buttonShape === CHIP_SHAPES.ROUND ? '0' : '10px')};\n border: none;\n min-height: 100%;\n height: fit-content;\n width: 100%;\n background-color: #fff;\n color: ${({ theme }) => theme.colors.brand[600]};\n border-radius: 4px;\n cursor: pointer;\n outline: none;\n\n ${StyledRoundShape} {\n & .DSIcon-root .DSIcon-svg {\n fill: #fff;\n height: 24px;\n width: 24px;\n }\n ${({ disabled }) => disabled && disabledRoundShape}\n }\n &:before {\n content: '';\n position: absolute;\n z-index: 20;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n border: 2px solid transparent;\n pointer-events: none;\n }\n\n & .DSIcon-root .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n height: 24px;\n width: 24px;\n }\n\n & .DSIcon-root {\n height: 24px;\n width: 24px;\n }\n\n &:hover,\n &:focus {\n z-index: 10;\n\n ${StyledChipLabel} {\n text-align: left;\n }\n\n ${StyledSpanWithEllipsis} {\n overflow-wrap: break-word;\n white-space: pre-wrap;\n overflow: visible;\n }\n }\n\n &:hover {\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.brand[800]};\n }\n color: ${({ theme }) => theme.colors.brand[800]};\n background-color: ${({ theme }) => theme.colors.brand[200]};\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:focus {\n &:before {\n border-color: ${({ theme }) => theme.colors.brand[800]};\n }\n }\n\n &:disabled {\n color: ${({ theme }) => theme.colors.neutral[500]};\n cursor: not-allowed;\n\n .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n\n &:focus,\n &:hover {\n ${StyledRoundShape} {\n background-color: ${({ theme }) => theme.colors.neutral[200]};\n }\n background-color: #fff;\n cursor: not-allowed;\n &:before {\n border-color: transparent;\n }\n\n ${StyledChipLabel} {\n color: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n &:hover .DSIcon-svg {\n fill: ${({ theme }) => theme.colors.neutral[500]};\n }\n }\n\n ${({ selected }) => (!selected ? '' : styledChipSelectedCss)}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { describe } from "@elliemae/ds-legacy-props-helpers";
|
|
4
|
+
import { useConfig } from "./config/useConfig.js";
|
|
5
|
+
import { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from "./styles.js";
|
|
6
|
+
import { CHIP_SHAPES } from "./constants.js";
|
|
7
|
+
import { DSChipPropTypes } from "./react-desc-prop-types.js";
|
|
8
|
+
import { omit } from "lodash";
|
|
9
|
+
const DSChip = (props) => {
|
|
10
|
+
const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = useConfig(props);
|
|
11
|
+
const { disabled, className, ...restGlobals } = omit(globalAttrs, ["shape", "type"]);
|
|
12
|
+
return /* @__PURE__ */ jsx(StyledWrapper, { buttonShape: shape, buttonSize: size, className, ...xStyledAttrs, children: /* @__PURE__ */ jsxs(
|
|
13
|
+
StyledChip,
|
|
14
|
+
{
|
|
15
|
+
buttonShape: shape,
|
|
16
|
+
"aria-disabled": disabled,
|
|
17
|
+
disabled,
|
|
18
|
+
ref: innerRef,
|
|
19
|
+
selected,
|
|
20
|
+
role: "button",
|
|
21
|
+
...restGlobals,
|
|
22
|
+
children: [
|
|
23
|
+
shape === CHIP_SHAPES.ROUND ? /* @__PURE__ */ jsx(StyledRoundShape, { disabled, size, children: /* @__PURE__ */ jsx(Icon, {}) }) : /* @__PURE__ */ jsx(Icon, {}),
|
|
24
|
+
/* @__PURE__ */ jsx(StyledChipLabel, { size, children: /* @__PURE__ */ jsx(StyledSpanWithEllipsis, { children: label }) })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
) });
|
|
28
|
+
};
|
|
29
|
+
DSChip.propTypes = DSChipPropTypes;
|
|
30
|
+
DSChip.displayName = "DSChip";
|
|
31
|
+
const DSChipWithSchema = describe(DSChip);
|
|
32
|
+
DSChipWithSchema.propTypes = DSChipPropTypes;
|
|
33
|
+
export {
|
|
34
|
+
DSChip,
|
|
35
|
+
DSChipWithSchema
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=DSChip.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSChip.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-legacy-props-helpers';\nimport { useConfig } from './config/useConfig.js';\nimport { StyledChip, StyledChipLabel, StyledWrapper, StyledRoundShape, StyledSpanWithEllipsis } from './styles.js';\nimport { CHIP_SHAPES } from './constants.js';\nimport type { DSChipT } from './react-desc-prop-types.js';\nimport { DSChipPropTypes } from './react-desc-prop-types.js';\nimport { omit } from 'lodash';\n\nconst DSChip: React.ComponentType<DSChipT.Props> = (props) => {\n const { size, shape, selected, innerRef, icon: Icon, label, globalAttrs, xStyledAttrs } = useConfig(props);\n\n const { disabled, className, ...restGlobals } = omit(globalAttrs, ['shape', 'type']);\n\n return (\n <StyledWrapper buttonShape={shape} buttonSize={size} className={className} {...xStyledAttrs}>\n <StyledChip\n buttonShape={shape}\n aria-disabled={disabled}\n disabled={disabled}\n ref={innerRef}\n selected={selected}\n role=\"button\"\n {...restGlobals}\n >\n {shape === CHIP_SHAPES.ROUND ? (\n <StyledRoundShape disabled={disabled} size={size}>\n <Icon />\n </StyledRoundShape>\n ) : (\n <Icon />\n )}\n <StyledChipLabel size={size}>\n <StyledSpanWithEllipsis>{label}</StyledSpanWithEllipsis>\n </StyledChipLabel>\n </StyledChip>\n </StyledWrapper>\n );\n};\n\nDSChip.propTypes = DSChipPropTypes;\nDSChip.displayName = 'DSChip';\nconst DSChipWithSchema = describe(DSChip);\nDSChipWithSchema.propTypes = DSChipPropTypes;\n\nexport { DSChip, DSChipWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgBjB,SAWM,KAXN;AAfN,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,YAAY,iBAAiB,eAAe,kBAAkB,8BAA8B;AACrG,SAAS,mBAAmB;AAE5B,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAErB,MAAM,SAA6C,CAAC,UAAU;AAC5D,QAAM,EAAE,MAAM,OAAO,UAAU,UAAU,MAAM,MAAM,OAAO,aAAa,aAAa,IAAI,UAAU,KAAK;AAEzG,QAAM,EAAE,UAAU,WAAW,GAAG,YAAY,IAAI,KAAK,aAAa,CAAC,SAAS,MAAM,CAAC;AAEnF,SACE,oBAAC,iBAAc,aAAa,OAAO,YAAY,MAAM,WAAuB,GAAG,cAC7E;AAAA,IAAC;AAAA;AAAA,MACC,aAAa;AAAA,MACb,iBAAe;AAAA,MACf;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA,MAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,kBAAU,YAAY,QACrB,oBAAC,oBAAiB,UAAoB,MACpC,8BAAC,QAAK,GACR,IAEA,oBAAC,QAAK;AAAA,QAER,oBAAC,mBAAgB,MACf,8BAAC,0BAAwB,iBAAM,GACjC;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;AAEA,OAAO,YAAY;AACnB,OAAO,cAAc;AACrB,MAAM,mBAAmB,SAAS,MAAM;AACxC,iBAAiB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
useMemoMergePropsWithDefault,
|
|
4
|
+
useGetGlobalAttributes,
|
|
5
|
+
useValidateTypescriptPropTypes,
|
|
6
|
+
useGetXstyledProps
|
|
7
|
+
} from "@elliemae/ds-legacy-props-helpers";
|
|
8
|
+
import { DSChipName } from "../exported_related/index.js";
|
|
9
|
+
import { defaultProps, DSChipPropTypes } from "../react-desc-prop-types.js";
|
|
10
|
+
const useConfig = (props) => {
|
|
11
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
12
|
+
useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);
|
|
13
|
+
const globalAttrs = useGetGlobalAttributes(propsWithDefault);
|
|
14
|
+
const xStyledAttrs = useGetXstyledProps(propsWithDefault);
|
|
15
|
+
return { ...propsWithDefault, globalAttrs, xStyledAttrs };
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
useConfig
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=useConfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useConfig.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useGetXstyledProps,\n} from '@elliemae/ds-legacy-props-helpers';\nimport { DSChipName } from '../exported_related/index.js';\nimport type { DSChipT } from '../react-desc-prop-types.js';\nimport { defaultProps, DSChipPropTypes } from '../react-desc-prop-types.js';\n\nexport const useConfig = (props: DSChipT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<Required<DSChipT.InternalProps>>(props, defaultProps);\n\n useValidateTypescriptPropTypes(propsWithDefault, DSChipPropTypes, DSChipName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const xStyledAttrs = useGetXstyledProps(propsWithDefault);\n\n return { ...propsWithDefault, globalAttrs, xStyledAttrs };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAE3B,SAAS,cAAc,uBAAuB;AAEvC,MAAM,YAAY,CAAC,UAAyB;AACjD,QAAM,mBAAmB,6BAA8D,OAAO,YAAY;AAE1G,iCAA+B,kBAAkB,iBAAiB,UAAU;AAC5E,QAAM,cAAc,uBAAuB,gBAAgB;AAC3D,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAO,EAAE,GAAG,kBAAkB,aAAa,aAAa;AAC1D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const CHIP_SHAPES = {
|
|
3
|
+
DEFAULT: "default",
|
|
4
|
+
ROUND: "round"
|
|
5
|
+
};
|
|
6
|
+
const CHIP_SIZES = {
|
|
7
|
+
S: "s",
|
|
8
|
+
L: "l"
|
|
9
|
+
};
|
|
10
|
+
const roundShapeLarge = "56px";
|
|
11
|
+
const roundShapeSmall = "40px";
|
|
12
|
+
const basicSizes = {
|
|
13
|
+
s: {
|
|
14
|
+
width: "72px",
|
|
15
|
+
height: "67px"
|
|
16
|
+
},
|
|
17
|
+
l: {
|
|
18
|
+
width: "92px",
|
|
19
|
+
height: "67px"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const shapeSizes = {
|
|
23
|
+
s: {
|
|
24
|
+
width: "72px",
|
|
25
|
+
height: "77px"
|
|
26
|
+
},
|
|
27
|
+
l: {
|
|
28
|
+
width: "92px",
|
|
29
|
+
height: "85px"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const ChipSizesValuesArray = Object.values(CHIP_SIZES);
|
|
33
|
+
const ChipShapesValuesArray = Object.values(CHIP_SHAPES);
|
|
34
|
+
const ChipInteractionStates = ["hover", "focus", "active"];
|
|
35
|
+
const ChipSizesValuesString = JSON.stringify(ChipSizesValuesArray);
|
|
36
|
+
const ChipShapesValuesString = JSON.stringify(ChipShapesValuesArray);
|
|
37
|
+
const ChipInteractionStatesValuesString = JSON.stringify(ChipInteractionStates);
|
|
38
|
+
export {
|
|
39
|
+
CHIP_SHAPES,
|
|
40
|
+
CHIP_SIZES,
|
|
41
|
+
ChipInteractionStates,
|
|
42
|
+
ChipInteractionStatesValuesString,
|
|
43
|
+
ChipShapesValuesArray,
|
|
44
|
+
ChipShapesValuesString,
|
|
45
|
+
ChipSizesValuesArray,
|
|
46
|
+
ChipSizesValuesString,
|
|
47
|
+
basicSizes,
|
|
48
|
+
roundShapeLarge,
|
|
49
|
+
roundShapeSmall,
|
|
50
|
+
shapeSizes
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/constants.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const CHIP_SHAPES = {\n DEFAULT: 'default' as const,\n ROUND: 'round' as const,\n};\n\nexport const CHIP_SIZES = {\n S: 's' as const,\n L: 'l' as const,\n};\n\nexport const roundShapeLarge = '56px';\nexport const roundShapeSmall = '40px';\n\nexport const basicSizes = {\n s: {\n width: '72px',\n height: '67px',\n } as const,\n l: {\n width: '92px',\n height: '67px',\n } as const,\n};\n\nexport const shapeSizes = {\n s: {\n width: '72px',\n height: '77px',\n } as const,\n l: {\n width: '92px',\n height: '85px',\n } as const,\n};\n\nexport const ChipSizesValuesArray = Object.values(CHIP_SIZES);\nexport const ChipShapesValuesArray = Object.values(CHIP_SHAPES);\nexport const ChipInteractionStates = ['hover', 'focus', 'active'];\n\nexport const ChipSizesValuesString = JSON.stringify(ChipSizesValuesArray);\nexport const ChipShapesValuesString = JSON.stringify(ChipShapesValuesArray);\nexport const ChipInteractionStatesValuesString = JSON.stringify(ChipInteractionStates);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,cAAc;AAAA,EACzB,SAAS;AAAA,EACT,OAAO;AACT;AAEO,MAAM,aAAa;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAEO,MAAM,kBAAkB;AACxB,MAAM,kBAAkB;AAExB,MAAM,aAAa;AAAA,EACxB,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,aAAa;AAAA,EACxB,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,GAAG;AAAA,IACD,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,uBAAuB,OAAO,OAAO,UAAU;AACrD,MAAM,wBAAwB,OAAO,OAAO,WAAW;AACvD,MAAM,wBAAwB,CAAC,SAAS,SAAS,QAAQ;AAEzD,MAAM,wBAAwB,KAAK,UAAU,oBAAoB;AACjE,MAAM,yBAAyB,KAAK,UAAU,qBAAqB;AACnE,MAAM,oCAAoC,KAAK,UAAU,qBAAqB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported_related/data-test-ids.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSChipDataTestIds = {\n BUTTON: 'ds-chip-button',\n LABEL: 'ds-chip-label',\n ROUND_SHAPE: 'ds-chip-round-shape',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,oBAAoB;AAAA,EAC/B,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AACf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported_related/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './data-test-ids.js';\nexport * from './theming.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const DSChipName = "DSChip";
|
|
3
|
+
const DSChipSlots = {
|
|
4
|
+
BUTTON: "root",
|
|
5
|
+
LABEL: "label",
|
|
6
|
+
ROUND_SHAPE: "round-shape",
|
|
7
|
+
CHILDREN_WRAPPER: "children-wrapper"
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
DSChipName,
|
|
11
|
+
DSChipSlots
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=theming.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported_related/theming.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSChipName = 'DSChip';\n\nexport const DSChipSlots = {\n BUTTON: 'root',\n LABEL: 'label',\n ROUND_SHAPE: 'round-shape',\n CHILDREN_WRAPPER: 'children-wrapper',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,aAAa;AAEnB,MAAM,cAAc;AAAA,EACzB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,aAAa;AAAA,EACb,kBAAkB;AACpB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSChip.js';\nexport * from './constants.js';\nexport * from './exported_related/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
import {
|
|
4
|
+
CHIP_SIZES,
|
|
5
|
+
CHIP_SHAPES,
|
|
6
|
+
ChipSizesValuesArray,
|
|
7
|
+
ChipSizesValuesString,
|
|
8
|
+
ChipShapesValuesArray,
|
|
9
|
+
ChipShapesValuesString
|
|
10
|
+
} from "./constants.js";
|
|
11
|
+
const defaultProps = {
|
|
12
|
+
size: CHIP_SIZES.L,
|
|
13
|
+
shape: CHIP_SHAPES.DEFAULT
|
|
14
|
+
};
|
|
15
|
+
const DSChipPropTypes = {
|
|
16
|
+
...globalAttributesPropTypes,
|
|
17
|
+
...xstyledPropTypes,
|
|
18
|
+
icon: PropTypes.func.isRequired.description("Chip Icon").defaultValue(() => {
|
|
19
|
+
}),
|
|
20
|
+
label: PropTypes.string.isRequired.description("Chip Label").defaultValue(""),
|
|
21
|
+
selected: PropTypes.bool.description("Whether chip is selected").defaultValue(""),
|
|
22
|
+
shape: PropTypes.oneOf(ChipShapesValuesArray).description(ChipShapesValuesString).defaultValue(CHIP_SHAPES.DEFAULT),
|
|
23
|
+
size: PropTypes.oneOf(ChipSizesValuesArray).description(ChipSizesValuesString).defaultValue(CHIP_SIZES.L),
|
|
24
|
+
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description("Inner ref to button component.")
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
DSChipPropTypes,
|
|
28
|
+
defaultProps
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-legacy-utilities';\nimport type { GlobalAttributesT } from '@elliemae/ds-legacy-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-legacy-props-helpers';\nimport {\n CHIP_SIZES,\n CHIP_SHAPES,\n ChipSizesValuesArray,\n ChipSizesValuesString,\n ChipShapesValuesArray,\n ChipShapesValuesString,\n} from './constants.js';\nimport type { ChipSizesT, ChipShapesT } from './sharedTypes.js';\n\nexport const defaultProps: DSChipT.DefaultProps = {\n size: CHIP_SIZES.L,\n shape: CHIP_SHAPES.DEFAULT,\n};\n\nexport declare namespace DSChipT {\n interface DefaultProps {\n size: ChipSizesT;\n shape: ChipShapesT;\n }\n interface OptionalProps {\n selected?: boolean;\n innerRef?: React.RefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n }\n\n interface RequiredProps {\n label: string;\n icon: () => JSX.Element;\n }\n export interface InternalProps extends OptionalProps, Partial<DefaultProps>, RequiredProps {}\n export interface Props\n extends Omit<GlobalAttributesT<HTMLButtonElement>, keyof InternalProps>,\n InternalProps,\n XstyledProps {}\n}\n\nexport const DSChipPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n icon: PropTypes.func.isRequired.description('Chip Icon').defaultValue(() => {}),\n label: PropTypes.string.isRequired.description('Chip Label').defaultValue(''),\n selected: PropTypes.bool.description('Whether chip is selected').defaultValue(''),\n shape: PropTypes.oneOf(ChipShapesValuesArray).description(ChipShapesValuesString).defaultValue(CHIP_SHAPES.DEFAULT),\n size: PropTypes.oneOf(ChipSizesValuesArray).description(ChipSizesValuesString).defaultValue(CHIP_SIZES.L),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGA,MAAM,eAAqC;AAAA,EAChD,MAAM,WAAW;AAAA,EACjB,OAAO,YAAY;AACrB;AAuBO,MAAM,kBAAkB;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,MAAM,UAAU,KAAK,WAAW,YAAY,WAAW,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC9E,OAAO,UAAU,OAAO,WAAW,YAAY,YAAY,EAAE,aAAa,EAAE;AAAA,EAC5E,UAAU,UAAU,KAAK,YAAY,0BAA0B,EAAE,aAAa,EAAE;AAAA,EAChF,OAAO,UAAU,MAAM,qBAAqB,EAAE,YAAY,sBAAsB,EAAE,aAAa,YAAY,OAAO;AAAA,EAClH,MAAM,UAAU,MAAM,oBAAoB,EAAE,YAAY,qBAAqB,EAAE,aAAa,WAAW,CAAC;AAAA,EACxG,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAChH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|