tharaday 0.7.3 → 0.7.5
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/ds.css +1 -1
- package/dist/ds.js +665 -643
- package/dist/ds.umd.cjs +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.tsx +13 -5
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.tsx +2 -2
- package/src/components/Box/Box.tsx +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Card/Card.tsx +5 -5
- package/src/components/Checkbox/Checkbox.module.css +2 -1
- package/src/components/Checkbox/Checkbox.tsx +4 -4
- package/src/components/Divider/Divider.tsx +3 -3
- package/src/components/Dropdown/Dropdown.module.css +1 -0
- package/src/components/Dropdown/Dropdown.tsx +5 -5
- package/src/components/Header/Header.tsx +4 -4
- package/src/components/Input/Input.tsx +4 -4
- package/src/components/List/List.tsx +2 -2
- package/src/components/List/ListItem.tsx +2 -2
- package/src/components/Loader/Loader.tsx +2 -2
- package/src/components/Modal/Modal.tsx +2 -2
- package/src/components/NavBar/NavBar.tsx +3 -3
- package/src/components/Notification/Notification.tsx +2 -2
- package/src/components/Pagination/Pagination.tsx +2 -2
- package/src/components/ProgressBar/ProgressBar.tsx +5 -2
- package/src/components/RadioButton/RadioButton.tsx +5 -5
- package/src/components/Select/Select.tsx +4 -4
- package/src/components/Skeleton/Skeleton.tsx +2 -2
- package/src/components/Slider/Slider.tsx +8 -6
- package/src/components/Stepper/Step.tsx +6 -4
- package/src/components/Stepper/Stepper.tsx +2 -2
- package/src/components/Switch/Switch.tsx +6 -3
- package/src/components/Table/Table.tsx +9 -9
- package/src/components/Tabs/Tabs.tsx +4 -4
- package/src/components/Text/Text.tsx +2 -2
- package/src/components/Textarea/Textarea.tsx +4 -4
- package/src/components/Tooltip/Tooltip.module.css +6 -6
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/Tree/Tree.tsx +2 -2
- package/src/components/Tree/TreeItem.tsx +2 -2
- package/src/layouts/AppLayout/AppLayout.tsx +2 -2
- package/src/layouts/AuthLayout/AuthLayout.tsx +2 -2
- package/src/layouts/DashboardLayout/DashboardLayout.tsx +2 -2
- package/src/layouts/SettingsLayout/SettingsLayout.tsx +2 -2
- package/src/styles/ds.css +14 -9
- package/src/styles/palette.css +71 -0
- package/src/styles/themes/dark.css +35 -35
- package/src/styles/themes/light.css +35 -35
- package/src/styles/themes/retro-dark.css +35 -35
- package/src/styles/themes/retro-light.css +35 -35
- package/src/styles/themes/retro-palette.css +85 -0
- package/src/styles/themes/sanzo-152-dark.css +35 -35
- package/src/styles/themes/sanzo-152-light.css +35 -35
- package/src/styles/themes/sanzo-152-palette.css +66 -0
- package/src/styles/tokens.css +7 -232
- package/src/styles/semantic.css +0 -59
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId, useState, useRef, useEffect, type KeyboardEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Dropdown.module.css';
|
|
@@ -154,7 +154,7 @@ export const Dropdown = ({
|
|
|
154
154
|
|
|
155
155
|
return (
|
|
156
156
|
<div
|
|
157
|
-
className={
|
|
157
|
+
className={classnames(
|
|
158
158
|
styles.wrapper,
|
|
159
159
|
styles[size],
|
|
160
160
|
fullWidth && styles.fullWidth,
|
|
@@ -173,7 +173,7 @@ export const Dropdown = ({
|
|
|
173
173
|
id={componentId}
|
|
174
174
|
ref={triggerRef}
|
|
175
175
|
type="button"
|
|
176
|
-
className={
|
|
176
|
+
className={classnames(styles.trigger, isOpen && styles.isOpen)}
|
|
177
177
|
onClick={toggleDropdown}
|
|
178
178
|
onKeyDown={handleKeyDown}
|
|
179
179
|
disabled={disabled}
|
|
@@ -222,7 +222,7 @@ export const Dropdown = ({
|
|
|
222
222
|
id={`${componentId}-opt-${index}`}
|
|
223
223
|
role="option"
|
|
224
224
|
aria-selected={isSelected}
|
|
225
|
-
className={
|
|
225
|
+
className={classnames(
|
|
226
226
|
styles.option,
|
|
227
227
|
isSelected && styles.optionSelected,
|
|
228
228
|
isFocused && styles.optionFocused,
|
|
@@ -242,7 +242,7 @@ export const Dropdown = ({
|
|
|
242
242
|
)}
|
|
243
243
|
</div>
|
|
244
244
|
{helperText && (
|
|
245
|
-
<span id={helperId} className={
|
|
245
|
+
<span id={helperId} className={classnames(styles.helperText, error && styles.errorText)}>
|
|
246
246
|
{helperText}
|
|
247
247
|
</span>
|
|
248
248
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import styles from './Header.module.css';
|
|
4
4
|
import type { HeaderProps } from './Header.types.ts';
|
|
@@ -19,13 +19,13 @@ export const Header = ({
|
|
|
19
19
|
const buttonProps = { size: 'sm', intent: 'info' } as ButtonProps;
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<header id={id} className={
|
|
22
|
+
<header id={id} className={classnames(styles.root, className)}>
|
|
23
23
|
<div className={styles.container} style={{ maxWidth }}>
|
|
24
|
-
<div className={
|
|
24
|
+
<div className={classnames(styles.sideContainer, styles.leftSide)}>
|
|
25
25
|
{logo}
|
|
26
26
|
{title ? <h1 className={styles.title}>{title}</h1> : null}
|
|
27
27
|
</div>
|
|
28
|
-
<div className={
|
|
28
|
+
<div className={classnames(styles.sideContainer, styles.rightSide)}>
|
|
29
29
|
{user ? (
|
|
30
30
|
<div className={styles.actions}>
|
|
31
31
|
<span className={styles.welcome}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Input.module.css';
|
|
@@ -19,7 +19,7 @@ export const Input = ({
|
|
|
19
19
|
const helperId = helperText ? `${componentId}-help` : undefined;
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
<div className={
|
|
22
|
+
<div className={classnames(styles.wrapper, fullWidth && styles.fullWidth, className)}>
|
|
23
23
|
{label && (
|
|
24
24
|
<label htmlFor={componentId} className={styles.label}>
|
|
25
25
|
{label}
|
|
@@ -27,13 +27,13 @@ export const Input = ({
|
|
|
27
27
|
)}
|
|
28
28
|
<input
|
|
29
29
|
id={componentId}
|
|
30
|
-
className={
|
|
30
|
+
className={classnames(styles.inputRoot, styles[size], error && styles.error)}
|
|
31
31
|
aria-describedby={helperId}
|
|
32
32
|
aria-invalid={error || undefined}
|
|
33
33
|
{...props}
|
|
34
34
|
/>
|
|
35
35
|
{helperText && (
|
|
36
|
-
<span id={helperId} className={
|
|
36
|
+
<span id={helperId} className={classnames(styles.helperText, error && styles.errorText)}>
|
|
37
37
|
{helperText}
|
|
38
38
|
</span>
|
|
39
39
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import type { CSSProperties } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './List.module.css';
|
|
@@ -57,7 +57,7 @@ export const List = ({
|
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
59
|
<Component
|
|
60
|
-
className={
|
|
60
|
+
className={classnames(
|
|
61
61
|
styles.root,
|
|
62
62
|
styles[variant],
|
|
63
63
|
typeof spacing === 'number' && styles[`gap-${spacing}`],
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import type { ListItemProps } from './ListItem.types';
|
|
3
3
|
import styles from './ListItem.module.css';
|
|
4
4
|
|
|
5
5
|
export const ListItem = ({ children, icon, className, ...props }: ListItemProps) => {
|
|
6
6
|
return (
|
|
7
|
-
<li className={
|
|
7
|
+
<li className={classnames(styles.item, className)} {...props}>
|
|
8
8
|
{icon && <span className={styles.iconWrapper}>{icon}</span>}
|
|
9
9
|
<div className={styles.content}>{children}</div>
|
|
10
10
|
</li>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import styles from './Loader.module.css';
|
|
4
4
|
import type { LoaderProps } from './Loader.types.ts';
|
|
@@ -7,7 +7,7 @@ export const Loader = ({ id, size = 'md', intent = 'neutral', className }: Loade
|
|
|
7
7
|
return (
|
|
8
8
|
<div
|
|
9
9
|
id={id}
|
|
10
|
-
className={
|
|
10
|
+
className={classnames(styles.loader, styles[size], styles[intent], className)}
|
|
11
11
|
role="status"
|
|
12
12
|
aria-label="Loading"
|
|
13
13
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useEffect, useRef, useId } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
|
|
@@ -86,7 +86,7 @@ export const Modal = ({
|
|
|
86
86
|
<div className={styles.overlay} onClick={() => !isLoading && onClose()}>
|
|
87
87
|
<div
|
|
88
88
|
id={componentId}
|
|
89
|
-
className={
|
|
89
|
+
className={classnames(styles.modal, styles[size], isLoading && styles.loading, className)}
|
|
90
90
|
onClick={(e) => e.stopPropagation()}
|
|
91
91
|
role="dialog"
|
|
92
92
|
aria-modal="true"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import styles from './NavBar.module.css';
|
|
4
4
|
import type { NavBarProps } from './NavBar.types.ts';
|
|
@@ -18,7 +18,7 @@ export const NavBar = ({
|
|
|
18
18
|
maxWidth,
|
|
19
19
|
}: NavBarProps) => {
|
|
20
20
|
return (
|
|
21
|
-
<nav id={id} className={
|
|
21
|
+
<nav id={id} className={classnames(styles.root, className)}>
|
|
22
22
|
<div className={styles.container} style={{ maxWidth }}>
|
|
23
23
|
{logo && <div className={styles.leftSection}>{logo}</div>}
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ export const NavBar = ({
|
|
|
28
28
|
<li key={item.id} className={styles.navItem}>
|
|
29
29
|
<button
|
|
30
30
|
type="button"
|
|
31
|
-
className={
|
|
31
|
+
className={classnames(
|
|
32
32
|
styles.navLink,
|
|
33
33
|
activeId === item.id && styles.active,
|
|
34
34
|
item.disabled && styles.disabled
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import styles from './Notification.module.css';
|
|
4
4
|
import type { NotificationProps } from './Notification.types.ts';
|
|
@@ -13,7 +13,7 @@ export const Notification = ({
|
|
|
13
13
|
...props
|
|
14
14
|
}: NotificationProps) => {
|
|
15
15
|
return (
|
|
16
|
-
<div className={
|
|
16
|
+
<div className={classnames(styles.root, styles[intent], className)} role="alert" {...props}>
|
|
17
17
|
<div className={styles.content}>
|
|
18
18
|
{title && <div className={styles.title}>{title}</div>}
|
|
19
19
|
<div className={styles.message}>{children}</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId, useMemo, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Pagination.module.css';
|
|
@@ -147,7 +147,7 @@ export const Pagination = ({
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
return (
|
|
150
|
-
<nav id={componentId} aria-label={ariaLabel} className={
|
|
150
|
+
<nav id={componentId} aria-label={ariaLabel} className={classnames(styles.root, className)}>
|
|
151
151
|
<ul className={styles.list}>
|
|
152
152
|
{showFirstLast && (
|
|
153
153
|
<li className={styles.item}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './ProgressBar.module.css';
|
|
@@ -22,7 +22,10 @@ export const ProgressBar = ({
|
|
|
22
22
|
const labelId = label ? `${componentId}-label` : undefined;
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<div
|
|
25
|
+
<div
|
|
26
|
+
id={componentId}
|
|
27
|
+
className={classnames(styles.wrapper, styles[size], styles[intent], className)}
|
|
28
|
+
>
|
|
26
29
|
{(label || showLabel) && (
|
|
27
30
|
<div className={styles.labelWrapper}>
|
|
28
31
|
{label && (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './RadioButton.module.css';
|
|
@@ -18,13 +18,13 @@ export const RadioButton = ({
|
|
|
18
18
|
const helperId = helperText ? `${componentId}-help` : undefined;
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<div className={
|
|
22
|
-
<label htmlFor={componentId} className={
|
|
21
|
+
<div className={classnames(styles.wrapper, className)}>
|
|
22
|
+
<label htmlFor={componentId} className={classnames(styles.label, styles[size])}>
|
|
23
23
|
<div className={styles.inputWrapper}>
|
|
24
24
|
<input
|
|
25
25
|
type="radio"
|
|
26
26
|
id={componentId}
|
|
27
|
-
className={
|
|
27
|
+
className={classnames(styles.radioRoot, styles[size], error && styles.error)}
|
|
28
28
|
aria-describedby={helperId}
|
|
29
29
|
aria-invalid={error || undefined}
|
|
30
30
|
{...props}
|
|
@@ -34,7 +34,7 @@ export const RadioButton = ({
|
|
|
34
34
|
{label && <span className={styles.labelText}>{label}</span>}
|
|
35
35
|
</label>
|
|
36
36
|
{helperText && (
|
|
37
|
-
<span id={helperId} className={
|
|
37
|
+
<span id={helperId} className={classnames(styles.helperText, error && styles.errorText)}>
|
|
38
38
|
{helperText}
|
|
39
39
|
</span>
|
|
40
40
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Select.module.css';
|
|
@@ -21,7 +21,7 @@ export const Select = ({
|
|
|
21
21
|
const helperId = helperText ? `${componentId}-help` : undefined;
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<div className={
|
|
24
|
+
<div className={classnames(styles.wrapper, fullWidth && styles.fullWidth, className)}>
|
|
25
25
|
{label && (
|
|
26
26
|
<label htmlFor={componentId} className={styles.label}>
|
|
27
27
|
{label}
|
|
@@ -29,7 +29,7 @@ export const Select = ({
|
|
|
29
29
|
)}
|
|
30
30
|
<select
|
|
31
31
|
id={componentId}
|
|
32
|
-
className={
|
|
32
|
+
className={classnames(styles.selectRoot, styles[size], error && styles.error)}
|
|
33
33
|
aria-describedby={helperId}
|
|
34
34
|
aria-invalid={error || undefined}
|
|
35
35
|
{...props}
|
|
@@ -43,7 +43,7 @@ export const Select = ({
|
|
|
43
43
|
: children}
|
|
44
44
|
</select>
|
|
45
45
|
{helperText && (
|
|
46
|
-
<span id={helperId} className={
|
|
46
|
+
<span id={helperId} className={classnames(styles.helperText, error && styles.errorText)}>
|
|
47
47
|
{helperText}
|
|
48
48
|
</span>
|
|
49
49
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import styles from './Skeleton.module.css';
|
|
4
4
|
import type { SkeletonProps } from './Skeleton.types.ts';
|
|
@@ -16,7 +16,7 @@ export const Skeleton = ({
|
|
|
16
16
|
}: SkeletonProps) => {
|
|
17
17
|
return (
|
|
18
18
|
<Box
|
|
19
|
-
className={
|
|
19
|
+
className={classnames(
|
|
20
20
|
styles.root,
|
|
21
21
|
styles[variant],
|
|
22
22
|
animation !== 'none' && styles[animation],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId, useMemo, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Input } from '../Input/Input.tsx';
|
|
@@ -118,7 +118,7 @@ export const Slider = ({
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
return (
|
|
121
|
-
<div className={
|
|
121
|
+
<div className={classnames(styles.wrapper, fullWidth && styles.fullWidth, className)}>
|
|
122
122
|
{(label || showValue) && (
|
|
123
123
|
<div className={styles.header}>
|
|
124
124
|
{label && (
|
|
@@ -129,7 +129,9 @@ export const Slider = ({
|
|
|
129
129
|
{showValue && <span className={styles.value}>{showValueText}</span>}
|
|
130
130
|
</div>
|
|
131
131
|
)}
|
|
132
|
-
<div
|
|
132
|
+
<div
|
|
133
|
+
className={classnames(styles.sliderRoot, styles[size], props.disabled && styles.disabled)}
|
|
134
|
+
>
|
|
133
135
|
<div className={styles.track} />
|
|
134
136
|
<div
|
|
135
137
|
className={styles.activeTrack}
|
|
@@ -141,7 +143,7 @@ export const Slider = ({
|
|
|
141
143
|
<input
|
|
142
144
|
id={componentId}
|
|
143
145
|
type="range"
|
|
144
|
-
className={
|
|
146
|
+
className={classnames(styles.inputRoot, isDual && styles.inputStart)}
|
|
145
147
|
aria-describedby={helperId}
|
|
146
148
|
aria-label={!label ? (isDual ? 'Slider minimum' : 'Slider') : undefined}
|
|
147
149
|
aria-valuetext={showValue ? showValueText : undefined}
|
|
@@ -159,7 +161,7 @@ export const Slider = ({
|
|
|
159
161
|
<input
|
|
160
162
|
id={`${componentId}-end`}
|
|
161
163
|
type="range"
|
|
162
|
-
className={
|
|
164
|
+
className={classnames(styles.inputRoot, styles.inputEnd)}
|
|
163
165
|
aria-describedby={helperId}
|
|
164
166
|
aria-label={label ? `${label} maximum` : 'Slider maximum'}
|
|
165
167
|
{...props}
|
|
@@ -175,7 +177,7 @@ export const Slider = ({
|
|
|
175
177
|
)}
|
|
176
178
|
</div>
|
|
177
179
|
{showInputs && (
|
|
178
|
-
<div className={
|
|
180
|
+
<div className={classnames(styles.inputsRow, !isDual && styles.singleInputRow)}>
|
|
179
181
|
<Input
|
|
180
182
|
key={`slider-start-${startValue}-${endValue}`}
|
|
181
183
|
type="number"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import type { ElementType, KeyboardEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Step.module.css';
|
|
@@ -32,11 +32,13 @@ export const Step = ({
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<li
|
|
35
|
+
<li
|
|
36
|
+
className={classnames(styles.step, styles[status], isDisabled && styles.disabled, className)}
|
|
37
|
+
>
|
|
36
38
|
<StepContent
|
|
37
39
|
id={id}
|
|
38
40
|
type={isInteractive ? 'button' : undefined}
|
|
39
|
-
className={
|
|
41
|
+
className={classnames(styles.stepRow, isInteractive && styles.interactive)}
|
|
40
42
|
onClick={handleClick}
|
|
41
43
|
onKeyDown={handleKeyDown}
|
|
42
44
|
aria-current={status === 'current' ? 'step' : undefined}
|
|
@@ -54,7 +56,7 @@ export const Step = ({
|
|
|
54
56
|
</StepContent>
|
|
55
57
|
{!isLast && (
|
|
56
58
|
<span
|
|
57
|
-
className={
|
|
59
|
+
className={classnames(styles.connector, styles[`connector-${status}`])}
|
|
58
60
|
aria-hidden="true"
|
|
59
61
|
/>
|
|
60
62
|
)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Step } from './Step.tsx';
|
|
@@ -25,7 +25,7 @@ export const Stepper = ({
|
|
|
25
25
|
return (
|
|
26
26
|
<ol
|
|
27
27
|
id={componentId}
|
|
28
|
-
className={
|
|
28
|
+
className={classnames(styles.root, styles[orientation], styles[size], className)}
|
|
29
29
|
aria-label={listLabel}
|
|
30
30
|
data-orientation={orientation}
|
|
31
31
|
{...props}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Switch.module.css';
|
|
@@ -10,8 +10,11 @@ export const Switch = ({ label, helperText, className, disabled, id, ...props }:
|
|
|
10
10
|
const helperId = helperText ? `${componentId}-help` : undefined;
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
|
-
<div className={
|
|
14
|
-
<label
|
|
13
|
+
<div className={classnames(styles.wrapper, className)}>
|
|
14
|
+
<label
|
|
15
|
+
htmlFor={componentId}
|
|
16
|
+
className={classnames(styles.container, disabled && styles.disabled)}
|
|
17
|
+
>
|
|
15
18
|
<input
|
|
16
19
|
type="checkbox"
|
|
17
20
|
id={componentId}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
|
|
3
3
|
import styles from './Table.module.css';
|
|
4
4
|
import type {
|
|
@@ -21,9 +21,9 @@ export const Table = ({
|
|
|
21
21
|
...props
|
|
22
22
|
}: TableProps) => {
|
|
23
23
|
return (
|
|
24
|
-
<div className={
|
|
24
|
+
<div className={classnames(styles.wrapper, isLoading && styles.loading, className)}>
|
|
25
25
|
<table
|
|
26
|
-
className={
|
|
26
|
+
className={classnames(
|
|
27
27
|
styles.table,
|
|
28
28
|
striped && styles.striped,
|
|
29
29
|
hoverable && styles.hoverable,
|
|
@@ -39,37 +39,37 @@ export const Table = ({
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export const TableHeader = ({ children, className, ...props }: TableHeaderProps) => (
|
|
42
|
-
<thead className={
|
|
42
|
+
<thead className={classnames(styles.thead, className)} {...props}>
|
|
43
43
|
{children}
|
|
44
44
|
</thead>
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
export const TableBody = ({ children, className, ...props }: TableBodyProps) => (
|
|
48
|
-
<tbody className={
|
|
48
|
+
<tbody className={classnames(styles.tbody, className)} {...props}>
|
|
49
49
|
{children}
|
|
50
50
|
</tbody>
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
export const TableFooter = ({ children, className, ...props }: TableFooterProps) => (
|
|
54
|
-
<tfoot className={
|
|
54
|
+
<tfoot className={classnames(styles.tfoot, className)} {...props}>
|
|
55
55
|
{children}
|
|
56
56
|
</tfoot>
|
|
57
57
|
);
|
|
58
58
|
|
|
59
59
|
export const TableRow = ({ children, className, ...props }: TableRowProps) => (
|
|
60
|
-
<tr className={
|
|
60
|
+
<tr className={classnames(styles.tr, className)} {...props}>
|
|
61
61
|
{children}
|
|
62
62
|
</tr>
|
|
63
63
|
);
|
|
64
64
|
|
|
65
65
|
export const TableHead = ({ children, className, align, ...props }: TableHeadProps) => (
|
|
66
|
-
<th className={
|
|
66
|
+
<th className={classnames(styles.th, align && styles[`align-${align}`], className)} {...props}>
|
|
67
67
|
{children}
|
|
68
68
|
</th>
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
export const TableCell = ({ children, className, align, ...props }: TableCellProps) => (
|
|
72
|
-
<td className={
|
|
72
|
+
<td className={classnames(styles.td, align && styles[`align-${align}`], className)} {...props}>
|
|
73
73
|
{children}
|
|
74
74
|
</td>
|
|
75
75
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId, useState, useRef, type KeyboardEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Tabs.module.css';
|
|
@@ -64,11 +64,11 @@ export const Tabs = ({
|
|
|
64
64
|
const activeTab = items.find((item) => item.id === activeId);
|
|
65
65
|
|
|
66
66
|
return (
|
|
67
|
-
<div id={componentId} className={
|
|
67
|
+
<div id={componentId} className={classnames(styles.root, className)}>
|
|
68
68
|
<div
|
|
69
69
|
role="tablist"
|
|
70
70
|
ref={tabListRef}
|
|
71
|
-
className={
|
|
71
|
+
className={classnames(styles.tabList, variant === 'pill' && styles.pillList)}
|
|
72
72
|
onKeyDown={handleKeyDown}
|
|
73
73
|
>
|
|
74
74
|
{items.map((item) => {
|
|
@@ -86,7 +86,7 @@ export const Tabs = ({
|
|
|
86
86
|
tabIndex={tabIndex}
|
|
87
87
|
disabled={isDisabled}
|
|
88
88
|
data-id={item.id}
|
|
89
|
-
className={
|
|
89
|
+
className={classnames(
|
|
90
90
|
styles.tabItem,
|
|
91
91
|
variant === 'pill' && styles.pillItem,
|
|
92
92
|
isSelected && styles.active,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import type { ElementType } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Text.module.css';
|
|
@@ -47,7 +47,7 @@ export const Text = ({
|
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
49
|
<Component
|
|
50
|
-
className={
|
|
50
|
+
className={classnames(
|
|
51
51
|
styles.root,
|
|
52
52
|
styles[variant],
|
|
53
53
|
align && styles[align],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
|
|
4
4
|
import styles from './Textarea.module.css';
|
|
@@ -20,7 +20,7 @@ export const Textarea = ({
|
|
|
20
20
|
const helperId = helperText ? `${componentId}-help` : undefined;
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<div className={
|
|
23
|
+
<div className={classnames(styles.wrapper, fullWidth && styles.fullWidth, className)}>
|
|
24
24
|
{label && (
|
|
25
25
|
<label htmlFor={componentId} className={styles.label}>
|
|
26
26
|
{label}
|
|
@@ -29,13 +29,13 @@ export const Textarea = ({
|
|
|
29
29
|
<textarea
|
|
30
30
|
id={componentId}
|
|
31
31
|
rows={rows}
|
|
32
|
-
className={
|
|
32
|
+
className={classnames(styles.textareaRoot, styles[size], error && styles.error)}
|
|
33
33
|
aria-describedby={helperId}
|
|
34
34
|
aria-invalid={error || undefined}
|
|
35
35
|
{...props}
|
|
36
36
|
/>
|
|
37
37
|
{helperText && (
|
|
38
|
-
<span id={helperId} className={
|
|
38
|
+
<span id={helperId} className={classnames(styles.helperText, error && styles.errorText)}>
|
|
39
39
|
{helperText}
|
|
40
40
|
</span>
|
|
41
41
|
)}
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.dark {
|
|
23
|
-
background-color: var(--neutral-900);
|
|
24
|
-
color: var(--neutral-0);
|
|
23
|
+
background-color: var(--ds-p-neutral-900);
|
|
24
|
+
color: var(--ds-p-neutral-0);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.light {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
.top.dark::after {
|
|
78
|
-
border-color: var(--neutral-900) transparent transparent transparent;
|
|
78
|
+
border-color: var(--ds-p-neutral-900) transparent transparent transparent;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.top.light::after {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
.bottom.dark::after {
|
|
92
|
-
border-color: transparent transparent var(--neutral-900) transparent;
|
|
92
|
+
border-color: transparent transparent var(--ds-p-neutral-900) transparent;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.bottom.light::after {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
.left.dark::after {
|
|
106
|
-
border-color: transparent transparent transparent var(--neutral-900);
|
|
106
|
+
border-color: transparent transparent transparent var(--ds-p-neutral-900);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
.left.light::after {
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.right.dark::after {
|
|
120
|
-
border-color: transparent var(--neutral-900) transparent transparent;
|
|
120
|
+
border-color: transparent var(--ds-p-neutral-900) transparent transparent;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.right.light::after {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import {
|
|
3
3
|
useState,
|
|
4
4
|
useRef,
|
|
@@ -60,7 +60,7 @@ export const Tooltip = ({
|
|
|
60
60
|
return (
|
|
61
61
|
<div
|
|
62
62
|
id={componentId}
|
|
63
|
-
className={
|
|
63
|
+
className={classnames(styles.root, className)}
|
|
64
64
|
onMouseEnter={showTooltip}
|
|
65
65
|
onMouseLeave={hideTooltip}
|
|
66
66
|
onFocus={showTooltip}
|
|
@@ -69,7 +69,7 @@ export const Tooltip = ({
|
|
|
69
69
|
>
|
|
70
70
|
<div className={styles.trigger}>{trigger}</div>
|
|
71
71
|
<div
|
|
72
|
-
className={
|
|
72
|
+
className={classnames(
|
|
73
73
|
styles.tooltip,
|
|
74
74
|
styles[position],
|
|
75
75
|
styles[variant],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classnames from 'classnames';
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
3
|
import type { KeyboardEvent } from 'react';
|
|
4
4
|
import type { TreeProps } from './Tree.types';
|
|
@@ -70,7 +70,7 @@ export const Tree = ({
|
|
|
70
70
|
<div
|
|
71
71
|
ref={treeRef}
|
|
72
72
|
role="tree"
|
|
73
|
-
className={
|
|
73
|
+
className={classnames(styles.root, className)}
|
|
74
74
|
onKeyDown={handleKeyDown}
|
|
75
75
|
{...props}
|
|
76
76
|
>
|