@widergy/energy-ui 3.125.1 → 3.127.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.
Files changed (23) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/components/UTChip/README.md +208 -0
  3. package/dist/components/UTChip/UTChip.mdx +11 -0
  4. package/dist/components/UTChip/UTChip.stories.js +385 -0
  5. package/dist/components/UTChip/constants.js +27 -0
  6. package/dist/components/UTChip/index.js +74 -0
  7. package/dist/components/UTChip/styles.module.scss +107 -0
  8. package/dist/components/UTChip/utils.js +114 -0
  9. package/dist/components/UTLabel/components/Markdown/components/BlockQuote/styles.module.scss +1 -0
  10. package/dist/components/UTLabel/components/Markdown/components/Citation/constants.js +17 -0
  11. package/dist/components/UTLabel/components/Markdown/components/Citation/index.js +12 -4
  12. package/dist/components/UTLabel/components/Markdown/components/Citation/utils.js +18 -0
  13. package/dist/components/UTLabel/components/Markdown/components/CitationGroup/index.js +5 -7
  14. package/dist/components/UTLabel/components/Markdown/components/CitationGroup/styles.module.scss +12 -5
  15. package/dist/components/UTLabel/components/Markdown/components/ListItem/index.js +3 -4
  16. package/dist/components/UTLabel/components/Markdown/components/ListItem/styles.module.scss +1 -2
  17. package/dist/components/UTLabel/components/Markdown/components/Section/index.js +2 -1
  18. package/dist/components/UTLabel/components/Markdown/customPlugins/remarkCitations.js +1 -2
  19. package/dist/components/UTLabel/components/Markdown/utils.js +11 -2
  20. package/dist/components/UTLabel/constants.js +43 -31
  21. package/dist/components/UTLabel/theme.js +1 -12
  22. package/dist/components/UTTextInput/versions/V1/index.js +1 -1
  23. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [3.127.0](https://github.com/widergy/energy-ui/compare/v3.126.0...v3.127.0) (2026-01-06)
2
+
3
+
4
+ ### Features
5
+
6
+ * [PDI-564] citation chips ([#739](https://github.com/widergy/energy-ui/issues/739)) ([e8259c5](https://github.com/widergy/energy-ui/commit/e8259c56f2b378680bd893fb571984d7fedc2060))
7
+
8
+ # [3.126.0](https://github.com/widergy/energy-ui/compare/v3.125.1...v3.126.0) (2025-12-17)
9
+
10
+
11
+ ### Features
12
+
13
+ * [PDI-552] utchip ([#737](https://github.com/widergy/energy-ui/issues/737)) ([e5d37e6](https://github.com/widergy/energy-ui/commit/e5d37e659c96542f4fdca9beee63b31306e1e47f))
14
+
1
15
  ## [3.125.1](https://github.com/widergy/energy-ui/compare/v3.125.0...v3.125.1) (2025-12-17)
2
16
 
3
17
 
@@ -0,0 +1,208 @@
1
+ # UTChip Component
2
+
3
+ ## Overview
4
+
5
+ `UTChip` is a compact, interactive component used to display information or actions in a condensed format. Chips are commonly used for tags, filters, selections, or quick actions. They can be interactive (clickable) or static, and support various visual states including active, disabled, and different variants.
6
+
7
+ ## Props
8
+
9
+ | Prop | Type | Default | Description |
10
+ |------|------|---------|-------------|
11
+ | `active` | `bool` | `false` | Indicates whether the chip is in an active state. Affects styling and colors. |
12
+ | `adornment` | `shape` | `undefined` | Optional decorative element displayed before the text. See [Adornments](#adornments) section. |
13
+ | `children` | `string` | Required | The text content displayed inside the chip. |
14
+ | `dataTestId` | `string` | `undefined` | Test ID for testing purposes. |
15
+ | `disabled` | `bool` | `false` | Disables the chip, preventing interactions and changing its appearance. |
16
+ | `isDragging` | `bool` | `false` | Indicates whether the chip is being dragged or moved. Useful for drag and drop interactions. |
17
+ | `onClick` | `func` | `undefined` | Callback function triggered when the chip is clicked. If provided, the chip becomes interactive and displays a close button. |
18
+ | `onClose` | `func` | `undefined` | Callback function triggered when the close button (X) is clicked. Only displayed if `onClick` is provided. |
19
+ | `size` | `oneOf(['medium', 'small'])` | `'medium'` | The size of the chip. Affects padding and text size. |
20
+ | `variant` | `oneOf(['default', 'outline'])` | `'default'` | Visual style variant. `default` uses filled background, `outline` uses border-only style. |
21
+
22
+ ## Adornments
23
+
24
+ Chips can display optional decorative elements before the text. The `adornment` prop accepts an object with the following structure:
25
+
26
+ ```javascript
27
+ {
28
+ type: 'icon' | 'avatar' | 'image',
29
+ props: { /* component-specific props */ }
30
+ }
31
+ ```
32
+
33
+ ### Adornment Types
34
+
35
+ | Type | Component | Description | Example Props |
36
+ |------|-----------|-------------|----------------|
37
+ | `icon` | `UTIcon` | Displays an icon from the icon library. | `{ name: 'IconCheck', size: 20 }` |
38
+ | `avatar` | `UTAvatar` | Displays a user avatar. | `{ src: 'url', alt: 'User Name' }` |
39
+ | `image` | `img` | Displays a custom image. | `{ src: 'url', alt: 'Image' }` |
40
+
41
+ ## Variants
42
+
43
+ ### Default Variant
44
+ Filled background with solid colors. Best for primary actions or selections.
45
+
46
+ ### Outline Variant
47
+ Border-only style with transparent background. Best for secondary actions or filters.
48
+
49
+ ## Sizes
50
+
51
+ ### Medium (default)
52
+ Standard size suitable for most use cases.
53
+
54
+ ### Small
55
+ Compact size for space-constrained layouts.
56
+
57
+ ## Color Themes
58
+
59
+ The chip's colors change based on its state:
60
+
61
+ - **Active + Default variant**: Light background with negative (red) close button
62
+ - **Active + Outline variant**: Accent-colored border with primary (blue) close button
63
+ - **Inactive**: Gray text and close button
64
+ - **Disabled**: Gray appearance, no interactions
65
+
66
+ ## Usage Examples
67
+
68
+ ### Basic Chip
69
+ ```jsx
70
+ <UTChip>Basic Chip</UTChip>
71
+ ```
72
+
73
+ ### Interactive Chip with Close Button
74
+ ```jsx
75
+ <UTChip
76
+ onClick={() => console.log('Chip clicked')}
77
+ onClose={() => console.log('Chip closed')}
78
+ >
79
+ Closeable Chip
80
+ </UTChip>
81
+ ```
82
+
83
+ ### Active Chip
84
+ ```jsx
85
+ <UTChip active>
86
+ Active Chip
87
+ </UTChip>
88
+ ```
89
+
90
+ ### Chip with Icon Adornment
91
+ ```jsx
92
+ <UTChip
93
+ adornment={{
94
+ type: 'icon',
95
+ props: { name: 'IconCheck' }
96
+ }}
97
+ >
98
+ Chip with Icon
99
+ </UTChip>
100
+ ```
101
+
102
+ ### Chip with Avatar Adornment
103
+ ```jsx
104
+ <UTChip
105
+ adornment={{
106
+ type: 'avatar',
107
+ props: { src: 'avatar-url', alt: 'User' }
108
+ }}
109
+ >
110
+ User Chip
111
+ </UTChip>
112
+ ```
113
+
114
+ ### Chip with Image Adornment
115
+ ```jsx
116
+ <UTChip
117
+ adornment={{
118
+ type: 'image',
119
+ props: { src: 'image-url', alt: 'Image' }
120
+ }}
121
+ >
122
+ Image Chip
123
+ </UTChip>
124
+ ```
125
+
126
+ ### Small Outline Variant
127
+ ```jsx
128
+ <UTChip
129
+ size="small"
130
+ variant="outline"
131
+ onClick={() => {}}
132
+ onClose={() => {}}
133
+ >
134
+ Filter Tag
135
+ </UTChip>
136
+ ```
137
+
138
+ ### Disabled Chip
139
+ ```jsx
140
+ <UTChip disabled>
141
+ Disabled Chip
142
+ </UTChip>
143
+ ```
144
+
145
+ ### Dragging Chip
146
+ ```jsx
147
+ <UTChip
148
+ isDragging={true}
149
+ onClick={() => console.log('Chip clicked')}
150
+ onClose={() => console.log('Chip closed')}
151
+ >
152
+ Draggable Chip
153
+ </UTChip>
154
+ ```
155
+
156
+ ### Multiple Chips (Tag List)
157
+ ```jsx
158
+ const tags = ['React', 'JavaScript', 'UI'];
159
+
160
+ {tags.map(tag => (
161
+ <UTChip
162
+ key={tag}
163
+ onClick={() => selectTag(tag)}
164
+ onClose={() => removeTag(tag)}
165
+ >
166
+ {tag}
167
+ </UTChip>
168
+ ))}
169
+ ```
170
+
171
+ ## Behavior
172
+
173
+ ### Interactive Behavior
174
+ - When `onClick` is provided, the chip becomes interactive and displays a close button (X)
175
+ - The close button triggers the `onClose` callback
176
+ - The chip's appearance changes based on the `active` state
177
+
178
+ ### Text Sizing
179
+ - Text size automatically adjusts based on the `size` prop:
180
+ - `medium`: Uses `body` text variant
181
+ - `small`: Uses `small` text variant
182
+
183
+ ### Styling
184
+ - The component uses CSS modules for styling
185
+ - Classes are applied dynamically based on props: `size`, `variant`, `active`, and `disabled`
186
+ - Adornments are styled to fit within the chip's layout
187
+
188
+ ## Accessibility
189
+
190
+ - Use `dataTestId` for testing and accessibility testing
191
+ - Ensure the chip text is descriptive and meaningful
192
+ - When used as a filter or selection, provide clear visual feedback with the `active` state
193
+ - Disabled chips should have appropriate visual indication
194
+
195
+ ## Related Components
196
+
197
+ - **UTLabel**: Used internally for text rendering
198
+ - **UTButton**: Used internally for the close button
199
+ - **UTIcon**: Used for icon adornments
200
+ - **UTAvatar**: Used for avatar adornments
201
+ - **UTTouchableWithoutFeedback**: Used for interactive container when `onClick` is provided
202
+
203
+ ## Notes
204
+
205
+ - The component is memoized for performance optimization
206
+ - Adornment props are merged with default props specific to each adornment type
207
+ - The close button only appears when `onClick` is provided
208
+ - Color themes are automatically managed based on the `active` and `variant` states
@@ -0,0 +1,11 @@
1
+ import { ArgTypes, Description, Meta, Title } from '@storybook/blocks';
2
+
3
+ import * as UTChip from './UTChip.stories';
4
+
5
+ <Meta of={UTChip} />
6
+
7
+ <Title>UTChip</Title>
8
+
9
+ <Description of={UTChip} />
10
+
11
+ <ArgTypes />
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.WithImageAdornment = exports.WithIconAdornment = exports.WithAvatarAdornment = exports.TagList = exports.SmallOutlineInteractive = exports.Small = exports.OutlineActive = exports.Outline = exports.InteractiveActive = exports.Interactive = exports.FilterChips = exports.Dragging = exports.Disabled = exports.Default = exports.AllVariants = exports.Active = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _constants = require("./constants");
9
+ var _ = _interopRequireDefault(require("."));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ var _default = exports.default = {
12
+ args: {
13
+ children: 'Chip Label'
14
+ },
15
+ argTypes: {
16
+ active: {
17
+ control: 'boolean',
18
+ description: 'Indica si el chip está en estado activo.',
19
+ table: {
20
+ defaultValue: {
21
+ summary: 'false'
22
+ },
23
+ type: {
24
+ summary: 'bool'
25
+ }
26
+ }
27
+ },
28
+ adornment: {
29
+ control: 'object',
30
+ description: 'Elemento decorativo opcional que se muestra antes del texto. Puede ser un icono, avatar o imagen.',
31
+ table: {
32
+ defaultValue: {
33
+ summary: 'undefined'
34
+ },
35
+ type: {
36
+ summary: 'object'
37
+ }
38
+ }
39
+ },
40
+ children: {
41
+ control: 'text',
42
+ description: 'Contenido de texto que se muestra dentro del chip.',
43
+ table: {
44
+ defaultValue: {
45
+ summary: 'undefined'
46
+ },
47
+ type: {
48
+ summary: 'string'
49
+ }
50
+ }
51
+ },
52
+ dataTestId: {
53
+ control: 'text',
54
+ description: 'ID para testing y propósitos de accesibilidad.',
55
+ table: {
56
+ defaultValue: {
57
+ summary: 'undefined'
58
+ },
59
+ type: {
60
+ summary: 'string'
61
+ }
62
+ }
63
+ },
64
+ disabled: {
65
+ control: 'boolean',
66
+ description: 'Desactiva el chip, previniendo interacciones y cambiando su apariencia.',
67
+ table: {
68
+ defaultValue: {
69
+ summary: 'false'
70
+ },
71
+ type: {
72
+ summary: 'bool'
73
+ }
74
+ }
75
+ },
76
+ isDragging: {
77
+ control: 'boolean',
78
+ description: 'Indica si el chip está siendo arrastrado o movido. Útil para interacciones de drag and drop.',
79
+ table: {
80
+ defaultValue: {
81
+ summary: 'false'
82
+ },
83
+ type: {
84
+ summary: 'bool'
85
+ }
86
+ }
87
+ },
88
+ onClick: {
89
+ control: {
90
+ type: 'inline-radio'
91
+ },
92
+ options: ['undefined', 'function'],
93
+ mapping: {
94
+ undefined,
95
+ function: () => alert('Chip clicked')
96
+ },
97
+ description: 'Función callback que se ejecuta cuando se hace clic en el chip. Si se proporciona, el chip se vuelve interactivo y muestra un botón de cerrar.',
98
+ table: {
99
+ defaultValue: {
100
+ summary: 'undefined'
101
+ },
102
+ type: {
103
+ summary: 'func'
104
+ }
105
+ }
106
+ },
107
+ onClose: {
108
+ control: {
109
+ type: 'inline-radio'
110
+ },
111
+ options: ['undefined', 'function'],
112
+ mapping: {
113
+ undefined,
114
+ function: () => alert('Chip closed')
115
+ },
116
+ description: 'Función callback que se ejecuta cuando se hace clic en el botón de cerrar (X). Solo se muestra si onClick está definido.',
117
+ table: {
118
+ defaultValue: {
119
+ summary: 'undefined'
120
+ },
121
+ type: {
122
+ summary: 'func'
123
+ }
124
+ }
125
+ },
126
+ size: {
127
+ control: 'select',
128
+ description: 'Tamaño del chip. Afecta el padding y el tamaño del texto.',
129
+ options: Object.values(_constants.CHIP_SIZES),
130
+ table: {
131
+ defaultValue: {
132
+ summary: _constants.CHIP_SIZES.MEDIUM
133
+ },
134
+ type: {
135
+ summary: "'".concat(_constants.CHIP_SIZES.MEDIUM, "' | '").concat(_constants.CHIP_SIZES.SMALL, "'")
136
+ }
137
+ }
138
+ },
139
+ variant: {
140
+ control: 'select',
141
+ description: 'Variante visual del chip. "default" usa fondo relleno, "outline" usa solo borde.',
142
+ options: Object.values(_constants.CHIP_VARIANT),
143
+ table: {
144
+ defaultValue: {
145
+ summary: _constants.CHIP_VARIANT.DEFAULT
146
+ },
147
+ type: {
148
+ summary: "'".concat(_constants.CHIP_VARIANT.DEFAULT, "' | '").concat(_constants.CHIP_VARIANT.OUTLINE, "'")
149
+ }
150
+ }
151
+ }
152
+ },
153
+ component: _.default,
154
+ parameters: {
155
+ docs: {
156
+ description: {
157
+ component: 'UTChip es un componente compacto e interactivo usado para mostrar información o acciones en un formato condensado. Se usa comúnmente para tags, filtros, selecciones o acciones rápidas.'
158
+ }
159
+ }
160
+ },
161
+ title: 'Energy-UI/UTChip'
162
+ };
163
+ const Default = exports.Default = {
164
+ args: {
165
+ active: false,
166
+ adornment: {
167
+ type: _constants.ADORNMENT_TYPES.ICON,
168
+ props: {
169
+ name: 'IconCircleCheck'
170
+ }
171
+ },
172
+ disabled: false,
173
+ isDragging: false,
174
+ onClick: undefined,
175
+ onClose: undefined,
176
+ size: _constants.CHIP_SIZES.MEDIUM,
177
+ variant: _constants.CHIP_VARIANT.DEFAULT
178
+ },
179
+ name: 'Playground'
180
+ };
181
+ const Active = exports.Active = {
182
+ args: {
183
+ active: true,
184
+ disabled: false,
185
+ size: _constants.CHIP_SIZES.MEDIUM,
186
+ variant: _constants.CHIP_VARIANT.DEFAULT,
187
+ isDragging: false
188
+ }
189
+ };
190
+ const Disabled = exports.Disabled = {
191
+ args: {
192
+ active: false,
193
+ disabled: true,
194
+ size: _constants.CHIP_SIZES.MEDIUM,
195
+ variant: _constants.CHIP_VARIANT.DEFAULT,
196
+ isDragging: false
197
+ }
198
+ };
199
+ const Small = exports.Small = {
200
+ args: {
201
+ active: false,
202
+ disabled: false,
203
+ size: _constants.CHIP_SIZES.SMALL,
204
+ variant: _constants.CHIP_VARIANT.DEFAULT,
205
+ isDragging: false
206
+ }
207
+ };
208
+ const Outline = exports.Outline = {
209
+ args: {
210
+ active: false,
211
+ disabled: false,
212
+ size: _constants.CHIP_SIZES.MEDIUM,
213
+ variant: _constants.CHIP_VARIANT.OUTLINE,
214
+ isDragging: false
215
+ }
216
+ };
217
+ const OutlineActive = exports.OutlineActive = {
218
+ args: {
219
+ active: true,
220
+ disabled: false,
221
+ size: _constants.CHIP_SIZES.MEDIUM,
222
+ variant: _constants.CHIP_VARIANT.OUTLINE,
223
+ isDragging: false
224
+ }
225
+ };
226
+ const Interactive = exports.Interactive = {
227
+ args: {
228
+ active: false,
229
+ disabled: false,
230
+ onClick: () => alert('Chip clicked'),
231
+ onClose: () => alert('Chip closed'),
232
+ size: _constants.CHIP_SIZES.MEDIUM,
233
+ variant: _constants.CHIP_VARIANT.DEFAULT,
234
+ isDragging: false
235
+ }
236
+ };
237
+ const InteractiveActive = exports.InteractiveActive = {
238
+ args: {
239
+ active: true,
240
+ disabled: false,
241
+ onClick: () => alert('Chip clicked'),
242
+ onClose: () => alert('Chip closed'),
243
+ size: _constants.CHIP_SIZES.MEDIUM,
244
+ variant: _constants.CHIP_VARIANT.DEFAULT,
245
+ isDragging: false
246
+ }
247
+ };
248
+ const WithIconAdornment = exports.WithIconAdornment = {
249
+ args: {
250
+ active: false,
251
+ adornment: {
252
+ type: _constants.ADORNMENT_TYPES.ICON,
253
+ props: {
254
+ name: 'IconCircleCheck'
255
+ }
256
+ },
257
+ disabled: false,
258
+ size: _constants.CHIP_SIZES.MEDIUM,
259
+ variant: _constants.CHIP_VARIANT.DEFAULT,
260
+ isDragging: false
261
+ }
262
+ };
263
+ const WithAvatarAdornment = exports.WithAvatarAdornment = {
264
+ args: {
265
+ active: false,
266
+ adornment: {
267
+ type: _constants.ADORNMENT_TYPES.AVATAR,
268
+ props: {
269
+ initials: 'JD'
270
+ }
271
+ },
272
+ children: 'John Doe',
273
+ disabled: false,
274
+ size: _constants.CHIP_SIZES.MEDIUM,
275
+ variant: _constants.CHIP_VARIANT.DEFAULT,
276
+ isDragging: false
277
+ }
278
+ };
279
+ const WithImageAdornment = exports.WithImageAdornment = {
280
+ args: {
281
+ active: false,
282
+ adornment: {
283
+ type: _constants.ADORNMENT_TYPES.IMAGE,
284
+ props: {
285
+ src: 'https://widergy.com/wp-content/uploads/2021/12/cropped-favicon-32x32.png'
286
+ }
287
+ },
288
+ disabled: false,
289
+ size: _constants.CHIP_SIZES.MEDIUM,
290
+ variant: _constants.CHIP_VARIANT.DEFAULT,
291
+ isDragging: false
292
+ }
293
+ };
294
+ const SmallOutlineInteractive = exports.SmallOutlineInteractive = {
295
+ args: {
296
+ active: false,
297
+ disabled: false,
298
+ onClick: () => alert('Filter clicked'),
299
+ onClose: () => alert('Filter removed'),
300
+ size: _constants.CHIP_SIZES.SMALL,
301
+ variant: _constants.CHIP_VARIANT.OUTLINE,
302
+ isDragging: false
303
+ },
304
+ name: 'Small Outline Interactive'
305
+ };
306
+ const Dragging = exports.Dragging = {
307
+ args: {
308
+ active: false,
309
+ disabled: false,
310
+ isDragging: true,
311
+ onClick: () => alert('Chip clicked'),
312
+ onClose: () => alert('Chip closed'),
313
+ size: _constants.CHIP_SIZES.MEDIUM,
314
+ variant: _constants.CHIP_VARIANT.DEFAULT
315
+ }
316
+ };
317
+ const AllVariants = exports.AllVariants = {
318
+ render: () => /*#__PURE__*/_react.default.createElement("div", {
319
+ style: {
320
+ display: 'flex',
321
+ gap: '8px',
322
+ flexWrap: 'wrap'
323
+ }
324
+ }, /*#__PURE__*/_react.default.createElement(_.default, {
325
+ variant: _constants.CHIP_VARIANT.DEFAULT,
326
+ size: _constants.CHIP_SIZES.MEDIUM
327
+ }, "Default Medium"), /*#__PURE__*/_react.default.createElement(_.default, {
328
+ variant: _constants.CHIP_VARIANT.DEFAULT,
329
+ size: _constants.CHIP_SIZES.SMALL
330
+ }, "Default Small"), /*#__PURE__*/_react.default.createElement(_.default, {
331
+ variant: _constants.CHIP_VARIANT.OUTLINE,
332
+ size: _constants.CHIP_SIZES.MEDIUM
333
+ }, "Outline Medium"), /*#__PURE__*/_react.default.createElement(_.default, {
334
+ variant: _constants.CHIP_VARIANT.OUTLINE,
335
+ size: _constants.CHIP_SIZES.SMALL
336
+ }, "Outline Small"), /*#__PURE__*/_react.default.createElement(_.default, {
337
+ active: true,
338
+ variant: _constants.CHIP_VARIANT.DEFAULT,
339
+ size: _constants.CHIP_SIZES.MEDIUM
340
+ }, "Active Default"), /*#__PURE__*/_react.default.createElement(_.default, {
341
+ active: true,
342
+ variant: _constants.CHIP_VARIANT.OUTLINE,
343
+ size: _constants.CHIP_SIZES.MEDIUM
344
+ }, "Active Outline"), /*#__PURE__*/_react.default.createElement(_.default, {
345
+ disabled: true,
346
+ variant: _constants.CHIP_VARIANT.DEFAULT,
347
+ size: _constants.CHIP_SIZES.MEDIUM
348
+ }, "Disabled"))
349
+ };
350
+ const TagList = exports.TagList = {
351
+ render: () => {
352
+ const tags = ['React', 'JavaScript', 'UI Components'];
353
+ return /*#__PURE__*/_react.default.createElement("div", {
354
+ style: {
355
+ display: 'flex',
356
+ gap: '8px',
357
+ flexWrap: 'wrap'
358
+ }
359
+ }, tags.map(tag => /*#__PURE__*/_react.default.createElement(_.default, {
360
+ key: tag,
361
+ onClick: () => alert("Selected: ".concat(tag)),
362
+ onClose: () => alert("Removed: ".concat(tag)),
363
+ size: _constants.CHIP_SIZES.SMALL,
364
+ variant: _constants.CHIP_VARIANT.OUTLINE
365
+ }, tag)));
366
+ }
367
+ };
368
+ const FilterChips = exports.FilterChips = {
369
+ render: () => {
370
+ const filters = ['Active', 'Pending', 'Completed'];
371
+ return /*#__PURE__*/_react.default.createElement("div", {
372
+ style: {
373
+ display: 'flex',
374
+ gap: '8px',
375
+ flexWrap: 'wrap'
376
+ }
377
+ }, filters.map((filter, index) => /*#__PURE__*/_react.default.createElement(_.default, {
378
+ key: filter,
379
+ active: index === 0,
380
+ onClick: () => alert("Filter: ".concat(filter)),
381
+ size: _constants.CHIP_SIZES.MEDIUM,
382
+ variant: _constants.CHIP_VARIANT.DEFAULT
383
+ }, filter)));
384
+ }
385
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CHIP_VARIANT = exports.CHIP_SIZES = exports.ADORNMENT_TYPES = exports.ADORNMENT_COMPONENT_MAPPER = void 0;
7
+ var _UTIcon = _interopRequireDefault(require("../UTIcon"));
8
+ var _UTAvatar = _interopRequireDefault(require("../UTAvatar"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const CHIP_VARIANT = exports.CHIP_VARIANT = {
11
+ DEFAULT: 'default',
12
+ OUTLINE: 'outline'
13
+ };
14
+ const CHIP_SIZES = exports.CHIP_SIZES = {
15
+ MEDIUM: 'medium',
16
+ SMALL: 'small'
17
+ };
18
+ const ADORNMENT_TYPES = exports.ADORNMENT_TYPES = {
19
+ ICON: 'icon',
20
+ AVATAR: 'avatar',
21
+ IMAGE: 'image'
22
+ };
23
+ const ADORNMENT_COMPONENT_MAPPER = exports.ADORNMENT_COMPONENT_MAPPER = {
24
+ [ADORNMENT_TYPES.ICON]: _UTIcon.default,
25
+ [ADORNMENT_TYPES.AVATAR]: _UTAvatar.default,
26
+ [ADORNMENT_TYPES.IMAGE]: 'img'
27
+ };
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _propTypes = require("prop-types");
9
+ var _UTButton = _interopRequireDefault(require("../UTButton"));
10
+ var _UTLabel = _interopRequireDefault(require("../UTLabel"));
11
+ var _utils = require("./utils");
12
+ var _constants = require("./constants");
13
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
17
+ const UTChip = _ref => {
18
+ let {
19
+ active,
20
+ adornment,
21
+ children,
22
+ dataTestId,
23
+ disabled,
24
+ isDragging,
25
+ onClick,
26
+ onClose,
27
+ size = _constants.CHIP_SIZES.MEDIUM,
28
+ variant = _constants.CHIP_VARIANT.DEFAULT
29
+ } = _ref;
30
+ const {
31
+ Adornment,
32
+ adornmentProps,
33
+ buttonProps,
34
+ Container,
35
+ containerProps,
36
+ labelProps
37
+ } = (0, _utils.getItemsProps)({
38
+ active,
39
+ adornment,
40
+ dataTestId,
41
+ disabled,
42
+ isDragging,
43
+ onClick,
44
+ size,
45
+ variant
46
+ });
47
+ const handleClose = onClose ? e => {
48
+ e.stopPropagation();
49
+ onClose(e);
50
+ } : undefined;
51
+ return /*#__PURE__*/_react.default.createElement(Container, _extends({
52
+ className: "\n ".concat(_stylesModule.default.chipContainer, "\n ").concat(_stylesModule.default[size], "\n ").concat(_stylesModule.default[variant], "\n ").concat(active ? _stylesModule.default.active : '', "\n ").concat(disabled ? _stylesModule.default.disabled : '', "\n ").concat(isDragging ? _stylesModule.default.dragging : '', "\n ").concat(onClick && !disabled ? _stylesModule.default.interactive : _stylesModule.default.nonInteractive, "\n ")
53
+ }, containerProps), Adornment && /*#__PURE__*/_react.default.createElement(Adornment, adornmentProps), /*#__PURE__*/_react.default.createElement(_UTLabel.default, labelProps, children), handleClose && /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({}, buttonProps, {
54
+ Icon: "IconX",
55
+ onClick: handleClose,
56
+ size: "small",
57
+ variant: "text"
58
+ })));
59
+ };
60
+ UTChip.propTypes = {
61
+ active: _propTypes.bool,
62
+ adornment: (0, _propTypes.shape)({
63
+ props: _propTypes.object,
64
+ type: (0, _propTypes.oneOf)([_constants.ADORNMENT_TYPES.ICON, _constants.ADORNMENT_TYPES.AVATAR, _constants.ADORNMENT_TYPES.IMAGE])
65
+ }),
66
+ dataTestId: _propTypes.string,
67
+ disabled: _propTypes.bool,
68
+ isDragging: _propTypes.bool,
69
+ onClick: _propTypes.func,
70
+ onClose: _propTypes.func,
71
+ size: (0, _propTypes.oneOf)([_constants.CHIP_SIZES.MEDIUM, _constants.CHIP_SIZES.SMALL]),
72
+ variant: (0, _propTypes.oneOf)([_constants.CHIP_VARIANT.DEFAULT, _constants.CHIP_VARIANT.OUTLINE])
73
+ };
74
+ var _default = exports.default = /*#__PURE__*/(0, _react.memo)(UTChip);
@@ -0,0 +1,107 @@
1
+ .chipContainer {
2
+ align-items: center;
3
+ border-style: solid;
4
+ border-radius: 30px;
5
+ border-width: 1px;
6
+ display: flex;
7
+ flex-direction: row;
8
+ flex-shrink: 0;
9
+ grid-gap: 8px;
10
+ transition:
11
+ background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
12
+ box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
13
+ border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
14
+ color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
15
+ opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
16
+ width: fit-content;
17
+ }
18
+
19
+ .small {
20
+ padding: 4px 8px;
21
+ }
22
+
23
+ .medium {
24
+ padding: 8px 12px;
25
+ }
26
+
27
+ .interactive {
28
+ cursor: pointer;
29
+ }
30
+
31
+ .nonInteractive {
32
+ cursor: default;
33
+ }
34
+
35
+ .default {
36
+ background-color: var(--light03);
37
+ border-color: transparent;
38
+
39
+ &:not(.disabled) {
40
+ &:hover {
41
+ background-color: var(--light04);
42
+ }
43
+
44
+ &.interactive {
45
+ &:active {
46
+ background-color: var(--light05);
47
+ }
48
+ }
49
+
50
+ &.dragging {
51
+ background-color: var(--light01);
52
+ box-shadow: 0 4px 4px 0px rgba(0, 0, 0, 0.25);
53
+ }
54
+
55
+ &:not(.dragging) {
56
+ &.active {
57
+ background-color: var(--actionAccent04);
58
+ }
59
+ }
60
+ }
61
+
62
+ &.disabled {
63
+ background-color: var(--light03);
64
+ opacity: 0.5;
65
+ }
66
+ }
67
+
68
+ .outline {
69
+ background-color: transparent;
70
+ border-color: var(--light04);
71
+
72
+ &:not(.disabled) {
73
+ &:hover {
74
+ background-color: var(--light02);
75
+ }
76
+
77
+ &.interactive {
78
+ &:active {
79
+ background-color: var(--light03);
80
+ border-color: transparent;
81
+ }
82
+ }
83
+
84
+ &.dragging {
85
+ background-color: var(--light01);
86
+ box-shadow: 0 4px 4px 0px rgba(0, 0, 0, 0.25);
87
+ }
88
+
89
+ &:not(.dragging) {
90
+ &.active {
91
+ background-color: var(--actionAccent01);
92
+ border-color: var(--actionAccent02);
93
+ }
94
+ }
95
+ }
96
+
97
+ &.disabled {
98
+ border-color: var(--light04);
99
+ opacity: 0.5;
100
+ }
101
+ }
102
+
103
+ .imageAdornment {
104
+ height: 24px;
105
+ object-fit: cover;
106
+ width: 24px;
107
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTextVariant = exports.getTextColorTheme = exports.getItemsProps = exports.getDefaultAdornmentProps = exports.getButtonColorTheme = void 0;
7
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
8
+ var _Palette = require("../../constants/Palette");
9
+ var _constants = require("../UTLabel/constants");
10
+ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../UTTouchableWithoutFeedback"));
11
+ var _constants2 = require("./constants");
12
+ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ const getTextColorTheme = _ref => {
15
+ let {
16
+ active,
17
+ disabled,
18
+ isDragging,
19
+ variant
20
+ } = _ref;
21
+ if (active && !disabled && !isDragging) return variant === _constants2.CHIP_VARIANT.DEFAULT ? _Palette.COLOR_THEMES.light : _Palette.COLOR_THEMES.accent;
22
+ return _Palette.COLOR_THEMES.gray;
23
+ };
24
+ exports.getTextColorTheme = getTextColorTheme;
25
+ const getButtonColorTheme = _ref2 => {
26
+ let {
27
+ active,
28
+ disabled,
29
+ isDragging,
30
+ variant
31
+ } = _ref2;
32
+ if (active && !disabled && !isDragging) return variant === _constants2.CHIP_VARIANT.DEFAULT ? _Palette.COLOR_THEMES.negative : _Palette.COLOR_THEMES.primary;
33
+ return _Palette.COLOR_THEMES.gray;
34
+ };
35
+ exports.getButtonColorTheme = getButtonColorTheme;
36
+ const getTextVariant = size => size === _constants2.CHIP_SIZES.SMALL ? _constants.VARIANTS_NAMES.SMALL : _constants.VARIANTS_NAMES.BODY;
37
+ exports.getTextVariant = getTextVariant;
38
+ const getDefaultAdornmentProps = _ref3 => {
39
+ var _adornment$props;
40
+ let {
41
+ active,
42
+ adornment,
43
+ disabled,
44
+ isDragging,
45
+ variant
46
+ } = _ref3;
47
+ if ((0, _isEmpty.default)(adornment) || !adornment.type) return {};
48
+ if (adornment.type === _constants2.ADORNMENT_TYPES.ICON) return {
49
+ ...adornment.props,
50
+ colorTheme: getTextColorTheme({
51
+ active,
52
+ disabled,
53
+ isDragging,
54
+ variant
55
+ }),
56
+ size: 20
57
+ };
58
+ if (adornment.type === _constants2.ADORNMENT_TYPES.AVATAR) return {
59
+ ...adornment.props,
60
+ size: 'small'
61
+ };
62
+ if (adornment.type === _constants2.ADORNMENT_TYPES.IMAGE) return {
63
+ ...adornment.props,
64
+ className: "".concat(_stylesModule.default.imageAdornment, " ").concat(((_adornment$props = adornment.props) === null || _adornment$props === void 0 ? void 0 : _adornment$props.className) || '')
65
+ };
66
+ return {};
67
+ };
68
+ exports.getDefaultAdornmentProps = getDefaultAdornmentProps;
69
+ const getItemsProps = _ref4 => {
70
+ let {
71
+ active,
72
+ adornment,
73
+ dataTestId,
74
+ disabled,
75
+ isDragging,
76
+ onClick,
77
+ size,
78
+ variant
79
+ } = _ref4;
80
+ return {
81
+ Adornment: adornment !== null && adornment !== void 0 && adornment.type ? _constants2.ADORNMENT_COMPONENT_MAPPER[adornment === null || adornment === void 0 ? void 0 : adornment.type] : null,
82
+ adornmentProps: getDefaultAdornmentProps({
83
+ active,
84
+ adornment,
85
+ disabled,
86
+ variant
87
+ }),
88
+ Container: onClick && !disabled ? _UTTouchableWithoutFeedback.default : 'div',
89
+ containerProps: onClick && !disabled ? {
90
+ onClick,
91
+ dataTestId
92
+ } : {
93
+ 'data-testid': dataTestId
94
+ },
95
+ labelProps: {
96
+ colorTheme: getTextColorTheme({
97
+ active,
98
+ disabled,
99
+ isDragging,
100
+ variant
101
+ }),
102
+ variant: getTextVariant(size)
103
+ },
104
+ buttonProps: {
105
+ colorTheme: getButtonColorTheme({
106
+ active,
107
+ disabled,
108
+ isDragging,
109
+ variant
110
+ })
111
+ }
112
+ };
113
+ };
114
+ exports.getItemsProps = getItemsProps;
@@ -5,6 +5,7 @@
5
5
  white-space: pre-line;
6
6
 
7
7
  &:before {
8
+ background: var(--gray01);
8
9
  border-radius: 3;
9
10
  content: '';
10
11
  display: block;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EXTENSION_ICON = exports.DEFAULT_ICON = void 0;
7
+ const EXTENSION_ICON = exports.EXTENSION_ICON = {
8
+ doc: 'IconFileTypeDoc',
9
+ docx: 'IconFileTypeDocx',
10
+ jpg: 'IconFileTypeJpg',
11
+ pdf: 'IconFileTypePdf',
12
+ txt: 'IconFileTypeTxt',
13
+ xls: 'IconFileTypeXls',
14
+ xml: 'IconFileTypeXml',
15
+ zip: 'IconFileTypeZip'
16
+ };
17
+ const DEFAULT_ICON = exports.DEFAULT_ICON = 'IconFile';
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = require("prop-types");
9
- var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
9
+ var _UTChip = _interopRequireDefault(require("../../../../../UTChip"));
10
10
  var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
11
+ var _utils = require("./utils");
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
14
  const Citation = _ref => {
@@ -15,9 +16,16 @@ const Citation = _ref => {
15
16
  label,
16
17
  url
17
18
  } = _ref;
18
- return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
19
- colorTheme: "secondary",
20
- onClick: () => window.open(url, '_blank', 'noopener,noreferrer'),
19
+ const onClick = () => window.open(url, '_blank', 'noopener,noreferrer');
20
+ const icon = (0, _utils.getIcon)(label, url);
21
+ return /*#__PURE__*/_react.default.createElement(_UTChip.default, {
22
+ adornment: {
23
+ props: {
24
+ name: icon
25
+ },
26
+ type: 'icon'
27
+ },
28
+ onClick: onClick,
21
29
  size: "small"
22
30
  }, label);
23
31
  };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getIcon = void 0;
7
+ var _constants = require("./constants");
8
+ const getFileExtension = str => {
9
+ if (!str) return null;
10
+ const match = str.match(/\.([a-zA-Z0-9]+)(?:\?|$)/);
11
+ return match ? match[1].toLowerCase() : null;
12
+ };
13
+ const getIcon = (label, url) => {
14
+ const extension = getFileExtension(label) || getFileExtension(url);
15
+ const icon = extension && _constants.EXTENSION_ICON[extension] || _constants.DEFAULT_ICON;
16
+ return icon;
17
+ };
18
+ exports.getIcon = getIcon;
@@ -5,21 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _propTypes = require("prop-types");
9
8
  var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
10
9
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
11
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
11
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
12
  const CitationGroup = _ref => {
14
13
  let {
15
- children,
16
- classes
14
+ children
17
15
  } = _ref;
16
+ const [isHovered, setIsHovered] = (0, _react.useState)(false);
18
17
  return /*#__PURE__*/_react.default.createElement("div", {
19
- className: "".concat(_stylesModule.default.citationGroup, " ").concat(classes.citationGroup)
18
+ className: "".concat(_stylesModule.default.citationGroup, " ").concat(isHovered ? _stylesModule.default.isHovered : ''),
19
+ onMouseEnter: () => setIsHovered(true),
20
+ onMouseLeave: () => setIsHovered(false)
20
21
  }, children);
21
22
  };
22
- CitationGroup.propTypes = {
23
- classes: (0, _propTypes.objectOf)(_propTypes.string)
24
- };
25
23
  var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(CitationGroup));
@@ -8,15 +8,22 @@
8
8
  scroll-behavior: smooth;
9
9
  scroll-snap-type: x mandatory;
10
10
 
11
- button {
12
- flex: 0 0 auto;
13
- }
14
-
15
11
  &::-webkit-scrollbar {
16
12
  height: 8px;
17
13
  }
18
14
 
19
- &::-webkit-scrollbar * {
15
+ &::-webkit-scrollbar-track {
20
16
  background-color: transparent;
21
17
  }
18
+
19
+ &::-webkit-scrollbar-thumb {
20
+ background-color: transparent;
21
+ border-radius: 4px;
22
+ }
23
+
24
+ &.isHovered {
25
+ &::-webkit-scrollbar-thumb {
26
+ background-color: var(--light05);
27
+ }
28
+ }
22
29
  }
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = require("prop-types");
9
9
  var _UTIcon = _interopRequireDefault(require("../../../../../UTIcon"));
10
10
  var _WithCustomHandler = _interopRequireDefault(require("../WithCustomHandler"));
11
+ var _utils = require("../../utils");
11
12
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -15,7 +16,6 @@ const ListItem = _ref => {
15
16
  var _node$properties;
16
17
  let {
17
18
  children,
18
- classes,
19
19
  node,
20
20
  ...props
21
21
  } = _ref;
@@ -36,18 +36,17 @@ const ListItem = _ref => {
36
36
  }), /*#__PURE__*/_react.default.createElement("span", {
37
37
  className: _stylesModule.default.itemContentChecked
38
38
  }, contentNodes)) : /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
39
- className: "".concat(_stylesModule.default.taskItemIconUnchecked, " ").concat(classes === null || classes === void 0 ? void 0 : classes.taskItemIconUnchecked)
39
+ className: _stylesModule.default.taskItemIconUnchecked
40
40
  }), /*#__PURE__*/_react.default.createElement("span", null, contentNodes)));
41
41
  }
42
42
  const safeChildren = Array.isArray(children) ? children : children ? [children] : [];
43
43
  const mergedProps = {
44
- ...props,
44
+ ...(0, _utils.cleanElementProps)(props),
45
45
  ...((node === null || node === void 0 ? void 0 : node.properties) || {})
46
46
  };
47
47
  return /*#__PURE__*/_react.default.createElement('li', mergedProps, safeChildren);
48
48
  };
49
49
  ListItem.propTypes = {
50
- classes: (0, _propTypes.objectOf)(_propTypes.string),
51
50
  node: _propTypes.object
52
51
  };
53
52
  var _default = exports.default = /*#__PURE__*/(0, _react.memo)((0, _WithCustomHandler.default)(ListItem));
@@ -7,9 +7,8 @@
7
7
  }
8
8
 
9
9
  .taskItemIconUnchecked {
10
+ border: 1px solid var(--gray01);
10
11
  border-radius: 50%;
11
- border-style: solid;
12
- border-width: 1px;
13
12
  box-sizing: border-box;
14
13
  display: inline-block;
15
14
  flex-shrink: 0;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = require("prop-types");
9
+ var _utils = require("../../utils");
9
10
  var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -20,7 +21,7 @@ const Section = _ref => {
20
21
  } = _ref;
21
22
  const isFootnotesSection = (node === null || node === void 0 || (_node$properties = node.properties) === null || _node$properties === void 0 ? void 0 : _node$properties.dataFootnotes) !== undefined;
22
23
  if (!isFootnotesSection) {
23
- return /*#__PURE__*/_react.default.createElement('section', props, children);
24
+ return /*#__PURE__*/_react.default.createElement('section', (0, _utils.cleanElementProps)(props), children);
24
25
  }
25
26
  const reactChildren = _react.default.Children.toArray(children);
26
27
  const ol = reactChildren.find(c => (c === null || c === void 0 ? void 0 : c.type) === 'ol');
@@ -27,8 +27,7 @@ var _default = () => {
27
27
  const getText = n => {
28
28
  if (n.type === _constants.NODE_TYPES.TEXT) return n.value || '';
29
29
  if (n.type === _constants.NODE_TYPES.LINK) {
30
- const inner = Array.isArray(n.children) ? n.children.map(getText).join('') : '';
31
- return inner + (n.url || '');
30
+ return Array.isArray(n.children) ? n.children.map(getText).join('') : '';
32
31
  }
33
32
  if (Array.isArray(n.children)) return n.children.map(getText).join('');
34
33
  return '';
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getMarkdownPlugins = void 0;
6
+ exports.getMarkdownPlugins = exports.cleanElementProps = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
8
9
  var _constants = require("./constants");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
11
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
@@ -36,4 +37,12 @@ const getMarkdownPlugins = function (classes, markdownExtended) {
36
37
  remarkPlugins
37
38
  };
38
39
  };
39
- exports.getMarkdownPlugins = getMarkdownPlugins;
40
+ exports.getMarkdownPlugins = getMarkdownPlugins;
41
+ const cleanElementProps = function () {
42
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
+ if ((0, _isEmpty.default)(props)) return {};
44
+ if (props.markdownExtended) delete props.markdownExtended;
45
+ if (props.customHandler) delete props.customHandler;
46
+ return props;
47
+ };
48
+ exports.cleanElementProps = cleanElementProps;
@@ -3,43 +3,55 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WEIGHTS = exports.VARIANTS_SIZES = exports.VARIANTS_LINE_HEIGHT = exports.VARIANTS = exports.DEFAULT_PROPS = void 0;
6
+ exports.WEIGHTS = exports.VARIANTS_SIZES = exports.VARIANTS_NAMES = exports.VARIANTS_LINE_HEIGHT = exports.VARIANTS = exports.DEFAULT_PROPS = void 0;
7
7
  var _Palette = require("../../constants/Palette");
8
+ const VARIANTS_NAMES = exports.VARIANTS_NAMES = {
9
+ TITLE1: 'title1',
10
+ TITLE2: 'title2',
11
+ TITLE3: 'title3',
12
+ SUBTITLE1: 'subtitle1',
13
+ SUBTITLE2: 'subtitle2',
14
+ BODY: 'body',
15
+ SMALL: 'small',
16
+ XSMALL: 'xsmall',
17
+ TH: 'th',
18
+ TD: 'td'
19
+ };
8
20
  const VARIANTS = exports.VARIANTS = {
9
- title1: 'h1',
10
- title2: 'h2',
11
- title3: 'h3',
12
- subtitle1: 'h4',
13
- subtitle2: 'h5',
14
- body: 'div',
15
- small: 'div',
16
- xsmall: 'div',
17
- th: 'th',
18
- td: 'td'
21
+ [VARIANTS_NAMES.TITLE1]: 'h1',
22
+ [VARIANTS_NAMES.TITLE2]: 'h2',
23
+ [VARIANTS_NAMES.TITLE3]: 'h3',
24
+ [VARIANTS_NAMES.SUBTITLE1]: 'h4',
25
+ [VARIANTS_NAMES.SUBTITLE2]: 'h5',
26
+ [VARIANTS_NAMES.BODY]: 'div',
27
+ [VARIANTS_NAMES.SMALL]: 'div',
28
+ [VARIANTS_NAMES.XSMALL]: 'div',
29
+ [VARIANTS_NAMES.TH]: 'th',
30
+ [VARIANTS_NAMES.TD]: 'td'
19
31
  };
20
32
  const VARIANTS_SIZES = exports.VARIANTS_SIZES = {
21
- title1: '1.875rem',
22
- title2: '1.5rem',
23
- title3: '1.375rem',
24
- subtitle1: '1.125rem',
25
- subtitle2: '1rem',
26
- body: '1rem',
27
- small: '0.875rem',
28
- xsmall: '0.75rem',
29
- th: '1rem',
30
- td: '1rem'
33
+ [VARIANTS_NAMES.TITLE1]: '1.875rem',
34
+ [VARIANTS_NAMES.TITLE2]: '1.5rem',
35
+ [VARIANTS_NAMES.TITLE3]: '1.375rem',
36
+ [VARIANTS_NAMES.SUBTITLE1]: '1.125rem',
37
+ [VARIANTS_NAMES.SUBTITLE2]: '1rem',
38
+ [VARIANTS_NAMES.BODY]: '1rem',
39
+ [VARIANTS_NAMES.SMALL]: '0.875rem',
40
+ [VARIANTS_NAMES.XSMALL]: '0.75rem',
41
+ [VARIANTS_NAMES.TH]: '1rem',
42
+ [VARIANTS_NAMES.TD]: '1rem'
31
43
  };
32
44
  const VARIANTS_LINE_HEIGHT = exports.VARIANTS_LINE_HEIGHT = {
33
- title1: '100%',
34
- title2: '100%',
35
- title3: '100%',
36
- subtitle1: '100%',
37
- subtitle2: '1.375rem',
38
- body: '1.375rem',
39
- small: '1.25rem',
40
- xsmall: '1.125rem',
41
- th: '1.375rem',
42
- td: '1.375rem'
45
+ [VARIANTS_NAMES.TITLE1]: '100%',
46
+ [VARIANTS_NAMES.TITLE2]: '100%',
47
+ [VARIANTS_NAMES.TITLE3]: '100%',
48
+ [VARIANTS_NAMES.SUBTITLE1]: '100%',
49
+ [VARIANTS_NAMES.SUBTITLE2]: '1.375rem',
50
+ [VARIANTS_NAMES.BODY]: '1.375rem',
51
+ [VARIANTS_NAMES.SMALL]: '1.25rem',
52
+ [VARIANTS_NAMES.XSMALL]: '1.125rem',
53
+ [VARIANTS_NAMES.TH]: '1.375rem',
54
+ [VARIANTS_NAMES.TD]: '1.375rem'
43
55
  };
44
56
  const WEIGHTS = exports.WEIGHTS = {
45
57
  thin: 100,
@@ -197,23 +197,12 @@ const retrieveStyle = _ref2 => {
197
197
  }
198
198
  },
199
199
  blockquote: {
200
- color: grayTextColor,
201
- '&::before': {
202
- background: theme.Palette[_Palette.COLOR_THEMES.gray][_Palette.COLOR_SHADES.shade01]
203
- }
204
- },
205
- citationGroup: {
206
- '&::-webkit-scrollbar-thumb': {
207
- backgroundColor: theme.Palette[_Palette.COLOR_THEMES.gray][_Palette.COLOR_SHADES.shade04]
208
- }
200
+ color: grayTextColor
209
201
  },
210
202
  customFootnotes: {
211
203
  '& span': {
212
204
  color: grayTextColor
213
205
  }
214
- },
215
- taskItemIconUnchecked: {
216
- borderColor: theme.Palette[_Palette.COLOR_THEMES.gray][_Palette.COLOR_SHADES.shade01]
217
206
  }
218
207
  };
219
208
  };
@@ -162,7 +162,7 @@ const propTypes = exports.propTypes = {
162
162
  classNames: (0, _propTypes.objectOf)(_propTypes.string),
163
163
  dataTestId: _propTypes.string,
164
164
  disabled: _propTypes.bool,
165
- error: _propTypes.bool,
165
+ error: (0, _propTypes.oneOfType)([_propTypes.bool, _propTypes.string]),
166
166
  helpText: _propTypes.string,
167
167
  helperTextDataTestId: _propTypes.string,
168
168
  id: _propTypes.string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widergy/energy-ui",
3
- "version": "3.125.1",
3
+ "version": "3.127.0",
4
4
  "description": "Widergy Web Components",
5
5
  "author": "widergy",
6
6
  "license": "MIT",