@hellboy/ds 0.1.2 → 0.2.7
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/README.md +568 -71
- package/{src/style/components/badge → dist/components}/badge.css +9 -25
- package/dist/components/badge.d.mts +12 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +42 -0
- package/dist/components/badge.mjs +15 -0
- package/dist/components/banner.css +280 -0
- package/dist/components/banner.d.mts +12 -0
- package/dist/components/banner.d.ts +12 -0
- package/dist/components/banner.js +184 -0
- package/dist/components/banner.mjs +147 -0
- package/dist/components/button-group.css +289 -0
- package/dist/components/button-group.d.mts +81 -0
- package/dist/components/button-group.d.ts +81 -0
- package/dist/components/button-group.js +180 -0
- package/dist/components/button-group.mjs +143 -0
- package/{src/style/components/button → dist/components}/button.css +59 -62
- package/dist/components/button.d.mts +57 -0
- package/dist/components/button.d.ts +57 -0
- package/dist/components/button.js +129 -0
- package/dist/components/button.mjs +92 -0
- package/{src/style/components/card → dist/components}/card.css +9 -30
- package/dist/components/card.d.mts +31 -0
- package/dist/components/card.d.ts +31 -0
- package/dist/components/card.js +59 -0
- package/dist/components/card.mjs +32 -0
- package/{src/style → dist}/components/checkbox.css +51 -43
- package/dist/components/checkbox.d.mts +31 -0
- package/dist/components/checkbox.d.ts +31 -0
- package/dist/components/checkbox.js +130 -0
- package/dist/components/checkbox.mjs +93 -0
- package/{src/style/components/code-block → dist/components}/code-block.css +3 -7
- package/dist/components/code-block.d.mts +24 -0
- package/dist/components/code-block.d.ts +24 -0
- package/dist/components/code-block.js +43 -0
- package/dist/components/code-block.mjs +16 -0
- package/dist/components/color-control.css +285 -0
- package/dist/components/color-control.d.mts +5 -0
- package/dist/components/color-control.d.ts +5 -0
- package/dist/components/color-control.js +534 -0
- package/dist/components/color-control.mjs +497 -0
- package/dist/components/dialog.css +930 -0
- package/dist/components/dialog.d.mts +32 -0
- package/dist/components/dialog.d.ts +32 -0
- package/dist/components/dialog.js +1111 -0
- package/dist/components/dialog.mjs +1074 -0
- package/dist/components/divider.css +356 -0
- package/dist/components/divider.d.mts +32 -0
- package/dist/components/divider.d.ts +32 -0
- package/dist/components/divider.js +344 -0
- package/dist/components/divider.mjs +307 -0
- package/{src/style/components/drag-handle → dist/components}/drag-handle.css +3 -18
- package/dist/components/drag-handle.d.mts +11 -0
- package/dist/components/drag-handle.d.ts +11 -0
- package/dist/components/drag-handle.js +103 -0
- package/dist/components/drag-handle.mjs +66 -0
- package/dist/components/drawer.css +1027 -0
- package/dist/components/drawer.d.mts +14 -0
- package/dist/components/drawer.d.ts +14 -0
- package/dist/components/drawer.js +1072 -0
- package/dist/components/drawer.mjs +1035 -0
- package/dist/components/floating-bar.css +17 -0
- package/dist/components/floating-bar.d.mts +25 -0
- package/dist/components/floating-bar.d.ts +25 -0
- package/dist/components/floating-bar.js +52 -0
- package/dist/components/floating-bar.mjs +25 -0
- package/dist/components/footer.css +40 -0
- package/dist/components/footer.d.mts +8 -0
- package/dist/components/footer.d.ts +8 -0
- package/dist/components/footer.js +44 -0
- package/dist/components/footer.mjs +17 -0
- package/dist/components/grid.css +47 -0
- package/dist/components/grid.d.mts +27 -0
- package/dist/components/grid.d.ts +27 -0
- package/dist/components/grid.js +52 -0
- package/dist/components/grid.mjs +25 -0
- package/dist/components/header.css +1075 -0
- package/dist/components/header.d.mts +35 -0
- package/dist/components/header.d.ts +35 -0
- package/dist/components/header.js +1402 -0
- package/dist/components/header.mjs +1365 -0
- package/dist/components/hero.css +121 -0
- package/dist/components/hero.d.mts +111 -0
- package/dist/components/hero.d.ts +111 -0
- package/dist/components/hero.js +285 -0
- package/dist/components/hero.mjs +248 -0
- package/{src/style/components/icons → dist/components}/icons.css +14 -15
- package/dist/components/icons.d.mts +104 -0
- package/dist/components/icons.d.ts +104 -0
- package/dist/components/icons.js +239 -0
- package/dist/components/icons.mjs +203 -0
- package/{src/style/components/input → dist/components}/input.css +189 -102
- package/dist/components/input.d.mts +114 -0
- package/dist/components/input.d.ts +114 -0
- package/dist/components/input.js +926 -0
- package/dist/components/input.mjs +879 -0
- package/dist/components/layout.css +551 -0
- package/dist/components/layout.d.mts +16 -0
- package/dist/components/layout.d.ts +16 -0
- package/dist/components/layout.js +387 -0
- package/dist/components/layout.mjs +352 -0
- package/{src/style/components/list → dist/components}/list.css +47 -41
- package/dist/components/list.d.mts +46 -0
- package/dist/components/list.d.ts +46 -0
- package/dist/components/list.js +124 -0
- package/dist/components/list.mjs +96 -0
- package/dist/components/navbar.css +706 -0
- package/dist/components/navbar.d.mts +56 -0
- package/dist/components/navbar.d.ts +56 -0
- package/dist/components/navbar.js +994 -0
- package/dist/components/navbar.mjs +952 -0
- package/{src/style/components/page-index → dist/components}/page-index.css +2 -47
- package/dist/components/page-index.d.mts +25 -0
- package/dist/components/page-index.d.ts +25 -0
- package/dist/components/page-index.js +239 -0
- package/dist/components/page-index.mjs +202 -0
- package/{src/style/components/page → dist/components}/page.css +4 -15
- package/dist/components/page.d.mts +30 -0
- package/dist/components/page.d.ts +30 -0
- package/dist/components/page.js +40 -0
- package/dist/components/page.mjs +13 -0
- package/dist/components/popover.css +87 -0
- package/dist/components/popover.d.mts +22 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +243 -0
- package/dist/components/popover.mjs +206 -0
- package/{src/style → dist}/components/radio.css +8 -51
- package/dist/components/radio.d.mts +59 -0
- package/dist/components/radio.d.ts +59 -0
- package/dist/components/radio.js +133 -0
- package/dist/components/radio.mjs +95 -0
- package/dist/components/section.css +993 -0
- package/dist/components/section.d.mts +33 -0
- package/dist/components/section.d.ts +33 -0
- package/dist/components/section.js +1401 -0
- package/dist/components/section.mjs +1364 -0
- package/dist/components/select.css +391 -0
- package/dist/components/select.d.mts +63 -0
- package/dist/components/select.d.ts +63 -0
- package/dist/components/select.js +452 -0
- package/dist/components/select.mjs +415 -0
- package/{src/style/components/slider → dist/components}/slider.css +55 -33
- package/dist/components/slider.d.mts +69 -0
- package/dist/components/slider.d.ts +69 -0
- package/dist/components/slider.js +254 -0
- package/dist/components/slider.mjs +217 -0
- package/dist/components/switch.css +1081 -0
- package/dist/components/switch.d.mts +33 -0
- package/dist/components/switch.d.ts +33 -0
- package/dist/components/switch.js +1092 -0
- package/dist/components/switch.mjs +1055 -0
- package/{src/style/components/table → dist/components}/table.css +3 -28
- package/dist/components/table.d.mts +42 -0
- package/dist/components/table.d.ts +42 -0
- package/dist/components/table.js +108 -0
- package/dist/components/table.mjs +76 -0
- package/dist/components/tag.css +97 -0
- package/dist/components/tag.d.mts +12 -0
- package/dist/components/tag.d.ts +12 -0
- package/dist/components/tag.js +42 -0
- package/dist/components/tag.mjs +15 -0
- package/dist/components/textarea.css +1359 -0
- package/dist/components/textarea.d.mts +84 -0
- package/dist/components/textarea.d.ts +84 -0
- package/dist/components/textarea.js +1962 -0
- package/dist/components/textarea.mjs +1924 -0
- package/{src/style/components/theme-control → dist/components}/theme-control.css +3 -7
- package/dist/components/theme-control.d.mts +9 -0
- package/dist/components/theme-control.d.ts +9 -0
- package/dist/components/theme-control.js +235 -0
- package/dist/components/theme-control.mjs +200 -0
- package/{src/style/components/tooltip → dist/components}/tooltip.css +5 -13
- package/dist/components/tooltip.d.mts +12 -0
- package/dist/components/tooltip.d.ts +12 -0
- package/dist/components/tooltip.js +200 -0
- package/dist/components/tooltip.mjs +163 -0
- package/dist/icons-Czahnf-r.d.mts +15 -0
- package/dist/icons-Czahnf-r.d.ts +15 -0
- package/dist/index.css +2915 -2068
- package/dist/index.d.mts +144 -721
- package/dist/index.d.ts +144 -721
- package/dist/index.js +4076 -2282
- package/dist/index.mjs +4132 -2366
- package/dist/theme.css +34 -34
- package/package.json +27 -8
- package/dist/index.css.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/hellboy-ds-0.1.2.tgz +0 -0
- package/src/components/badge/Badge.tsx +0 -29
- package/src/components/badge/index.ts +0 -1
- package/src/components/banner/Banner.tsx +0 -48
- package/src/components/banner/banner.css +0 -44
- package/src/components/banner/index.ts +0 -1
- package/src/components/button/button.tsx +0 -127
- package/src/components/button/index.ts +0 -1
- package/src/components/card/card.tsx +0 -57
- package/src/components/card/index.ts +0 -1
- package/src/components/checkbox/Checkbox.tsx +0 -98
- package/src/components/checkbox/index.ts +0 -1
- package/src/components/code-block/code-block.tsx +0 -44
- package/src/components/code-block/index.ts +0 -1
- package/src/components/color-control/color-control.tsx +0 -322
- package/src/components/color-control/index.ts +0 -1
- package/src/components/drag-handle/DragHandle.tsx +0 -78
- package/src/components/drag-handle/index.ts +0 -1
- package/src/components/drawer/drawer.tsx +0 -82
- package/src/components/drawer/index.ts +0 -1
- package/src/components/floating-bar/floating-bar.tsx +0 -52
- package/src/components/floating-bar/index.ts +0 -2
- package/src/components/footer/footer.tsx +0 -28
- package/src/components/footer/index.ts +0 -1
- package/src/components/grid/Grid.tsx +0 -53
- package/src/components/grid/index.ts +0 -1
- package/src/components/header/header.tsx +0 -57
- package/src/components/header/index.ts +0 -1
- package/src/components/icons/icons.tsx +0 -44
- package/src/components/icons/index.ts +0 -1
- package/src/components/index.ts +0 -29
- package/src/components/input/DatePicker.tsx +0 -133
- package/src/components/input/Input.tsx +0 -220
- package/src/components/input/InputDate.tsx +0 -10
- package/src/components/input/InputDateTime.tsx +0 -10
- package/src/components/input/InputEmail.tsx +0 -10
- package/src/components/input/InputField.tsx +0 -137
- package/src/components/input/InputNumber.tsx +0 -10
- package/src/components/input/InputPassword.tsx +0 -10
- package/src/components/input/InputSearch.tsx +0 -10
- package/src/components/input/InputTel.tsx +0 -10
- package/src/components/input/InputText.tsx +0 -10
- package/src/components/input/InputTime.tsx +0 -10
- package/src/components/input/InputUrl.tsx +0 -10
- package/src/components/input/TimePicker.tsx +0 -151
- package/src/components/input/index.ts +0 -11
- package/src/components/layout/Layout.tsx +0 -244
- package/src/components/layout/index.ts +0 -1
- package/src/components/list/List.tsx +0 -159
- package/src/components/list/index.ts +0 -1
- package/src/components/navbar/MenuCategory.tsx +0 -20
- package/src/components/navbar/MenuGroup.tsx +0 -288
- package/src/components/navbar/MenuItem.tsx +0 -65
- package/src/components/navbar/Navbar.tsx +0 -23
- package/src/components/navbar/index.ts +0 -4
- package/src/components/page/index.ts +0 -1
- package/src/components/page/page.tsx +0 -46
- package/src/components/page-index/PageIndex.tsx +0 -275
- package/src/components/page-index/index.ts +0 -1
- package/src/components/popover/index.ts +0 -1
- package/src/components/popover/popover.tsx +0 -199
- package/src/components/radio/Radio.tsx +0 -176
- package/src/components/radio/index.ts +0 -1
- package/src/components/section/index.ts +0 -1
- package/src/components/section/section.tsx +0 -66
- package/src/components/select/Select.tsx +0 -212
- package/src/components/select/index.ts +0 -1
- package/src/components/slider/Slider.tsx +0 -267
- package/src/components/slider/index.ts +0 -1
- package/src/components/switch/index.ts +0 -1
- package/src/components/switch/switch.tsx +0 -99
- package/src/components/table/Table.tsx +0 -147
- package/src/components/table/index.ts +0 -1
- package/src/components/theme-control/index.ts +0 -1
- package/src/components/theme-control/theme-control.tsx +0 -78
- package/src/components/tooltip/index.ts +0 -1
- package/src/components/tooltip/tooltip.tsx +0 -207
- package/src/contexts/NavbarTooltipContext.tsx +0 -48
- package/src/contexts/index.ts +0 -1
- package/src/foundations/motion.md +0 -136
- package/src/index.ts +0 -40
- package/src/style/_shared/field.css +0 -69
- package/src/style/components/color-control/color-control.css +0 -126
- package/src/style/components/drawer/drawer.css +0 -210
- package/src/style/components/floating-bar/floating-bar.css +0 -39
- package/src/style/components/footer/footer.css +0 -108
- package/src/style/components/grid/grid.css +0 -33
- package/src/style/components/header/header.css +0 -44
- package/src/style/components/layout/layout.css +0 -205
- package/src/style/components/navbar/navbar.css +0 -342
- package/src/style/components/popover/popover.css +0 -44
- package/src/style/components/section/section.css +0 -67
- package/src/style/components/select/select.css +0 -143
- package/src/style/components/switch/switch.css +0 -267
- package/src/style/foundations/global.css +0 -316
- package/src/style/foundations/motion.css +0 -164
- package/src/style/foundations/spacing.css +0 -51
- package/src/style/foundations/typography.css +0 -39
- package/src/style/foundations/z-index.css +0 -81
- package/src/style/modes/dark.css +0 -146
- package/src/style/modes/light.css +0 -147
- package/src/style/semantic.css +0 -52
- package/src/style/styles.css +0 -51
- package/src/style/themes/theme.json +0 -37
- package/src/utils/README.md +0 -305
- package/src/utils/USER_PREFERENCES.md +0 -558
- package/src/utils/theme.ts +0 -127
- package/src/utils/user-preferences.ts +0 -577
- package/tsconfig.json +0 -25
- package/tsup.config.ts +0 -52
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import '../../style/components/badge/badge.css';
|
|
3
|
-
|
|
4
|
-
export type BadgeVariant = 'primary' | 'secondary' | 'tertiary' | 'accent' | 'success' | 'warning' | 'error' | 'info';
|
|
5
|
-
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
6
|
-
|
|
7
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
8
|
-
variant?: BadgeVariant;
|
|
9
|
-
size?: BadgeSize;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const Badge: React.FC<BadgeProps> = ({
|
|
14
|
-
variant = 'primary',
|
|
15
|
-
size = 'md',
|
|
16
|
-
className = '',
|
|
17
|
-
children,
|
|
18
|
-
...props
|
|
19
|
-
}) => {
|
|
20
|
-
const classes = ['badge', `badge--${variant}`, `badge--${size}`, className]
|
|
21
|
-
.filter(Boolean)
|
|
22
|
-
.join(' ');
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<span className={classes} {...props}>
|
|
26
|
-
{children}
|
|
27
|
-
</span>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Badge';
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { Icon } from '../icons';
|
|
3
|
-
import { Button } from '../button';
|
|
4
|
-
import './banner.css';
|
|
5
|
-
|
|
6
|
-
export type BannerType = 'info' | 'warning' | 'error' | 'success';
|
|
7
|
-
|
|
8
|
-
export interface BannerProps {
|
|
9
|
-
type?: BannerType;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
icon?: string;
|
|
12
|
-
onDismiss?: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Banner: React.FC<BannerProps> = ({
|
|
16
|
-
type = 'info',
|
|
17
|
-
children,
|
|
18
|
-
icon,
|
|
19
|
-
onDismiss
|
|
20
|
-
}) => {
|
|
21
|
-
const defaultIcons: Record<BannerType, string> = {
|
|
22
|
-
info: 'information-circle',
|
|
23
|
-
warning: 'warning',
|
|
24
|
-
error: 'close-circle',
|
|
25
|
-
success: 'checkmark-circle'
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const displayIcon = icon || defaultIcons[type];
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<div className={`banner banner--${type}`}>
|
|
32
|
-
<div className="banner__content">
|
|
33
|
-
<Icon name={displayIcon as any} size={32} />
|
|
34
|
-
<div className="banner__message">{children}</div>
|
|
35
|
-
</div>
|
|
36
|
-
{onDismiss && (
|
|
37
|
-
<Button
|
|
38
|
-
variant="ghost"
|
|
39
|
-
size="xs"
|
|
40
|
-
onClick={onDismiss}
|
|
41
|
-
aria-label="Dismiss banner"
|
|
42
|
-
>
|
|
43
|
-
<Icon name="close" size={20} />
|
|
44
|
-
</Button>
|
|
45
|
-
)}
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
.banner {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: flex-start;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
padding: var(--spacing-4);
|
|
6
|
-
border-radius: var(--border-radius-md, 8px);
|
|
7
|
-
margin-bottom: var(--spacing-4);
|
|
8
|
-
font-weight: 500;
|
|
9
|
-
gap: var(--spacing-3);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.banner__content {
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: flex-start;
|
|
15
|
-
gap: var(--spacing-3);
|
|
16
|
-
flex: 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.banner__message {
|
|
20
|
-
flex: 1;
|
|
21
|
-
line-height: 1.5;
|
|
22
|
-
margin: var(--spacing-1) var(--spacing-1) var(--spacing-1) 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Type variants */
|
|
26
|
-
.banner--info {
|
|
27
|
-
background-color: hsla(var(--info-hue), var(--info-saturation), var(--info-lightness), 1);
|
|
28
|
-
color: hsla(var(--info-hue), 0%, 100%, 1);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.banner--warning {
|
|
32
|
-
background-color: hsla(var(--warning-hue), var(--warning-saturation), var(--warning-lightness), 1);
|
|
33
|
-
color: hsla(var(--warning-hue), 0%, 100%, 1);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.banner--error {
|
|
37
|
-
background-color: hsla(var(--error-hue), var(--error-saturation), var(--error-lightness), 1);
|
|
38
|
-
color: hsla(var(--error-hue), 0%, 100%, 1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.banner--success {
|
|
42
|
-
background-color: hsla(var(--success-hue), var(--success-saturation), var(--success-lightness), 1);
|
|
43
|
-
color: hsla(var(--success-hue), 0%, 100%, 1);
|
|
44
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Banner";
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { Button as AriakitButton, ButtonProps as AriakitButtonProps } from '@ariakit/react';
|
|
3
|
-
import { Icon, IconName } from '../icons';
|
|
4
|
-
|
|
5
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'ghost';
|
|
6
|
-
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
7
|
-
|
|
8
|
-
export interface ButtonProps extends Omit<AriakitButtonProps, 'children'> {
|
|
9
|
-
/**
|
|
10
|
-
* Visual variant of the button
|
|
11
|
-
* @default 'primary'
|
|
12
|
-
*/
|
|
13
|
-
variant?: ButtonVariant;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Size of the button
|
|
17
|
-
* @default 'md'
|
|
18
|
-
*/
|
|
19
|
-
size?: ButtonSize;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Button content
|
|
23
|
-
*/
|
|
24
|
-
children?: ReactNode;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Whether the button is in a loading state
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
isLoading?: boolean;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Full width button
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
fullWidth?: boolean;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Icon to display at the start of the button
|
|
40
|
-
*/
|
|
41
|
-
startIcon?: IconName;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Icon to display at the end of the button
|
|
45
|
-
*/
|
|
46
|
-
endIcon?: IconName;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Whether the button should only display an icon (no text)
|
|
50
|
-
* @default false
|
|
51
|
-
*/
|
|
52
|
-
iconOnly?: boolean;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* URL to navigate to when button is clicked (makes it work like a link)
|
|
56
|
-
*/
|
|
57
|
-
href?: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
61
|
-
(
|
|
62
|
-
{
|
|
63
|
-
variant = 'primary',
|
|
64
|
-
size = 'md',
|
|
65
|
-
children,
|
|
66
|
-
isLoading = false,
|
|
67
|
-
disabled = false,
|
|
68
|
-
fullWidth = false,
|
|
69
|
-
startIcon,
|
|
70
|
-
endIcon,
|
|
71
|
-
iconOnly = false,
|
|
72
|
-
href,
|
|
73
|
-
className,
|
|
74
|
-
onClick,
|
|
75
|
-
...props
|
|
76
|
-
},
|
|
77
|
-
ref
|
|
78
|
-
) => {
|
|
79
|
-
const buttonClasses = [
|
|
80
|
-
'btn',
|
|
81
|
-
`btn--${variant}`,
|
|
82
|
-
`btn--${size}`,
|
|
83
|
-
fullWidth && 'btn--full-width',
|
|
84
|
-
iconOnly && 'btn--icon-only',
|
|
85
|
-
className,
|
|
86
|
-
]
|
|
87
|
-
.filter(Boolean)
|
|
88
|
-
.join(' ');
|
|
89
|
-
|
|
90
|
-
const iconSize = size === 'xs' ? 14 : size === 'sm' ? 16 : size === 'lg' ? 24 : 20;
|
|
91
|
-
|
|
92
|
-
const buttonContent = (
|
|
93
|
-
<>
|
|
94
|
-
{isLoading && <span className="btn__spinner" />}
|
|
95
|
-
{startIcon && (
|
|
96
|
-
isLoading ? (
|
|
97
|
-
<span className="btn__icon-placeholder" style={{ width: iconSize, height: iconSize }} />
|
|
98
|
-
) : (
|
|
99
|
-
<Icon name={startIcon} size={iconSize} className="btn__icon" />
|
|
100
|
-
)
|
|
101
|
-
)}
|
|
102
|
-
{!iconOnly && children}
|
|
103
|
-
{endIcon && <Icon name={endIcon} size={iconSize} className="btn__icon" />}
|
|
104
|
-
</>
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
108
|
-
if (href && !isLoading && !disabled) {
|
|
109
|
-
window.location.href = href;
|
|
110
|
-
}
|
|
111
|
-
onClick?.(e);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<AriakitButton
|
|
116
|
-
ref={ref}
|
|
117
|
-
disabled={disabled || isLoading}
|
|
118
|
-
className={buttonClasses}
|
|
119
|
-
onClick={handleClick}
|
|
120
|
-
{...props}
|
|
121
|
-
>
|
|
122
|
-
{buttonContent}
|
|
123
|
-
</AriakitButton>
|
|
124
|
-
);
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
Button.displayName = 'Button';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './button';
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import '../../style/components/card/card.css';
|
|
3
|
-
|
|
4
|
-
export type CardVariant = 'default' | 'elevated' | 'outlined';
|
|
5
|
-
|
|
6
|
-
export interface CardProps {
|
|
7
|
-
/**
|
|
8
|
-
* Visual variant of the card
|
|
9
|
-
* @default 'default'
|
|
10
|
-
*/
|
|
11
|
-
variant?: CardVariant;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Card content
|
|
15
|
-
*/
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Additional CSS classes
|
|
20
|
-
*/
|
|
21
|
-
className?: string;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Click handler for interactive cards
|
|
25
|
-
*/
|
|
26
|
-
onClick?: () => void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const Card: React.FC<CardProps> = ({
|
|
30
|
-
variant = 'default',
|
|
31
|
-
children,
|
|
32
|
-
className = '',
|
|
33
|
-
onClick,
|
|
34
|
-
...props
|
|
35
|
-
}) => {
|
|
36
|
-
const cardClasses = [
|
|
37
|
-
'card',
|
|
38
|
-
`card--${variant}`,
|
|
39
|
-
onClick && 'card--interactive',
|
|
40
|
-
className,
|
|
41
|
-
]
|
|
42
|
-
.filter(Boolean)
|
|
43
|
-
.join(' ');
|
|
44
|
-
|
|
45
|
-
const Component = onClick ? 'button' : 'div';
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Component
|
|
49
|
-
className={cardClasses}
|
|
50
|
-
onClick={onClick}
|
|
51
|
-
{...(onClick && { type: 'button' })}
|
|
52
|
-
{...props}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
</Component>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './card';
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Checkbox as AriakitCheckbox, CheckboxProps as AriakitCheckboxProps } from '@ariakit/react';
|
|
3
|
-
import { Icon } from '../icons';
|
|
4
|
-
|
|
5
|
-
export type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
6
|
-
|
|
7
|
-
export interface CheckboxProps extends Omit<AriakitCheckboxProps, 'children' | 'size'> {
|
|
8
|
-
/**
|
|
9
|
-
* Size of the checkbox
|
|
10
|
-
* @default 'md'
|
|
11
|
-
*/
|
|
12
|
-
size?: CheckboxSize;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Label text for the checkbox
|
|
16
|
-
*/
|
|
17
|
-
label?: React.ReactNode;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Error message to display below the checkbox
|
|
21
|
-
*/
|
|
22
|
-
error?: string;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Helper text to display below the checkbox
|
|
26
|
-
*/
|
|
27
|
-
helperText?: string;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Whether the checkbox is in an indeterminate state
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
33
|
-
indeterminate?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
|
37
|
-
(
|
|
38
|
-
{
|
|
39
|
-
size = 'md',
|
|
40
|
-
label,
|
|
41
|
-
error,
|
|
42
|
-
helperText,
|
|
43
|
-
indeterminate = false,
|
|
44
|
-
disabled = false,
|
|
45
|
-
className,
|
|
46
|
-
checked,
|
|
47
|
-
...props
|
|
48
|
-
},
|
|
49
|
-
ref
|
|
50
|
-
) => {
|
|
51
|
-
const checkboxClasses = [
|
|
52
|
-
'checkbox',
|
|
53
|
-
`checkbox--${size}`,
|
|
54
|
-
error && 'checkbox--error',
|
|
55
|
-
disabled && 'checkbox--disabled',
|
|
56
|
-
className,
|
|
57
|
-
]
|
|
58
|
-
.filter(Boolean)
|
|
59
|
-
.join(' ');
|
|
60
|
-
|
|
61
|
-
const iconSize = size === 'sm' ? 14 : size === 'lg' ? 20 : 16;
|
|
62
|
-
|
|
63
|
-
// Determine checked state for icon display
|
|
64
|
-
const isChecked = checked === true;
|
|
65
|
-
const isIndeterminate = indeterminate && !isChecked;
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<div className={checkboxClasses}>
|
|
69
|
-
<label className="checkbox__container">
|
|
70
|
-
<AriakitCheckbox
|
|
71
|
-
ref={ref}
|
|
72
|
-
checked={checked}
|
|
73
|
-
disabled={disabled}
|
|
74
|
-
className="checkbox__input"
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
<span className="checkbox__box">
|
|
78
|
-
{isChecked && (
|
|
79
|
-
<Icon name="checkmark-sharp" size={iconSize} className="checkbox__icon" />
|
|
80
|
-
)}
|
|
81
|
-
{isIndeterminate && (
|
|
82
|
-
<Icon name="minus" size={iconSize} className="checkbox__icon" />
|
|
83
|
-
)}
|
|
84
|
-
</span>
|
|
85
|
-
{label && <span className="checkbox__label">{label}</span>}
|
|
86
|
-
</label>
|
|
87
|
-
{(error || helperText) && (
|
|
88
|
-
<div className="checkbox__feedback">
|
|
89
|
-
{error && <span className="checkbox__error-text">{error}</span>}
|
|
90
|
-
{!error && helperText && <span className="checkbox__helper-text">{helperText}</span>}
|
|
91
|
-
</div>
|
|
92
|
-
)}
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
Checkbox.displayName = 'Checkbox';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Checkbox';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export type CodeBlockVariant = 'block' | 'inline';
|
|
4
|
-
|
|
5
|
-
export interface CodeBlockProps {
|
|
6
|
-
/**
|
|
7
|
-
* Code content
|
|
8
|
-
*/
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Variant of the code block
|
|
13
|
-
* @default 'block'
|
|
14
|
-
*/
|
|
15
|
-
variant?: CodeBlockVariant;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Custom class name
|
|
19
|
-
*/
|
|
20
|
-
className?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* CodeBlock component for displaying code snippets
|
|
25
|
-
*/
|
|
26
|
-
export const CodeBlock: React.FC<CodeBlockProps> = ({ children, variant = 'block', className }) => {
|
|
27
|
-
const classes = [
|
|
28
|
-
'code-block',
|
|
29
|
-
variant === 'inline' && 'code-block--inline',
|
|
30
|
-
className,
|
|
31
|
-
]
|
|
32
|
-
.filter(Boolean)
|
|
33
|
-
.join(' ');
|
|
34
|
-
|
|
35
|
-
if (variant === 'inline') {
|
|
36
|
-
return <code className={classes}>{children}</code>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<pre className={classes}>
|
|
41
|
-
<code>{children}</code>
|
|
42
|
-
</pre>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CodeBlock, type CodeBlockProps, type CodeBlockVariant } from './code-block';
|