@wonderflow/react-components 3.0.0-next.7 → 3.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/autocomplete-option.d.ts +39 -0
- package/autocomplete/autocomplete-option.js +11 -0
- package/autocomplete/autocomplete.d.ts +24 -0
- package/autocomplete/autocomplete.js +82 -0
- package/autocomplete/autocomplete.module.css +1 -0
- package/autocomplete/index.d.ts +2 -0
- package/autocomplete/index.js +1 -0
- package/avatar/avatar.d.ts +15 -3
- package/avatar/avatar.js +3 -6
- package/avatar/avatar.module.css +1 -31
- package/button/button.d.ts +35 -0
- package/button/button.js +7 -10
- package/button/button.module.css +1 -154
- package/card/card.d.ts +24 -0
- package/card/card.js +3 -6
- package/card/card.module.css +1 -51
- package/chip/chip.d.ts +28 -4
- package/chip/chip.js +3 -5
- package/chip/chip.module.css +1 -60
- package/circular-progress/circular-progress.d.ts +33 -3
- package/circular-progress/circular-progress.js +3 -2
- package/circular-progress/circular-progress.module.css +1 -55
- package/clamp-text/clamp-text.d.ts +6 -0
- package/clamp-text/clamp-text.js +3 -2
- package/clamp-text/clamp-text.module.css +1 -7
- package/container/container.d.ts +6 -0
- package/container/container.js +3 -2
- package/container/container.module.css +1 -35
- package/core/basic.css +1 -49
- package/core/elevations.css +1 -56
- package/core/typography.css +1 -117
- package/core/{media.css → utils/media.css} +19 -1
- package/core/utils/vibrancy.css +3 -0
- package/core.css +1 -5
- package/datetime/datetime.d.ts +7 -0
- package/datetime/datetime.js +16 -0
- package/datetime/index.d.ts +2 -0
- package/datetime/index.js +1 -0
- package/disclosure/disclosure.d.ts +55 -3
- package/disclosure/disclosure.js +4 -7
- package/disclosure/disclosure.module.css +1 -93
- package/drawer/drawer.d.ts +85 -0
- package/drawer/drawer.js +34 -0
- package/drawer/drawer.module.css +1 -0
- package/drawer/index.d.ts +2 -0
- package/drawer/index.js +1 -0
- package/dropdown/dropdown.d.ts +43 -10
- package/dropdown/dropdown.js +45 -34
- package/dropdown/dropdown.module.css +1 -9
- package/dropdown/index.d.ts +0 -1
- package/elevator/elevator.d.ts +11 -0
- package/elevator/elevator.js +6 -5
- package/grid/grid.d.ts +32 -2
- package/grid/grid.js +4 -3
- package/grid/grid.module.css +1 -29
- package/grid/index.d.ts +1 -1
- package/grid/item/grid-item.d.ts +41 -0
- package/grid/item/grid-item.js +12 -0
- package/grid/item/grid-item.module.css +1 -0
- package/icon/icon.d.ts +30 -4
- package/icon/icon.js +3 -3
- package/icon-button/icon-button.js +3 -2
- package/icon-button/icon-button.module.css +1 -22
- package/index.d.ts +86 -40
- package/index.js +6 -3
- package/info-state/info-state.d.ts +50 -6
- package/info-state/info-state.js +3 -9
- package/info-state/info-state.module.css +1 -77
- package/input-group/input-group.d.ts +33 -3
- package/input-group/input-group.js +11 -15
- package/input-group/input-group.module.css +1 -33
- package/linear-progress/linear-progress.d.ts +33 -3
- package/linear-progress/linear-progress.js +6 -7
- package/linear-progress/linear-progress.module.css +1 -81
- package/list/list.d.ts +13 -0
- package/list/list.js +4 -5
- package/list/list.module.css +1 -55
- package/masonry/masonry.d.ts +22 -0
- package/masonry/masonry.js +5 -4
- package/masonry/masonry.module.css +1 -14
- package/menu/index.d.ts +6 -0
- package/menu/index.js +3 -0
- package/menu/menu-item/menu-item-checkbox.d.ts +11 -0
- package/menu/menu-item/menu-item-checkbox.js +5 -0
- package/menu/menu-item/menu-item.d.ts +60 -0
- package/menu/menu-item/menu-item.js +23 -0
- package/menu/menu-item/menu-item.module.css +1 -0
- package/menu/menu.d.ts +16 -0
- package/menu/menu.js +15 -0
- package/menu/menu.module.css +1 -0
- package/modal/content/modal-content.d.ts +19 -3
- package/modal/content/modal-content.js +6 -9
- package/modal/content/modal-content.module.css +1 -40
- package/modal/index.d.ts +0 -1
- package/modal/index.js +0 -1
- package/modal/modal.d.ts +6 -3
- package/modal/modal.js +25 -11
- package/modal/modal.module.css +1 -48
- package/overlay-container/index.d.ts +1 -0
- package/overlay-container/index.js +1 -0
- package/overlay-container/overlay-container.d.ts +28 -1
- package/overlay-container/overlay-container.js +9 -5
- package/overlay-container/overlay-container.module.css +1 -0
- package/overlay-container/overlay-context.d.ts +9 -0
- package/overlay-container/overlay-context.js +23 -0
- package/package.json +88 -38
- package/pagination/pagination.d.ts +26 -2
- package/pagination/pagination.js +5 -4
- package/pagination/pagination.module.css +1 -31
- package/polymorphic/polymorphic.d.ts +26 -1
- package/prose/prose.js +3 -2
- package/prose/prose.module.css +1 -23
- package/select/select.d.ts +45 -3
- package/select/select.js +4 -7
- package/select/select.module.css +1 -108
- package/selection-controls/checkbox.d.ts +31 -3
- package/selection-controls/checkbox.js +3 -2
- package/selection-controls/radio.d.ts +23 -3
- package/selection-controls/radio.js +3 -2
- package/selection-controls/selection-controls.module.css +1 -119
- package/selection-controls/toggle.d.ts +23 -3
- package/selection-controls/toggle.js +3 -2
- package/separator/separator.d.ts +2 -2
- package/separator/separator.js +3 -2
- package/separator/separator.module.css +1 -6
- package/skeleton-block/skeleton-block.d.ts +4 -0
- package/skeleton-block/skeleton-block.js +2 -2
- package/slider/slider.d.ts +65 -3
- package/slider/slider.js +3 -7
- package/slider/slider.module.css +1 -101
- package/snackbar/snackbar.d.ts +28 -2
- package/snackbar/snackbar.js +4 -11
- package/snackbar/snackbar.module.css +1 -46
- package/spinner/spinner.d.ts +15 -3
- package/spinner/spinner.js +4 -7
- package/split-button/split-button.d.ts +4 -2
- package/split-button/split-button.js +4 -5
- package/split-button/split-button.module.css +1 -28
- package/stack/stack.d.ts +35 -1
- package/stack/stack.js +3 -2
- package/stack/stack.module.css +1 -27
- package/star-meter/star-meter.d.ts +25 -0
- package/star-meter/star-meter.js +9 -16
- package/star-meter/star-meter.module.css +1 -30
- package/tab/primitive-tab.d.ts +1 -1
- package/tab/primitive-tab.js +3 -3
- package/tab/tab-item.d.ts +17 -3
- package/tab/tab-item.js +3 -4
- package/tab/tab-list.d.ts +6 -2
- package/tab/tab-list.js +3 -3
- package/tab/tab-panel.d.ts +25 -3
- package/tab/tab-panel.js +3 -2
- package/tab/tab.d.ts +18 -1
- package/tab/tab.js +6 -8
- package/tab/tab.module.css +1 -103
- package/table/index.d.ts +1 -0
- package/table/table.d.ts +14 -1
- package/table/table.js +7 -9
- package/table/table.module.css +1 -28
- package/text/text.d.ts +31 -0
- package/text/text.js +4 -3
- package/text/text.module.css +1 -87
- package/textfield/base-field/base-field.d.ts +10 -1
- package/textfield/base-field/base-field.js +3 -2
- package/textfield/base-field/base-field.module.css +1 -119
- package/textfield/textfield.d.ts +76 -6
- package/textfield/textfield.js +10 -13
- package/textfield/textfield.module.css +1 -103
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/themes.css +1 -143
- package/title/title.d.ts +20 -0
- package/title/title.js +3 -2
- package/title/title.module.css +1 -110
- package/toggle-button/toggle-button.d.ts +10 -0
- package/toggle-button/toggle-button.js +6 -5
- package/toggle-button/toggle-button.module.css +1 -51
- package/tooltip/tooltip.d.ts +33 -1
- package/tooltip/tooltip.js +24 -27
- package/tooltip/tooltip.module.css +1 -72
- package/core/vibrancy.css +0 -27
- package/dropdown/dropdown-item.d.ts +0 -21
- package/dropdown/dropdown-item.js +0 -26
- package/dropdown/dropdown-item.module.css +0 -63
- package/dropdown/dropdown-menu.d.ts +0 -7
- package/dropdown/dropdown-menu.js +0 -17
- package/dropdown/dropdown-menu.module.css +0 -13
- package/grid/grid-item.d.ts +0 -11
- package/grid/grid-item.js +0 -11
- package/modal/modal-context.d.ts +0 -9
- package/modal/modal-context.js +0 -22
- package/theme-switch/index.d.ts +0 -2
- package/theme-switch/index.js +0 -1
- package/theme-switch/theme-switch.d.ts +0 -9
- package/theme-switch/theme-switch.js +0 -14
package/chip/chip.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import { Icon, Stack } from '../';
|
|
4
5
|
import { Chip as ChipClass, Action } from './chip.module.css';
|
|
5
6
|
export const Chip = forwardRef(({ children, className, dimension = 'regular', color = 'gray', interactive, onDismissClick, ...otherProps }, forwardedRef) => {
|
|
@@ -14,9 +15,6 @@ export const Chip = forwardRef(({ children, className, dimension = 'regular', co
|
|
|
14
15
|
iconSize: 16
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
|
-
return (
|
|
18
|
-
React.createElement("b", null, children),
|
|
19
|
-
interactive && (React.createElement("button", { onClick: interactive && onDismissClick, className: Action, type: "button" },
|
|
20
|
-
React.createElement(Icon, { name: "xmark", dimension: properties[dimension].iconSize })))));
|
|
18
|
+
return (_jsxs(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...otherProps, children: [_jsx("b", { children: children }, void 0), interactive && (_jsx("button", { onClick: interactive && onDismissClick, className: Action, type: "button", children: _jsx(Icon, { name: "xmark", dimension: properties[dimension].iconSize }, void 0) }, void 0))] }, void 0));
|
|
21
19
|
});
|
|
22
20
|
Chip.displayName = 'Chip';
|
package/chip/chip.module.css
CHANGED
|
@@ -1,60 +1 @@
|
|
|
1
|
-
.Chip {
|
|
2
|
-
padding: 2px env(--space-8) env(--space-4);
|
|
3
|
-
border-radius: env(--radius-48);
|
|
4
|
-
background-color: var(--highlight-gray-background);
|
|
5
|
-
color: var(--highlight-gray-foreground);
|
|
6
|
-
font-size: env(--font-size-16);
|
|
7
|
-
block-size: env(--space-32);
|
|
8
|
-
font-weight: 600;
|
|
9
|
-
|
|
10
|
-
&[data-chip-dimension='small'] {
|
|
11
|
-
block-size: env(--space-24);
|
|
12
|
-
font-size: env(--font-size-14);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&[data-chip-dimension='big'] {
|
|
16
|
-
font-size: env(--font-size-18);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&[data-chip-color='cyan'] {
|
|
20
|
-
background-color: var(--highlight-cyan-background);
|
|
21
|
-
color: var(--highlight-cyan-foreground);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&[data-chip-color='green'] {
|
|
25
|
-
background-color: var(--highlight-green-background);
|
|
26
|
-
color: var(--highlight-green-foreground);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&[data-chip-color='purple'] {
|
|
30
|
-
background-color: var(--highlight-purple-background);
|
|
31
|
-
color: var(--highlight-purple-foreground);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&[data-chip-color='yellow'] {
|
|
35
|
-
background-color: var(--highlight-yellow-background);
|
|
36
|
-
color: var(--highlight-yellow-foreground);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&[data-chip-color='red'] {
|
|
40
|
-
background-color: var(--highlight-red-background);
|
|
41
|
-
color: var(--highlight-red-foreground);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&[data-chip-color='blue'] {
|
|
45
|
-
background-color: var(--highlight-blue-background);
|
|
46
|
-
color: var(--highlight-blue-foreground);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.Action {
|
|
51
|
-
display: inline-flex;
|
|
52
|
-
appearance: none;
|
|
53
|
-
border: 0;
|
|
54
|
-
background: none;
|
|
55
|
-
padding: 0;
|
|
56
|
-
color: inherit;
|
|
57
|
-
font: inherit;
|
|
58
|
-
margin-top: 1px;
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
}
|
|
1
|
+
.Chip{background-color:var(--highlight-gray-background);block-size:1.78rem;border-radius:2.67rem;color:var(--highlight-gray-foreground);font-size:.89rem;font-weight:600;padding:2px .44rem .22rem}.Chip[data-chip-dimension=small]{block-size:1.33rem;font-size:.78rem}.Chip[data-chip-dimension=big]{font-size:1rem}.Chip[data-chip-color=cyan]{background-color:var(--highlight-cyan-background);color:var(--highlight-cyan-foreground)}.Chip[data-chip-color=green]{background-color:var(--highlight-green-background);color:var(--highlight-green-foreground)}.Chip[data-chip-color=purple]{background-color:var(--highlight-purple-background);color:var(--highlight-purple-foreground)}.Chip[data-chip-color=yellow]{background-color:var(--highlight-yellow-background);color:var(--highlight-yellow-foreground)}.Chip[data-chip-color=red]{background-color:var(--highlight-red-background);color:var(--highlight-red-foreground)}.Chip[data-chip-color=blue]{background-color:var(--highlight-blue-background);color:var(--highlight-blue-foreground)}.Action{-webkit-appearance:none;appearance:none;background:none;border:0;color:inherit;cursor:pointer;display:inline-flex;font:inherit;margin-top:1px;padding:0}
|
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export declare type CircularProgressProps = PropsWithClass & {
|
|
3
|
+
/**
|
|
4
|
+
* Set the current progress of the progress bar.
|
|
5
|
+
* This value should be between 0 and 'max'. The percentage is
|
|
6
|
+
* automatically computed.
|
|
7
|
+
*/
|
|
3
8
|
value: number;
|
|
9
|
+
/**
|
|
10
|
+
* Set the max value of the progress bar. This determines the
|
|
11
|
+
* computed percentage.
|
|
12
|
+
*/
|
|
4
13
|
max?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Set the dimension of the progress bar.
|
|
16
|
+
*/
|
|
5
17
|
dimension?: 'small' | 'regular' | 'big';
|
|
18
|
+
/**
|
|
19
|
+
* Show or hide the progress value.
|
|
20
|
+
*/
|
|
6
21
|
showProgress?: boolean;
|
|
7
22
|
};
|
|
8
|
-
export declare const CircularProgress:
|
|
23
|
+
export declare const CircularProgress: import("react").ForwardRefExoticComponent<PropsWithClass & {
|
|
24
|
+
/**
|
|
25
|
+
* Set the current progress of the progress bar.
|
|
26
|
+
* This value should be between 0 and 'max'. The percentage is
|
|
27
|
+
* automatically computed.
|
|
28
|
+
*/
|
|
9
29
|
value: number;
|
|
30
|
+
/**
|
|
31
|
+
* Set the max value of the progress bar. This determines the
|
|
32
|
+
* computed percentage.
|
|
33
|
+
*/
|
|
10
34
|
max?: number | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Set the dimension of the progress bar.
|
|
37
|
+
*/
|
|
11
38
|
dimension?: "big" | "small" | "regular" | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Show or hide the progress value.
|
|
41
|
+
*/
|
|
12
42
|
showProgress?: boolean | undefined;
|
|
13
|
-
} &
|
|
43
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { CircularProgress as CircularProgressClass } from './circular-progress.module.css';
|
|
4
5
|
export const CircularProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, style, ...otherProps }, forwardedRef) => {
|
|
@@ -7,6 +8,6 @@ export const CircularProgress = forwardRef(({ className, value, max = 100, dimen
|
|
|
7
8
|
const dynamicStyle = {
|
|
8
9
|
'--progress': `${getPercentage()}%`
|
|
9
10
|
};
|
|
10
|
-
return (
|
|
11
|
+
return (_jsx("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...otherProps }, void 0));
|
|
11
12
|
});
|
|
12
13
|
CircularProgress.displayName = 'CircularProgress';
|
|
@@ -1,55 +1 @@
|
|
|
1
|
-
.CircularProgress
|
|
2
|
-
--hue: 220;
|
|
3
|
-
--track-size: 4px;
|
|
4
|
-
--track-bg: var(--dimmed-1);
|
|
5
|
-
|
|
6
|
-
inline-size: env(--space-64);
|
|
7
|
-
min-inline-size: 64px;
|
|
8
|
-
aspect-ratio: 1 / 1;
|
|
9
|
-
display: grid;
|
|
10
|
-
place-items: center;
|
|
11
|
-
position: relative;
|
|
12
|
-
font-weight: 700;
|
|
13
|
-
font-size: 1rem;
|
|
14
|
-
|
|
15
|
-
&[data-circular-progress-show-progress='true']::after {
|
|
16
|
-
content: attr(data-circular-progress);
|
|
17
|
-
display: block;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&[data-circular-progress-dimension='regular'] {
|
|
21
|
-
--track-size: 8px;
|
|
22
|
-
|
|
23
|
-
font-size: 1.77rem;
|
|
24
|
-
inline-size: env(--space-136);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&[data-circular-progress-dimension='big'] {
|
|
28
|
-
--track-size: 16px;
|
|
29
|
-
|
|
30
|
-
font-size: 2.37rem;
|
|
31
|
-
inline-size: env(--space-184);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&::before {
|
|
35
|
-
content: '';
|
|
36
|
-
position: absolute;
|
|
37
|
-
top: 0;
|
|
38
|
-
bottom: 0;
|
|
39
|
-
left: 0;
|
|
40
|
-
right: 0;
|
|
41
|
-
border-radius: 50%;
|
|
42
|
-
z-index: -1;
|
|
43
|
-
background:
|
|
44
|
-
conic-gradient(
|
|
45
|
-
var(--cta-default),
|
|
46
|
-
var(--cta-default) var(--progress, 0%),
|
|
47
|
-
var(--track-bg) var(--progress, 0%) 100%
|
|
48
|
-
);
|
|
49
|
-
mask-image:
|
|
50
|
-
radial-gradient(
|
|
51
|
-
transparent calc(71% - var(--track-size)),
|
|
52
|
-
black calc(calc(71% - var(--track-size)) + 0.5px)
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
1
|
+
.CircularProgress{--hue:220;--track-size:4px;--track-bg:var(--dimmed-1);align-items:center;aspect-ratio:1/1;display:grid;font-size:1rem;font-weight:700;inline-size:3.56rem;justify-items:center;min-inline-size:64px;place-items:center;position:relative}.CircularProgress[data-circular-progress-show-progress=true]:after{content:attr(data-circular-progress);display:block}.CircularProgress[data-circular-progress-dimension=regular]{--track-size:8px;font-size:1.77rem;inline-size:7.56rem}.CircularProgress[data-circular-progress-dimension=big]{--track-size:16px;font-size:2.37rem;inline-size:10.22rem}.CircularProgress:before{background:conic-gradient(var(--cta-default),var(--cta-default) var(--progress,0),var(--track-bg) var(--progress,0) 100%);border-radius:50%;bottom:0;content:"";left:0;-webkit-mask-image:radial-gradient(#0000 calc(71% - var(--track-size)),#000 calc(71% - var(--track-size) + .5px));mask-image:radial-gradient(#0000 calc(71% - var(--track-size)),#000 calc(71% - var(--track-size) + .5px));position:absolute;right:0;top:0;z-index:-1}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Polymorphic } from '../';
|
|
3
3
|
export declare type ClampTextProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The text content to be displayed and clamped
|
|
6
|
+
*/
|
|
4
7
|
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Define how many lines the text should be clamped to.
|
|
10
|
+
*/
|
|
5
11
|
rows?: number;
|
|
6
12
|
};
|
|
7
13
|
declare type PolymorphicClampText = Polymorphic.ForwardRefComponent<'span', ClampTextProps>;
|
package/clamp-text/clamp-text.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import { ClampText as ClampTextClass } from './clamp-text.module.css';
|
|
4
5
|
export const ClampText = forwardRef(({ className, children, rows = 1, style, as: Wrapper = 'span', ...otherProps }, forwardedRef) => {
|
|
5
6
|
const dynamicStyle = {
|
|
6
7
|
'--r': rows
|
|
7
8
|
};
|
|
8
|
-
return (
|
|
9
|
+
return (_jsx(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...otherProps, children: children }, void 0));
|
|
9
10
|
});
|
package/container/container.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Polymorphic } from '../';
|
|
2
2
|
export declare type ContainerProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Set the horizontal max-width of the container.
|
|
5
|
+
*/
|
|
3
6
|
dimension?: 'full' | 'medium' | 'large';
|
|
7
|
+
/**
|
|
8
|
+
* Set or remove the container's predefined horizontal padding.
|
|
9
|
+
*/
|
|
4
10
|
padding?: boolean;
|
|
5
11
|
};
|
|
6
12
|
declare type PolymorphicContainer = Polymorphic.ForwardRefComponent<'div', ContainerProps>;
|
package/container/container.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { Container as ContainerClass } from './container.module.css';
|
|
3
4
|
import clsx from 'clsx';
|
|
4
5
|
export const Container = forwardRef(({ children, className, dimension = 'full', padding = true, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
|
|
5
|
-
return (
|
|
6
|
+
return (_jsx(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...otherProps, children: children }, void 0));
|
|
6
7
|
});
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
.Container {
|
|
4
|
-
padding: 0 env(--space-16);
|
|
5
|
-
margin: 0 auto;
|
|
6
|
-
inline-size: 100%;
|
|
7
|
-
|
|
8
|
-
&[data-container-dimension='medium'] {
|
|
9
|
-
max-inline-size: env(--container-medium);
|
|
10
|
-
|
|
11
|
-
@media (--from-small) {
|
|
12
|
-
padding: 0 env(--space-32);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&[data-container-dimension='large'] {
|
|
17
|
-
max-inline-size: env(--container-large);
|
|
18
|
-
|
|
19
|
-
@media (--from-small) {
|
|
20
|
-
padding: 0 env(--space-32);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&[data-container-dimension='full'] {
|
|
25
|
-
max-inline-size: 100%;
|
|
26
|
-
|
|
27
|
-
@media (--from-small) {
|
|
28
|
-
padding: 0 env(--space-32);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&[data-container-padding='false'] {
|
|
33
|
-
padding: 0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
.Container{inline-size:100%;margin:0 auto;padding:0 .89rem}.Container[data-container-dimension=medium]{max-inline-size:35.56rem}@media (min-width:48em){.Container[data-container-dimension=medium]{padding:0 1.78rem}}.Container[data-container-dimension=large]{max-inline-size:80rem}@media (min-width:48em){.Container[data-container-dimension=large]{padding:0 1.78rem}}.Container[data-container-dimension=full]{max-inline-size:100%}@media (min-width:48em){.Container[data-container-dimension=full]{padding:0 1.78rem}}.Container[data-container-padding=false]{padding:0}
|
package/core/basic.css
CHANGED
|
@@ -1,49 +1 @@
|
|
|
1
|
-
html {
|
|
2
|
-
font-size: 112.5%;
|
|
3
|
-
-moz-osx-font-smoothing: grayscale;
|
|
4
|
-
-webkit-font-smoothing: antialiased;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
line-height: 1.5;
|
|
7
|
-
background-color: var(--global-background);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
*,
|
|
11
|
-
*::before,
|
|
12
|
-
*::after {
|
|
13
|
-
margin: 0;
|
|
14
|
-
box-sizing: inherit;
|
|
15
|
-
-webkit-tap-highlight-color: hsl(env(--color-support-brand) / 20%);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
*:focus-visible {
|
|
19
|
-
outline: 5px auto Highlight;
|
|
20
|
-
outline: 5px auto -webkit-focus-ring-color;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
body {
|
|
24
|
-
color: var(--global-foreground);
|
|
25
|
-
font-family: env(--font-family-sans);
|
|
26
|
-
font-feature-settings: 'calt' off;
|
|
27
|
-
scroll-padding: env(--space-80);
|
|
28
|
-
margin: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
::selection {
|
|
32
|
-
background-color: var(--dimmed-7);
|
|
33
|
-
color: var(--dimmed-0);
|
|
34
|
-
text-shadow: none;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
img {
|
|
38
|
-
display: block;
|
|
39
|
-
inline-size: 100%;
|
|
40
|
-
max-inline-size: 100%;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
svg:not([fill]) {
|
|
44
|
-
fill: currentColor;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
fieldset {
|
|
48
|
-
border: 0;
|
|
49
|
-
}
|
|
1
|
+
html{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;background-color:var(--global-background);box-sizing:border-box;font-size:112.5%;line-height:1.5}*,:after,:before{-webkit-tap-highlight-color:hsla(0,100%,47%,.2);box-sizing:inherit;margin:0}.focus-visible{outline:5px auto Highlight;outline:5px auto -webkit-focus-ring-color}:focus-visible{outline:5px auto Highlight;outline:5px auto -webkit-focus-ring-color}body{font-feature-settings:"calt" off;color:var(--global-foreground);font-family:system-ui,sans-serif;margin:0;scroll-padding:4.44rem}::selection{background-color:var(--dimmed-7);color:var(--dimmed-0);text-shadow:none}img{display:block;inline-size:100%;max-inline-size:100%}svg:not([fill]){fill:currentColor}fieldset{border:0}
|
package/core/elevations.css
CHANGED
|
@@ -1,56 +1 @@
|
|
|
1
|
-
[data-elevation] {
|
|
2
|
-
--shadow-color: 0deg 0% 0%;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
[data-elevation='0'],
|
|
6
|
-
[data-elevation-hover='0']:hover {
|
|
7
|
-
transition: box-shadow env(--duration-100) env(--easing-standard);
|
|
8
|
-
box-shadow: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
[data-elevation='1'],
|
|
12
|
-
[data-elevation-hover='1']:hover {
|
|
13
|
-
transition: box-shadow env(--duration-100) env(--easing-standard);
|
|
14
|
-
box-shadow:
|
|
15
|
-
0 3px 13px hsl(var(--shadow-color) / 6%),
|
|
16
|
-
0 2.5px 4.59px hsl(var(--shadow-color) / 4.06%),
|
|
17
|
-
0 1.34px 2.45px hsl(var(--shadow-color) / 2.35%),
|
|
18
|
-
0 0.75px 1.37px hsl(var(--shadow-color) / 4%),
|
|
19
|
-
0 0.39px 0.73px hsl(var(--shadow-color) / 1.65%),
|
|
20
|
-
0 0.16px 0.3px hsl(var(--shadow-color) / 0.94%);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[data-elevation='2'],
|
|
24
|
-
[data-elevation-hover='2']:hover {
|
|
25
|
-
transition: box-shadow env(--duration-100) env(--easing-standard);
|
|
26
|
-
box-shadow:
|
|
27
|
-
0 9px 25px hsl(var(--shadow-color) / 8%),
|
|
28
|
-
0 3.75px 10.44px hsl(var(--shadow-color) / 6.35%),
|
|
29
|
-
0 2.01px 5.58px hsl(var(--shadow-color) / 4.75%),
|
|
30
|
-
0 1.12px 3.13px hsl(var(--shadow-color) / 4.5%),
|
|
31
|
-
0 0.6px 1.66px hsl(var(--shadow-color) / 4.25%),
|
|
32
|
-
0 0.25px 0.69px hsl(var(--shadow-color) / 3.65%);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
[data-elevation='3'],
|
|
36
|
-
[data-elevation-hover='3']:hover {
|
|
37
|
-
transition: box-shadow env(--duration-100) env(--easing-standard);
|
|
38
|
-
box-shadow:
|
|
39
|
-
0 18px 40px hsl(var(--shadow-color) / 9%),
|
|
40
|
-
0 7.51px 16.71px hsl(var(--shadow-color) / 5.63%),
|
|
41
|
-
0 4.02px 8.93px hsl(var(--shadow-color) / 4.15%),
|
|
42
|
-
0 2.25px 5px hsl(var(--shadow-color) / 4%),
|
|
43
|
-
0 1.19px 2.66px hsl(var(--shadow-color) / 3.85%),
|
|
44
|
-
0 0.49px 1.1px hsl(var(--shadow-color) / 3.37%);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
[data-elevation='4'],
|
|
48
|
-
[data-elevation-hover='4']:hover {
|
|
49
|
-
transition: box-shadow env(--duration-100) env(--easing-standard);
|
|
50
|
-
box-shadow:
|
|
51
|
-
0 33px 78px hsl(var(--shadow-color) / 11%),
|
|
52
|
-
0 12.04px 28.47px hsl(var(--shadow-color) / 7.59%),
|
|
53
|
-
0 5.84px 13.82px hsl(var(--shadow-color) / 6.12%),
|
|
54
|
-
0 2.86px 6.77px hsl(var(--shadow-color) / 4.88%),
|
|
55
|
-
0 1.13px 2.67px hsl(var(--shadow-color) / 5.41%);
|
|
56
|
-
}
|
|
1
|
+
[data-elevation]{--shadow-color:0deg 0% 0%}[data-elevation-hover="0"]:hover,[data-elevation="0"]{box-shadow:none;transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="1"]:hover,[data-elevation="1"]{box-shadow:0 3px 13px hsl(var(--shadow-color)/6%),0 2.5px 4.59px hsl(var(--shadow-color)/4.06%),0 1.34px 2.45px hsl(var(--shadow-color)/2.35%),0 .75px 1.37px hsl(var(--shadow-color)/4%),0 .39px .73px hsl(var(--shadow-color)/1.65%),0 .16px .3px hsl(var(--shadow-color)/.94%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="2"]:hover,[data-elevation="2"]{box-shadow:0 9px 25px hsl(var(--shadow-color)/8%),0 3.75px 10.44px hsl(var(--shadow-color)/6.35%),0 2.01px 5.58px hsl(var(--shadow-color)/4.75%),0 1.12px 3.13px hsl(var(--shadow-color)/4.5%),0 .6px 1.66px hsl(var(--shadow-color)/4.25%),0 .25px .69px hsl(var(--shadow-color)/3.65%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="3"]:hover,[data-elevation="3"]{box-shadow:0 18px 40px hsl(var(--shadow-color)/9%),0 7.51px 16.71px hsl(var(--shadow-color)/5.63%),0 4.02px 8.93px hsl(var(--shadow-color)/4.15%),0 2.25px 5px hsl(var(--shadow-color)/4%),0 1.19px 2.66px hsl(var(--shadow-color)/3.85%),0 .49px 1.1px hsl(var(--shadow-color)/3.37%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="4"]:hover,[data-elevation="4"]{box-shadow:0 33px 78px hsl(var(--shadow-color)/11%),0 12.04px 28.47px hsl(var(--shadow-color)/7.59%),0 5.84px 13.82px hsl(var(--shadow-color)/6.12%),0 2.86px 6.77px hsl(var(--shadow-color)/4.88%),0 1.13px 2.67px hsl(var(--shadow-color)/5.41%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}
|
package/core/typography.css
CHANGED
|
@@ -1,117 +1 @@
|
|
|
1
|
-
:where(p) {
|
|
2
|
-
line-height: 1.5;
|
|
3
|
-
min-block-size: 0.01vh;
|
|
4
|
-
font-size: 1rem;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
small {
|
|
8
|
-
font-size: 0.7em;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
strong,
|
|
12
|
-
b {
|
|
13
|
-
font-weight: 600;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
:where(a:any-link) {
|
|
17
|
-
color: var(--global-interactive-text);
|
|
18
|
-
text-decoration: none;
|
|
19
|
-
background-image: linear-gradient(currentColor, currentColor);
|
|
20
|
-
background-position: 0% 100%;
|
|
21
|
-
background-repeat: no-repeat;
|
|
22
|
-
background-size: 0% 1px;
|
|
23
|
-
word-break: break-word;
|
|
24
|
-
transition: background-size env(--duration-200) env(--easing-entrance);
|
|
25
|
-
|
|
26
|
-
&:hover,
|
|
27
|
-
&:focus {
|
|
28
|
-
background-size: 100% 1px;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
del {
|
|
34
|
-
padding: 2px 4px;
|
|
35
|
-
background-color: var(--highlight-red-background);
|
|
36
|
-
box-shadow: 0 0 0 2px var(--highlight-red-background);
|
|
37
|
-
color: var(--highlight-red-foreground);
|
|
38
|
-
border-radius: env(--radius-4);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
ins {
|
|
42
|
-
padding: 2px 4px;
|
|
43
|
-
background-color: var(--highlight-green-background);
|
|
44
|
-
box-shadow: 0 0 0 2px var(--highlight-green-background);
|
|
45
|
-
text-decoration: none;
|
|
46
|
-
color: var(--highlight-green-foreground);
|
|
47
|
-
border-radius: env(--radius-4);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
address {
|
|
51
|
-
font-style: normal;
|
|
52
|
-
line-height: inherit;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
dt {
|
|
56
|
-
font-weight: 600;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
dd {
|
|
60
|
-
margin: 0;
|
|
61
|
-
padding: 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
ol,
|
|
65
|
-
ul {
|
|
66
|
-
padding-left: 1rem;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
ul {
|
|
70
|
-
& li::marker {
|
|
71
|
-
font-size: inherit;
|
|
72
|
-
text-align: right;
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
min-inline-size: env(--space-32);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
ol {
|
|
79
|
-
& li::marker {
|
|
80
|
-
font-size: inherit;
|
|
81
|
-
font-weight: 600;
|
|
82
|
-
min-inline-size: env(--space-32);
|
|
83
|
-
font-variant-numeric: tabular-nums;
|
|
84
|
-
white-space: nowrap;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
kbd {
|
|
89
|
-
border: 1px solid var(--dimmed-1);
|
|
90
|
-
padding: 2px 4px;
|
|
91
|
-
box-shadow: 0 2px 0 var(--dimmed-1);
|
|
92
|
-
border-radius: env(--radius-4);
|
|
93
|
-
font-weight: 600;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
mark {
|
|
97
|
-
background: var(--highlight-yellow-background);
|
|
98
|
-
color: var(--highlight-yellow-foreground);
|
|
99
|
-
padding: 0 2px;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
abbr {
|
|
103
|
-
text-decoration: underline dashed var(--cta-default);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
label,
|
|
107
|
-
legend {
|
|
108
|
-
font-size: inherit;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
code {
|
|
112
|
-
color: var(--highlight-red-foreground);
|
|
113
|
-
border-radius: env(--radius-4);
|
|
114
|
-
padding: 2px 4px;
|
|
115
|
-
font-size: 1em;
|
|
116
|
-
font-family: env(--font-family-mono);
|
|
117
|
-
}
|
|
1
|
+
:where(p){font-size:.89rem;line-height:1.5;min-block-size:.01vh}small{font-size:.7em}b,strong{font-weight:600}:where(a:any-link){background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:0 1px;color:var(--global-interactive-text);text-decoration:none;transition:background-size .2s cubic-bezier(0,0,.34,1);word-break:break-word}:where(a:any-link):focus,:where(a:any-link):hover{background-size:100% 1px}del{background-color:var(--highlight-red-background);box-shadow:0 0 0 2px var(--highlight-red-background);color:var(--highlight-red-foreground)}del,ins{border-radius:.22rem;padding:2px 4px}ins{background-color:var(--highlight-green-background);box-shadow:0 0 0 2px var(--highlight-green-background);color:var(--highlight-green-foreground);text-decoration:none}address{font-style:normal;line-height:inherit}dt{font-weight:600}dd{margin:0;padding:0}ol,ul{padding-left:1rem}ul li::marker{font-size:inherit;font-weight:600;min-inline-size:1.78rem;text-align:right}ol li::marker{font-feature-settings:"tnum";font-size:inherit;font-variant-numeric:tabular-nums;font-weight:600;min-inline-size:1.78rem;white-space:nowrap}kbd{border:1px solid var(--dimmed-1);border-radius:.22rem;box-shadow:0 2px 0 var(--dimmed-1);font-weight:600;padding:2px 4px}mark{background:var(--highlight-yellow-background);color:var(--highlight-yellow-foreground);padding:0 2px}abbr{text-decoration:underline dashed var(--cta-default)}label,legend{font-size:inherit}code{background-color:var(--global-vibrancy-background);border-radius:.22rem;font-family:monospace;font-size:1em;padding:0 4px 3px;vertical-align:top}
|
|
@@ -27,4 +27,22 @@
|
|
|
27
27
|
|
|
28
28
|
/* Motion Media Queries */
|
|
29
29
|
|
|
30
|
-
@custom-media --
|
|
30
|
+
@custom-media --motion (prefers-reduced-motion: no-preference);
|
|
31
|
+
@custom-media --reduced-motion (prefers-reduced-motion: reduce);
|
|
32
|
+
|
|
33
|
+
/* Opacity Media Queries */
|
|
34
|
+
|
|
35
|
+
@custom-media --opacity (prefers-reduced-transparency: no-preference);
|
|
36
|
+
@custom-media --reduce-opacity (prefers-reduced-transparency: reduce);
|
|
37
|
+
|
|
38
|
+
/* Contrast Media Queries */
|
|
39
|
+
|
|
40
|
+
@custom-media --high-contrast (prefers-contrast: high);
|
|
41
|
+
@custom-media --low-contrast (prefers-contrast: low);
|
|
42
|
+
|
|
43
|
+
/* Pointer Media Queries */
|
|
44
|
+
|
|
45
|
+
@custom-media --touch (hover: none) and (pointer: coarse);
|
|
46
|
+
@custom-media --stylus (hover: none) and (pointer: fine);
|
|
47
|
+
@custom-media --pointer (hover) and (pointer: coarse);
|
|
48
|
+
@custom-media --mouse (hover) and (pointer: fine);
|
package/core.css
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
@import './core/elevations.css';
|
|
3
|
-
@import './core/media.css';
|
|
4
|
-
@import './core/typography.css';
|
|
5
|
-
@import './core/vibrancy.css';
|
|
1
|
+
html{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;background-color:var(--global-background);box-sizing:border-box;font-size:112.5%;line-height:1.5}*,:after,:before{-webkit-tap-highlight-color:hsla(0,100%,47%,.2);box-sizing:inherit;margin:0}.focus-visible{outline:5px auto Highlight;outline:5px auto -webkit-focus-ring-color}:focus-visible{outline:5px auto Highlight;outline:5px auto -webkit-focus-ring-color}body{font-feature-settings:"calt" off;color:var(--global-foreground);font-family:system-ui,sans-serif;margin:0;scroll-padding:4.44rem}::selection{background-color:var(--dimmed-7);color:var(--dimmed-0);text-shadow:none}img{display:block;inline-size:100%;max-inline-size:100%}svg:not([fill]){fill:currentColor}fieldset{border:0}[data-elevation]{--shadow-color:0deg 0% 0%}[data-elevation-hover="0"]:hover,[data-elevation="0"]{box-shadow:none;transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="1"]:hover,[data-elevation="1"]{box-shadow:0 3px 13px hsl(var(--shadow-color)/6%),0 2.5px 4.59px hsl(var(--shadow-color)/4.06%),0 1.34px 2.45px hsl(var(--shadow-color)/2.35%),0 .75px 1.37px hsl(var(--shadow-color)/4%),0 .39px .73px hsl(var(--shadow-color)/1.65%),0 .16px .3px hsl(var(--shadow-color)/.94%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="2"]:hover,[data-elevation="2"]{box-shadow:0 9px 25px hsl(var(--shadow-color)/8%),0 3.75px 10.44px hsl(var(--shadow-color)/6.35%),0 2.01px 5.58px hsl(var(--shadow-color)/4.75%),0 1.12px 3.13px hsl(var(--shadow-color)/4.5%),0 .6px 1.66px hsl(var(--shadow-color)/4.25%),0 .25px .69px hsl(var(--shadow-color)/3.65%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="3"]:hover,[data-elevation="3"]{box-shadow:0 18px 40px hsl(var(--shadow-color)/9%),0 7.51px 16.71px hsl(var(--shadow-color)/5.63%),0 4.02px 8.93px hsl(var(--shadow-color)/4.15%),0 2.25px 5px hsl(var(--shadow-color)/4%),0 1.19px 2.66px hsl(var(--shadow-color)/3.85%),0 .49px 1.1px hsl(var(--shadow-color)/3.37%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}[data-elevation-hover="4"]:hover,[data-elevation="4"]{box-shadow:0 33px 78px hsl(var(--shadow-color)/11%),0 12.04px 28.47px hsl(var(--shadow-color)/7.59%),0 5.84px 13.82px hsl(var(--shadow-color)/6.12%),0 2.86px 6.77px hsl(var(--shadow-color)/4.88%),0 1.13px 2.67px hsl(var(--shadow-color)/5.41%);transition:box-shadow .1s cubic-bezier(.3,.07,.34,1)}:where(p){font-size:.89rem;line-height:1.5;min-block-size:.01vh}small{font-size:.7em}b,strong{font-weight:600}:where(a:any-link){background-image:linear-gradient(currentColor,currentColor);background-position:0 100%;background-repeat:no-repeat;background-size:0 1px;color:var(--global-interactive-text);text-decoration:none;transition:background-size .2s cubic-bezier(0,0,.34,1);word-break:break-word}:where(a:any-link):focus,:where(a:any-link):hover{background-size:100% 1px}del{background-color:var(--highlight-red-background);box-shadow:0 0 0 2px var(--highlight-red-background);color:var(--highlight-red-foreground)}del,ins{border-radius:.22rem;padding:2px 4px}ins{background-color:var(--highlight-green-background);box-shadow:0 0 0 2px var(--highlight-green-background);color:var(--highlight-green-foreground);text-decoration:none}address{font-style:normal;line-height:inherit}dt{font-weight:600}dd{margin:0;padding:0}ol,ul{padding-left:1rem}ul li::marker{font-size:inherit;font-weight:600;min-inline-size:1.78rem;text-align:right}ol li::marker{font-feature-settings:"tnum";font-size:inherit;font-variant-numeric:tabular-nums;font-weight:600;min-inline-size:1.78rem;white-space:nowrap}kbd{border:1px solid var(--dimmed-1);border-radius:.22rem;box-shadow:0 2px 0 var(--dimmed-1);font-weight:600;padding:2px 4px}mark{background:var(--highlight-yellow-background);color:var(--highlight-yellow-foreground);padding:0 2px}abbr{text-decoration:underline dashed var(--cta-default)}label,legend{font-size:inherit}code{background-color:var(--global-vibrancy-background);border-radius:.22rem;font-family:monospace;font-size:1em;padding:0 4px 3px;vertical-align:top}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export declare type DatetimeProps = HTMLAttributes<HTMLTimeElement> & {
|
|
3
|
+
date: string;
|
|
4
|
+
locale?: string | string[];
|
|
5
|
+
options?: Intl.DateTimeFormatOptions;
|
|
6
|
+
};
|
|
7
|
+
export declare const Datetime: ({ date, locale, options, ...otherProps }: DatetimeProps) => JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
export const Datetime = ({ date, locale = 'en-US', options, ...otherProps }) => {
|
|
4
|
+
const [datetime, setDateTime] = useState('');
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const timeDate = new Date(date);
|
|
7
|
+
const humanDate = new Intl.DateTimeFormat(locale, {
|
|
8
|
+
year: 'numeric',
|
|
9
|
+
month: 'long',
|
|
10
|
+
day: 'numeric',
|
|
11
|
+
...options
|
|
12
|
+
}).format(timeDate);
|
|
13
|
+
setDateTime(humanDate);
|
|
14
|
+
}, [date, locale, options]);
|
|
15
|
+
return (_jsx("time", { dateTime: date, ...otherProps, children: datetime }, void 0));
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Datetime } from './datetime';
|