@calcifer-design/ui 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.d.ts +5 -2
- package/dist/components/Alert/Alert.js +1 -0
- package/dist/components/Alert/Alert.module.js +5 -5
- package/dist/components/Alert/Alert_module.css +20 -17
- package/dist/components/Avatar/Avatar.d.ts +16 -2
- package/dist/components/Avatar/Avatar.js +23 -7
- package/dist/components/Avatar/Avatar.module.js +3 -3
- package/dist/components/Avatar/Avatar_module.css +58 -17
- package/dist/components/Avatar/avatarColor.d.ts +12 -0
- package/dist/components/Avatar/avatarColor.js +12 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +37 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +52 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js +8 -0
- package/dist/components/AvatarGroup/AvatarGroup_module.css +67 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.js +6 -6
- package/dist/components/Breadcrumb/Breadcrumb_module.css +7 -7
- package/dist/components/Button/Button.d.ts +40 -4
- package/dist/components/Button/Button.js +48 -11
- package/dist/components/Button/Button.module.js +6 -2
- package/dist/components/Button/Button_module.css +143 -17
- package/dist/components/Button/LinkButton.d.ts +10 -3
- package/dist/components/Button/LinkButton.js +16 -5
- package/dist/components/Card/Card.module.js +5 -5
- package/dist/components/Card/Card_module.css +15 -9
- package/dist/components/CardList/CardList.module.js +3 -3
- package/dist/components/CardList/CardList_module.css +5 -3
- package/dist/components/Checkbox/Checkbox.module.js +2 -2
- package/dist/components/Checkbox/Checkbox_module.css +3 -3
- package/dist/components/ChoiceCard/ChoiceCard.d.ts +34 -0
- package/dist/components/ChoiceCard/ChoiceCard.js +81 -0
- package/dist/components/ChoiceCard/ChoiceCard.module.js +12 -0
- package/dist/components/ChoiceCard/ChoiceCard_module.css +161 -0
- package/dist/components/Collapsible/Collapsible.d.ts +39 -0
- package/dist/components/Collapsible/Collapsible.js +63 -0
- package/dist/components/Collapsible/Collapsible.module.js +10 -0
- package/dist/components/Collapsible/Collapsible_module.css +80 -0
- package/dist/components/DataGrid/DataGrid.module.js +32 -32
- package/dist/components/DataGrid/DataGrid_module.css +67 -62
- package/dist/components/DataTable/DataTable.module.js +9 -9
- package/dist/components/DataTable/DataTable_module.css +24 -21
- package/dist/components/DatePicker/DatePicker.d.ts +15 -1
- package/dist/components/DatePicker/DatePicker.js +33 -5
- package/dist/components/DatePicker/DatePicker.module.js +10 -10
- package/dist/components/DatePicker/DatePicker_module.css +22 -21
- package/dist/components/Descriptions/Descriptions.module.js +4 -4
- package/dist/components/Descriptions/Descriptions_module.css +12 -8
- package/dist/components/Dialog/Dialog.d.ts +30 -2
- package/dist/components/Dialog/Dialog.js +53 -11
- package/dist/components/Dialog/Dialog.module.js +8 -6
- package/dist/components/Dialog/Dialog_module.css +60 -13
- package/dist/components/EmptyState/EmptyState.d.ts +41 -0
- package/dist/components/EmptyState/EmptyState.js +39 -0
- package/dist/components/EmptyState/EmptyState.module.js +9 -0
- package/dist/components/EmptyState/EmptyState_module.css +65 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +5 -2
- package/dist/components/ErrorBoundary/ErrorBoundary.module.js +1 -1
- package/dist/components/ErrorBoundary/ErrorBoundary_module.css +1 -1
- package/dist/components/Field/AffixInput.d.ts +28 -0
- package/dist/components/Field/AffixInput.js +50 -0
- package/dist/components/Field/GroupFrame.d.ts +19 -0
- package/dist/components/Field/GroupFrame.js +31 -0
- package/dist/components/Field/PickerField.d.ts +8 -2
- package/dist/components/Field/PickerField.js +12 -8
- package/dist/components/Field/PickerField.module.js +4 -4
- package/dist/components/Field/PickerField_module.css +11 -6
- package/dist/components/FilterBar/FilterBar.module.js +9 -9
- package/dist/components/FilterBar/FilterBar_module.css +13 -13
- package/dist/components/Form/Form.d.ts +9 -7
- package/dist/components/Form/Form.module.js +1 -1
- package/dist/components/Form/Form_module.css +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/IconButton/IconButton.module.js +2 -2
- package/dist/components/IconButton/IconButton_module.css +28 -17
- package/dist/components/Menu/Menu.js +3 -0
- package/dist/components/Menu/Menu.module.js +2 -2
- package/dist/components/Menu/Menu_module.css +5 -4
- package/dist/components/NavMenu/NavMenu.d.ts +27 -4
- package/dist/components/NavMenu/NavMenu.js +10 -8
- package/dist/components/NavMenu/NavMenu.module.js +6 -6
- package/dist/components/NavMenu/NavMenu_module.css +37 -19
- package/dist/components/NavMenu/currentPath.d.ts +9 -0
- package/dist/components/NavMenu/currentPath.js +5 -0
- package/dist/components/PageHeading/PageHeading.module.js +3 -3
- package/dist/components/PageHeading/PageHeading_module.css +12 -9
- package/dist/components/PageShell/PageShell.module.js +5 -5
- package/dist/components/PageShell/PageShell_module.css +9 -9
- package/dist/components/Popover/Popover.js +3 -0
- package/dist/components/Popover/Popover.module.js +2 -2
- package/dist/components/Popover/Popover_module.css +6 -3
- package/dist/components/ProgressBar/ProgressBar.d.ts +55 -0
- package/dist/components/ProgressBar/ProgressBar.js +76 -0
- package/dist/components/ProgressBar/ProgressBar.module.js +12 -0
- package/dist/components/ProgressBar/ProgressBar_module.css +120 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +35 -49
- package/dist/components/RadioGroup/RadioGroup.module.js +2 -2
- package/dist/components/RadioGroup/RadioGroup_module.css +2 -2
- package/dist/components/SearchField/SearchField.d.ts +32 -0
- package/dist/components/SearchField/SearchField.js +100 -0
- package/dist/components/SearchField/SearchField.module.js +8 -0
- package/dist/components/SearchField/SearchField_module.css +34 -0
- package/dist/components/Segmented/Segmented.d.ts +23 -6
- package/dist/components/Segmented/Segmented.js +37 -20
- package/dist/components/Segmented/Segmented.module.js +4 -3
- package/dist/components/Segmented/Segmented_module.css +46 -20
- package/dist/components/Select/Select.js +3 -0
- package/dist/components/Select/Select.module.js +5 -5
- package/dist/components/Select/Select_module.css +12 -11
- package/dist/components/Skeleton/Skeleton.module.js +3 -3
- package/dist/components/Skeleton/Skeleton_module.css +9 -9
- package/dist/components/SkipLink/SkipLink.module.js +1 -1
- package/dist/components/SkipLink/SkipLink_module.css +4 -4
- package/dist/components/Spinner/Spinner.module.js +3 -3
- package/dist/components/Spinner/Spinner_module.css +7 -7
- package/dist/components/StatusDot/StatusDot.module.js +5 -5
- package/dist/components/StatusDot/StatusDot_module.css +11 -11
- package/dist/components/Steps/Steps.module.js +6 -6
- package/dist/components/Steps/Steps_module.css +19 -19
- package/dist/components/Switch/Switch.module.js +2 -2
- package/dist/components/Switch/Switch_module.css +5 -5
- package/dist/components/TabBar/TabBar.d.ts +26 -0
- package/dist/components/TabBar/TabBar.js +52 -0
- package/dist/components/TabBar/TabBar.module.js +11 -0
- package/dist/components/TabBar/TabBar_module.css +100 -0
- package/dist/components/Tabs/Tabs.module.js +4 -4
- package/dist/components/Tabs/Tabs_module.css +9 -8
- package/dist/components/Tag/Tag.module.js +1 -1
- package/dist/components/Tag/Tag_module.css +3 -2
- package/dist/components/TextArea/TextArea.module.js +1 -1
- package/dist/components/TextArea/TextArea_module.css +6 -2
- package/dist/components/TextInput/TextInput.d.ts +14 -2
- package/dist/components/TextInput/TextInput.js +4 -5
- package/dist/components/ThemeScope/PortalContainerContext.d.ts +17 -0
- package/dist/components/ThemeScope/PortalContainerContext.js +6 -0
- package/dist/components/ThemeScope/ThemeScope.d.ts +23 -0
- package/dist/components/ThemeScope/ThemeScope.js +29 -0
- package/dist/components/ThemeScope/ThemeScope.module.js +6 -0
- package/dist/components/ThemeScope/ThemeScope_module.css +10 -0
- package/dist/components/TimePicker/TimePicker.d.ts +15 -2
- package/dist/components/TimePicker/TimePicker.js +5 -5
- package/dist/components/Timeline/Timeline.module.js +8 -8
- package/dist/components/Timeline/Timeline_module.css +15 -13
- package/dist/components/ToastRegion/ToastRegion.js +3 -0
- package/dist/components/ToastRegion/ToastRegion.module.js +6 -6
- package/dist/components/ToastRegion/ToastRegion_module.css +23 -19
- package/dist/components/ToggleChip/ToggleChip.d.ts +49 -0
- package/dist/components/ToggleChip/ToggleChip.js +45 -0
- package/dist/components/ToggleChip/ToggleChip.module.js +9 -0
- package/dist/components/ToggleChip/ToggleChipGroup.d.ts +57 -0
- package/dist/components/ToggleChip/ToggleChipGroup.js +93 -0
- package/dist/components/ToggleChip/ToggleChip_module.css +97 -0
- package/dist/components/Toolbar/Toolbar.module.js +3 -3
- package/dist/components/Toolbar/Toolbar_module.css +5 -5
- package/dist/components/Tooltip/Tooltip.js +3 -0
- package/dist/components/Tree/Tree.module.js +8 -8
- package/dist/components/Tree/Tree_module.css +20 -20
- package/dist/components/TreeSelect/TreeSelect.js +3 -0
- package/dist/components/TreeSelect/TreeSelect.module.js +3 -3
- package/dist/components/TreeSelect/TreeSelect_module.css +4 -4
- package/dist/components/Upload/Upload.module.js +8 -8
- package/dist/components/Upload/Upload_module.css +16 -16
- package/dist/components/ViewField/ViewField.module.js +2 -2
- package/dist/components/ViewField/ViewField_module.css +3 -3
- package/dist/hooks/useControllable.d.ts +11 -0
- package/dist/hooks/useControllable.js +13 -0
- package/dist/hooks/useIndexedToggleGroup.d.ts +30 -0
- package/dist/hooks/useIndexedToggleGroup.js +26 -0
- package/dist/hooks/useOverflowFocusable.d.ts +17 -0
- package/dist/hooks/useOverflowFocusable.js +36 -0
- package/dist/icons/SearchIcon.d.ts +9 -0
- package/dist/icons/SearchIcon.js +23 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +12 -0
- package/dist/styles/a11y.module.js +1 -1
- package/dist/styles/a11y_module.css +1 -1
- package/dist/styles/base.css +17 -0
- package/dist/styles/closeCircle.module.js +5 -0
- package/dist/styles/closeCircle_module.css +12 -0
- package/dist/styles/field.module.js +14 -11
- package/dist/styles/field_module.css +94 -25
- package/dist/styles/pair.module.js +2 -2
- package/dist/styles/pair_module.css +5 -3
- package/dist/styles/popup.module.js +5 -5
- package/dist/styles/popup_module.css +35 -28
- package/dist/utils/focusInputFromPill.d.ts +12 -0
- package/dist/utils/focusInputFromPill.js +7 -0
- package/dist/utils/hasContent.d.ts +8 -0
- package/dist/utils/hasContent.js +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { LinkRenderProps, NavItem } from '../NavMenu/NavMenu.js';
|
|
3
|
+
export interface TabBarItem extends NavItem {
|
|
4
|
+
/** Drawn above the label. Decorative: the label names the link. */
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface TabBarProps<Item extends TabBarItem = TabBarItem> {
|
|
8
|
+
/** Two to five; a development-mode warning outside that, never a throw. */
|
|
9
|
+
items: readonly Item[];
|
|
10
|
+
currentPath: string;
|
|
11
|
+
/** Accessible name for the navigation landmark. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Lets the shell render router links; defaults to a plain anchor. */
|
|
14
|
+
renderLink?: (item: Item, props: LinkRenderProps) => ReactElement;
|
|
15
|
+
/**
|
|
16
|
+
* A circular primary action drawn beside the pill, before it. Absent, no circle is drawn. The
|
|
17
|
+
* node is the caller's, its button and its glow: the bar only positions the slot.
|
|
18
|
+
*/
|
|
19
|
+
action?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The phone's bottom navigation: a pill of icon links fixed above the bottom edge, the current
|
|
23
|
+
* page's link filled and showing its label. The other labels stay in the page for assistive
|
|
24
|
+
* technology, so every link keeps its name.
|
|
25
|
+
*/
|
|
26
|
+
export declare function TabBar<Item extends TabBarItem = TabBarItem>({ items, currentPath, label, renderLink, action, }: TabBarProps<Item>): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import a11y_module from "../../styles/a11y.module.js";
|
|
4
|
+
import { isCurrentPath } from "../NavMenu/currentPath.js";
|
|
5
|
+
import { defaultRenderLink } from "../NavMenu/NavMenu.js";
|
|
6
|
+
import TabBar_module from "./TabBar.module.js";
|
|
7
|
+
function TabBar({ items, currentPath, label = 'Primary', renderLink = defaultRenderLink, action }) {
|
|
8
|
+
const itemCount = items.length;
|
|
9
|
+
useEffect(()=>{
|
|
10
|
+
if ('production' !== process.env.NODE_ENV && (itemCount < 2 || itemCount > 5)) console.warn(`TabBar: expected two to five items, got ${itemCount}.`);
|
|
11
|
+
}, [
|
|
12
|
+
itemCount
|
|
13
|
+
]);
|
|
14
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
15
|
+
className: TabBar_module.root,
|
|
16
|
+
children: [
|
|
17
|
+
action,
|
|
18
|
+
/*#__PURE__*/ jsx("nav", {
|
|
19
|
+
className: TabBar_module.nav,
|
|
20
|
+
"aria-label": label,
|
|
21
|
+
children: /*#__PURE__*/ jsx("ul", {
|
|
22
|
+
className: TabBar_module.pill,
|
|
23
|
+
role: "list",
|
|
24
|
+
children: items.map((item)=>{
|
|
25
|
+
const isCurrent = isCurrentPath(item.href, currentPath);
|
|
26
|
+
return /*#__PURE__*/ jsx("li", {
|
|
27
|
+
className: TabBar_module.item,
|
|
28
|
+
children: renderLink(item, {
|
|
29
|
+
className: TabBar_module.link,
|
|
30
|
+
'aria-current': isCurrent ? 'page' : void 0,
|
|
31
|
+
children: /*#__PURE__*/ jsxs(Fragment, {
|
|
32
|
+
children: [
|
|
33
|
+
/*#__PURE__*/ jsx("span", {
|
|
34
|
+
className: TabBar_module.icon,
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
children: item.icon
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx("span", {
|
|
39
|
+
className: isCurrent ? TabBar_module.label : a11y_module.visuallyHidden,
|
|
40
|
+
children: item.label
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
}, item.href);
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export { TabBar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./TabBar_module.css";
|
|
2
|
+
const TabBar_module = {
|
|
3
|
+
root: "ui0-8-0-root-vpYCT",
|
|
4
|
+
nav: "ui0-8-0-nav-inXgJ",
|
|
5
|
+
pill: "ui0-8-0-pill-IYYM_",
|
|
6
|
+
item: "ui0-8-0-item-pp7SA",
|
|
7
|
+
link: "ui0-8-0-link-TeKQa",
|
|
8
|
+
icon: "ui0-8-0-icon-JWqp9",
|
|
9
|
+
label: "ui0-8-0-label-VjoKT"
|
|
10
|
+
};
|
|
11
|
+
export default TabBar_module;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
.ui0-8-0-root-vpYCT {
|
|
2
|
+
inset-inline: var(--space-4);
|
|
3
|
+
gap: var(--space-3);
|
|
4
|
+
z-index: 40;
|
|
5
|
+
align-items: center;
|
|
6
|
+
display: flex;
|
|
7
|
+
position: fixed;
|
|
8
|
+
inset-block-end: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ui0-8-0-nav-inXgJ {
|
|
12
|
+
flex: 1;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ui0-8-0-pill-IYYM_ {
|
|
18
|
+
--tab-bar-pill-padding-block: calc(var(--space-1) * .625);
|
|
19
|
+
min-width: 0;
|
|
20
|
+
padding-block: var(--tab-bar-pill-padding-block);
|
|
21
|
+
padding-inline: var(--space-1);
|
|
22
|
+
border-radius: var(--radius-full);
|
|
23
|
+
background: var(--color-tab-bar);
|
|
24
|
+
box-shadow: var(--shadow-tab-bar);
|
|
25
|
+
flex: 1;
|
|
26
|
+
justify-content: space-around;
|
|
27
|
+
margin: 0;
|
|
28
|
+
list-style: none;
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ui0-8-0-item-pp7SA {
|
|
33
|
+
min-width: var(--size-touch);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ui0-8-0-link-TeKQa {
|
|
37
|
+
--tab-bar-current-inset: calc((var(--size-touch) - 1.0625rem) / 2 - var(--space-2));
|
|
38
|
+
isolation: isolate;
|
|
39
|
+
min-height: var(--size-touch);
|
|
40
|
+
min-width: var(--size-touch);
|
|
41
|
+
border-radius: var(--radius-full);
|
|
42
|
+
color: var(--color-tab-bar-text);
|
|
43
|
+
justify-content: center;
|
|
44
|
+
align-items: center;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
display: flex;
|
|
47
|
+
position: relative;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ui0-8-0-link-TeKQa[aria-current="page"] {
|
|
51
|
+
gap: var(--space-2);
|
|
52
|
+
padding-inline: var(--space-3);
|
|
53
|
+
color: var(--color-tab-bar-active-text);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ui0-8-0-link-TeKQa[aria-current="page"]:before {
|
|
57
|
+
content: "";
|
|
58
|
+
inset-inline: 0;
|
|
59
|
+
inset-block: var(--tab-bar-current-inset);
|
|
60
|
+
z-index: -1;
|
|
61
|
+
border-radius: var(--radius-full);
|
|
62
|
+
background: var(--color-tab-bar-active);
|
|
63
|
+
box-shadow: var(--shadow-soft);
|
|
64
|
+
position: absolute;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ui0-8-0-icon-JWqp9 {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ui0-8-0-icon-JWqp9 > svg {
|
|
72
|
+
width: 1.3125rem;
|
|
73
|
+
height: 1.3125rem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ui0-8-0-link-TeKQa[aria-current="page"] .ui0-8-0-icon-JWqp9 > svg {
|
|
77
|
+
width: 1.0625rem;
|
|
78
|
+
height: 1.0625rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ui0-8-0-label-VjoKT {
|
|
82
|
+
min-width: 0;
|
|
83
|
+
font-family: var(--font-sans);
|
|
84
|
+
font-size: var(--text-sm);
|
|
85
|
+
font-weight: var(--font-weight-button);
|
|
86
|
+
text-overflow: ellipsis;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (forced-colors: active) {
|
|
92
|
+
.ui0-8-0-pill-IYYM_ {
|
|
93
|
+
border: 1px solid #0000;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ui0-8-0-link-TeKQa[aria-current="page"]:before {
|
|
97
|
+
outline: 1px solid highlight;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./Tabs_module.css";
|
|
2
2
|
const Tabs_module = {
|
|
3
|
-
root: "root-Hb4Mh",
|
|
4
|
-
list: "list-ZEK7A",
|
|
5
|
-
tab: "tab-FRO0R",
|
|
6
|
-
indicator: "indicator-a2Roe"
|
|
3
|
+
root: "ui0-8-0-root-Hb4Mh",
|
|
4
|
+
list: "ui0-8-0-list-ZEK7A",
|
|
5
|
+
tab: "ui0-8-0-tab-FRO0R",
|
|
6
|
+
indicator: "ui0-8-0-indicator-a2Roe"
|
|
7
7
|
};
|
|
8
8
|
export default Tabs_module;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.root-Hb4Mh {
|
|
1
|
+
.ui0-8-0-root-Hb4Mh {
|
|
2
2
|
gap: var(--space-4);
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
display: flex;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.list-ZEK7A {
|
|
7
|
+
.ui0-8-0-list-ZEK7A {
|
|
8
8
|
gap: var(--space-1);
|
|
9
9
|
padding-block: var(--space-1);
|
|
10
10
|
border-bottom: 1px solid var(--color-border);
|
|
@@ -14,11 +14,13 @@
|
|
|
14
14
|
overflow-x: auto;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.tab-FRO0R {
|
|
17
|
+
.ui0-8-0-tab-FRO0R {
|
|
18
18
|
min-height: var(--size-touch);
|
|
19
19
|
padding: var(--space-2) var(--space-3);
|
|
20
20
|
color: var(--color-text-muted);
|
|
21
|
+
font-family: var(--font-sans);
|
|
21
22
|
font-size: var(--text-sm);
|
|
23
|
+
font-weight: var(--font-weight-heading);
|
|
22
24
|
cursor: pointer;
|
|
23
25
|
transition-property: color;
|
|
24
26
|
transition-duration: var(--motion-duration-1);
|
|
@@ -26,24 +28,23 @@
|
|
|
26
28
|
background: none;
|
|
27
29
|
border: 0;
|
|
28
30
|
flex: none;
|
|
29
|
-
font-weight: 600;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
.tab-FRO0R[data-active] {
|
|
33
|
+
.ui0-8-0-tab-FRO0R[data-active] {
|
|
33
34
|
color: var(--color-text);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
.tab-FRO0R[data-disabled] {
|
|
37
|
+
.ui0-8-0-tab-FRO0R[data-disabled] {
|
|
37
38
|
color: var(--color-text-muted);
|
|
38
39
|
opacity: .5;
|
|
39
40
|
cursor: not-allowed;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
.indicator-a2Roe {
|
|
43
|
+
.ui0-8-0-indicator-a2Roe {
|
|
43
44
|
bottom: -1px;
|
|
44
45
|
left: var(--active-tab-left);
|
|
45
46
|
width: var(--active-tab-width);
|
|
46
|
-
background: var(--color-
|
|
47
|
+
background: var(--color-selected);
|
|
47
48
|
height: 2px;
|
|
48
49
|
transition-property: left, width;
|
|
49
50
|
transition-duration: var(--motion-duration-2);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
.root-lzcr8 {
|
|
1
|
+
.ui0-8-0-root-lzcr8 {
|
|
2
2
|
min-height: 1.5rem;
|
|
3
3
|
padding: 0 var(--space-2);
|
|
4
4
|
border: 1px solid var(--color-border);
|
|
5
5
|
border-radius: var(--radius-full);
|
|
6
|
+
font-family: var(--font-sans);
|
|
6
7
|
font-size: var(--text-xs);
|
|
7
8
|
line-height: var(--leading-snug);
|
|
8
9
|
white-space: nowrap;
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
display: inline-flex;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
.root-lzcr8[data-tone="accent"] {
|
|
16
|
+
.ui0-8-0-root-lzcr8[data-tone="accent"] {
|
|
16
17
|
background: var(--color-accent-soft);
|
|
17
18
|
border-color: var(--color-border-accent);
|
|
18
19
|
color: var(--color-text);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
.root-rs4DH {
|
|
1
|
+
.ui0-8-0-root-rs4DH {
|
|
2
2
|
resize: vertical;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
textarea.ui0-8-0-root-rs4DH {
|
|
6
|
+
border-radius: var(--radius-panel);
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
@supports (field-sizing: content) {
|
|
6
|
-
.root-rs4DH[data-auto-resize] {
|
|
10
|
+
.ui0-8-0-root-rs4DH[data-auto-resize] {
|
|
7
11
|
field-sizing: content;
|
|
8
12
|
min-height: calc(var(--text-area-rows) * 1lh + 2 * var(--space-2) + 2px);
|
|
9
13
|
resize: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
|
|
2
2
|
export type TextInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'number';
|
|
3
3
|
export interface TextInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'className' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'required' | 'name' | 'disabled'> {
|
|
4
4
|
/** Ignored when `render` is given: the caller's element brings its own. */
|
|
@@ -13,5 +13,17 @@ export interface TextInputProps extends Omit<ComponentPropsWithoutRef<'input'>,
|
|
|
13
13
|
* is the tier's escape hatch for a control the library does not ship.
|
|
14
14
|
*/
|
|
15
15
|
render?: ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* A decorative glyph inside the field, before the text: an icon from your own set, sized to 1rem
|
|
18
|
+
* and coloured by the text-muted role. The field's label still names the input. Ignored when
|
|
19
|
+
* `render` is given, as `type` is: the caller's element is the control and has no pill to hold it.
|
|
20
|
+
*
|
|
21
|
+
* With an icon the visible field is a pill around the input, and the input's own props (`style`,
|
|
22
|
+
* `hidden` and `title` included) reach the inner input, not the pill: size the field from its
|
|
23
|
+
* container. The pill is a different element from the bare input, so changing `startIcon` between
|
|
24
|
+
* present and absent remounts the input and loses an uncontrolled value and the focus: decide the
|
|
25
|
+
* icon once, or control the value.
|
|
26
|
+
*/
|
|
27
|
+
startIcon?: ReactNode;
|
|
16
28
|
}
|
|
17
|
-
export declare function TextInput({ type, value, defaultValue, onValueChange, render, ...rest }: TextInputProps): import("react").JSX.Element;
|
|
29
|
+
export declare function TextInput({ type, value, defaultValue, onValueChange, render, startIcon, ...rest }: TextInputProps): import("react").JSX.Element;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { AffixInput } from "../Field/AffixInput.js";
|
|
3
3
|
import { useFieldRequired } from "../Field/Field.js";
|
|
4
|
-
|
|
5
|
-
function TextInput({ type = 'text', value, defaultValue, onValueChange, render, ...rest }) {
|
|
4
|
+
function TextInput({ type = 'text', value, defaultValue, onValueChange, render, startIcon, ...rest }) {
|
|
6
5
|
const required = useFieldRequired();
|
|
7
|
-
return /*#__PURE__*/ jsx(
|
|
6
|
+
return /*#__PURE__*/ jsx(AffixInput, {
|
|
8
7
|
...rest,
|
|
9
|
-
|
|
8
|
+
startIcon: void 0 === render ? startIcon : void 0,
|
|
10
9
|
type: void 0 === render ? type : void 0,
|
|
11
10
|
value: value,
|
|
12
11
|
defaultValue: defaultValue,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Base UI `container` value: the scope's portal host element, or `null` while it has not
|
|
3
|
+
* attached yet. Base UI waits on an explicit `null` and resolves the portal once the element
|
|
4
|
+
* arrives (R19).
|
|
5
|
+
*/
|
|
6
|
+
export type PortalContainer = HTMLDivElement | null;
|
|
7
|
+
/**
|
|
8
|
+
* The nearest `ThemeScope`'s portal host. `undefined` is the default and means there is no scope:
|
|
9
|
+
* Base UI then portals to `<body>`, exactly as before scopes existed (R6). Internal: the hook is
|
|
10
|
+
* the public way in.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PortalContainerContext: import("react").Context<PortalContainer | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* The nearest `ThemeScope`'s portal host (`null` until the scope's first commit has attached it),
|
|
15
|
+
* or `undefined` outside any scope. Pass it as `container` to a Base UI `Portal`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function usePortalContainer(): PortalContainer | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Theme } from '@calcifer-design/tokens';
|
|
2
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
3
|
+
/** The two modes; equals the tokens package's `ThemeName`. */
|
|
4
|
+
export type ThemeMode = 'light' | 'dark';
|
|
5
|
+
export interface ThemeScopeProps {
|
|
6
|
+
/** From `defineTheme`; the generated sheet for it must be on the page (the consumer's build does that). */
|
|
7
|
+
theme: Theme;
|
|
8
|
+
/**
|
|
9
|
+
* Pins the mode by writing `data-theme` on the wrapper. Left unset, the scope follows `<html>`'s
|
|
10
|
+
* `data-theme` and then the OS preference. An unpinned scope nested in a pinned one does not
|
|
11
|
+
* inherit the outer pin (it resolves from `<html>` and the OS); pin the inner one too.
|
|
12
|
+
*/
|
|
13
|
+
mode?: ThemeMode;
|
|
14
|
+
/** Joined after the theme's class on the wrapper (an app's own layout class). */
|
|
15
|
+
className?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Scopes a theme to its subtree and gives every portal inside it a host within the scope, so
|
|
20
|
+
* dialogs, menus and toasts wear the theme too. Nested scopes each provide their own host; the
|
|
21
|
+
* nearest wins.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ThemeScope({ theme, mode, className, children }: ThemeScopeProps): ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { themeBrand } from "@calcifer-design/tokens";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { PortalContainerContext } from "./PortalContainerContext.js";
|
|
5
|
+
import ThemeScope_module from "./ThemeScope.module.js";
|
|
6
|
+
function ThemeScope({ theme, mode, className, children }) {
|
|
7
|
+
const [host, setHost] = useState(null);
|
|
8
|
+
if (true !== theme[themeBrand]) throw new Error('ThemeScope: theme must come from defineTheme');
|
|
9
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
10
|
+
className: [
|
|
11
|
+
ThemeScope_module.root,
|
|
12
|
+
theme.className,
|
|
13
|
+
className
|
|
14
|
+
].filter(Boolean).join(' '),
|
|
15
|
+
"data-theme": mode,
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ jsx(PortalContainerContext.Provider, {
|
|
18
|
+
value: host,
|
|
19
|
+
children: children
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ jsx("div", {
|
|
22
|
+
className: ThemeScope_module.portalHost,
|
|
23
|
+
"data-portal-host": "",
|
|
24
|
+
ref: setHost
|
|
25
|
+
})
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { ThemeScope };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
export interface TimePickerProps extends Omit<ComponentPropsWithoutRef<'input'>, 'className' | 'style' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'required' | 'name' | 'disabled' | 'min' | 'max' | 'step' | 'children'> {
|
|
3
3
|
/** `HH:mm`, or `''` for no time. A string the browser cannot read as a time shows as empty. */
|
|
4
4
|
value?: string;
|
|
@@ -11,9 +11,22 @@ export interface TimePickerProps extends Omit<ComponentPropsWithoutRef<'input'>,
|
|
|
11
11
|
max?: string;
|
|
12
12
|
/** The granularity in seconds, as the native attribute has it: 900 is every quarter hour. */
|
|
13
13
|
step?: number;
|
|
14
|
+
/**
|
|
15
|
+
* A decorative glyph inside the field, before the time: an icon from your own set, sized to 1rem
|
|
16
|
+
* and coloured by the text-muted role. The field's label still names the input. It takes the
|
|
17
|
+
* place of the browser's own picker button, which is hidden, and a press on it opens the picker
|
|
18
|
+
* where the browser has one; typing a time is unchanged.
|
|
19
|
+
*
|
|
20
|
+
* With an icon the visible field is a pill around the input, and the input's own props (`hidden`
|
|
21
|
+
* and `title` included) reach the inner input, not the pill: size the field from its container.
|
|
22
|
+
* The pill is a different element from the bare input, so changing `startIcon` between present and
|
|
23
|
+
* absent remounts the input and loses an uncontrolled value and the focus: decide the icon once,
|
|
24
|
+
* or control the value.
|
|
25
|
+
*/
|
|
26
|
+
startIcon?: ReactNode;
|
|
14
27
|
}
|
|
15
28
|
/**
|
|
16
29
|
* Goes inside `Field`. The native control is the choice here: it handles locale, 12 or 24-hour
|
|
17
30
|
* entry, the keyboard and mobile wheels, and none of that is worth rebuilding.
|
|
18
31
|
*/
|
|
19
|
-
export declare function TimePicker({ value, defaultValue, onValueChange, ...rest }: TimePickerProps): import("react").JSX.Element;
|
|
32
|
+
export declare function TimePicker({ value, defaultValue, onValueChange, startIcon, ...rest }: TimePickerProps): import("react").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import field_module from "../../styles/field.module.js";
|
|
2
|
+
import { AffixInput } from "../Field/AffixInput.js";
|
|
4
3
|
import { useFieldRequired } from "../Field/Field.js";
|
|
5
|
-
function TimePicker({ value, defaultValue, onValueChange, ...rest }) {
|
|
4
|
+
function TimePicker({ value, defaultValue, onValueChange, startIcon, ...rest }) {
|
|
6
5
|
const required = useFieldRequired();
|
|
7
|
-
return /*#__PURE__*/ jsx(
|
|
6
|
+
return /*#__PURE__*/ jsx(AffixInput, {
|
|
8
7
|
...rest,
|
|
9
|
-
|
|
8
|
+
startIcon: startIcon,
|
|
9
|
+
iconOpensPicker: true,
|
|
10
10
|
type: "time",
|
|
11
11
|
value: value,
|
|
12
12
|
defaultValue: defaultValue,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./Timeline_module.css";
|
|
2
2
|
const Timeline_module = {
|
|
3
|
-
list: "list-idznt",
|
|
4
|
-
item: "item-qvxp0",
|
|
5
|
-
marker: "marker-bb9HI",
|
|
6
|
-
body: "body-Ebp5l",
|
|
7
|
-
title: "title-ppcg_",
|
|
8
|
-
meta: "meta-Qkwq4",
|
|
9
|
-
tone: "tone-AP_HF",
|
|
10
|
-
description: "description-lVcj_"
|
|
3
|
+
list: "ui0-8-0-list-idznt",
|
|
4
|
+
item: "ui0-8-0-item-qvxp0",
|
|
5
|
+
marker: "ui0-8-0-marker-bb9HI",
|
|
6
|
+
body: "ui0-8-0-body-Ebp5l",
|
|
7
|
+
title: "ui0-8-0-title-ppcg_",
|
|
8
|
+
meta: "ui0-8-0-meta-Qkwq4",
|
|
9
|
+
tone: "ui0-8-0-tone-AP_HF",
|
|
10
|
+
description: "ui0-8-0-description-lVcj_"
|
|
11
11
|
};
|
|
12
12
|
export default Timeline_module;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.list-idznt {
|
|
1
|
+
.ui0-8-0-list-idznt {
|
|
2
2
|
flex-direction: column;
|
|
3
3
|
margin: 0;
|
|
4
4
|
padding: 0;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
display: flex;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.item-qvxp0 {
|
|
9
|
+
.ui0-8-0-item-qvxp0 {
|
|
10
10
|
--timeline-marker-size: .75rem;
|
|
11
11
|
--timeline-color: var(--color-neutral);
|
|
12
12
|
--timeline-tint: var(--color-surface-2);
|
|
@@ -18,29 +18,29 @@
|
|
|
18
18
|
position: relative;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.item-qvxp0[data-tone="accent"] {
|
|
21
|
+
.ui0-8-0-item-qvxp0[data-tone="accent"] {
|
|
22
22
|
--timeline-color: var(--color-accent);
|
|
23
23
|
--timeline-tint: var(--color-accent-soft);
|
|
24
24
|
--timeline-line: var(--color-border-accent);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.item-qvxp0[data-tone="success"] {
|
|
27
|
+
.ui0-8-0-item-qvxp0[data-tone="success"] {
|
|
28
28
|
--timeline-color: var(--color-success);
|
|
29
29
|
--timeline-tint: color-mix(in srgb, var(--color-success) 14%, transparent);
|
|
30
30
|
--timeline-line: color-mix(in srgb, var(--color-success) 35%, transparent);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.item-qvxp0[data-tone="danger"] {
|
|
33
|
+
.ui0-8-0-item-qvxp0[data-tone="danger"] {
|
|
34
34
|
--timeline-color: var(--color-danger);
|
|
35
35
|
--timeline-tint: var(--color-danger-surface);
|
|
36
36
|
--timeline-line: var(--color-danger-border);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.item-qvxp0:last-child {
|
|
39
|
+
.ui0-8-0-item-qvxp0:last-child {
|
|
40
40
|
padding-block-end: 0;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.item-qvxp0:not(:last-child):before {
|
|
43
|
+
.ui0-8-0-item-qvxp0:not(:last-child):before {
|
|
44
44
|
content: "";
|
|
45
45
|
inset-block: calc(var(--space-1) + var(--timeline-marker-size)) 0;
|
|
46
46
|
border-inline-start: 1px solid var(--color-border-strong);
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
inset-inline-start: calc(var(--timeline-marker-size) / 2);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.marker-bb9HI {
|
|
51
|
+
.ui0-8-0-marker-bb9HI {
|
|
52
52
|
width: var(--timeline-marker-size);
|
|
53
53
|
height: var(--timeline-marker-size);
|
|
54
54
|
border: 1px solid var(--timeline-color);
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
margin-block-start: var(--space-1);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.body-Ebp5l {
|
|
61
|
+
.ui0-8-0-body-Ebp5l {
|
|
62
62
|
gap: var(--space-1);
|
|
63
63
|
overflow-wrap: anywhere;
|
|
64
64
|
flex-direction: column;
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
display: flex;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.title-ppcg_ {
|
|
69
|
+
.ui0-8-0-title-ppcg_ {
|
|
70
70
|
color: var(--color-text);
|
|
71
71
|
font-size: var(--text-sm);
|
|
72
72
|
font-weight: 500;
|
|
73
73
|
line-height: var(--leading-snug);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.meta-Qkwq4 {
|
|
76
|
+
.ui0-8-0-meta-Qkwq4 {
|
|
77
77
|
align-items: center;
|
|
78
78
|
gap: var(--space-2);
|
|
79
79
|
color: var(--color-text-muted);
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
display: flex;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.tone-AP_HF {
|
|
86
|
+
.ui0-8-0-tone-AP_HF {
|
|
87
87
|
padding-inline: var(--space-2);
|
|
88
88
|
border: 1px solid var(--timeline-line);
|
|
89
89
|
border-radius: var(--radius-full);
|
|
@@ -91,8 +91,10 @@
|
|
|
91
91
|
color: var(--color-text);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
.description-lVcj_ {
|
|
94
|
+
.ui0-8-0-description-lVcj_ {
|
|
95
95
|
color: var(--color-text-muted);
|
|
96
|
+
font-family: var(--font-body);
|
|
97
|
+
font-weight: var(--font-weight-body);
|
|
96
98
|
font-size: var(--text-sm);
|
|
97
99
|
line-height: var(--leading-prose);
|
|
98
100
|
}
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Toast } from "@base-ui/react/toast";
|
|
3
3
|
import { CloseIcon } from "../../icons/CloseIcon.js";
|
|
4
4
|
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
|
+
import { usePortalContainer } from "../ThemeScope/PortalContainerContext.js";
|
|
5
6
|
import popup_module from "../../styles/popup.module.js";
|
|
6
7
|
import ToastRegion_module from "./ToastRegion.module.js";
|
|
7
8
|
function toBaseOptions(options) {
|
|
@@ -64,11 +65,13 @@ function ToastList({ closeLabel }) {
|
|
|
64
65
|
}, toastObject.id));
|
|
65
66
|
}
|
|
66
67
|
function ToastRegion({ manager, label = 'Notifications', limit = 3, timeout = 5000, closeLabel = 'Close' }) {
|
|
68
|
+
const container = usePortalContainer();
|
|
67
69
|
return /*#__PURE__*/ jsx(Toast.Provider, {
|
|
68
70
|
toastManager: manager.baseManager,
|
|
69
71
|
limit: limit,
|
|
70
72
|
timeout: timeout,
|
|
71
73
|
children: /*#__PURE__*/ jsx(Toast.Portal, {
|
|
74
|
+
container: container,
|
|
72
75
|
children: /*#__PURE__*/ jsx(Toast.Viewport, {
|
|
73
76
|
className: [
|
|
74
77
|
popup_module.toastLayer,
|