@a-type/ui 6.0.27 → 6.0.28
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/icon/Icon.d.ts +2 -2
- package/dist/components/icon/Icon.js +3 -3
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/icon/Icon.module.css +4 -0
- package/dist/components/icon/Icon.stories.d.ts +1 -1
- package/dist/components/navBar/NavBar.js +1 -1
- package/dist/components/navBar/NavBar.js.map +1 -1
- package/dist/components/typography/typography.module.css +6 -3
- package/dist/themes.stories.js +2 -2
- package/dist/themes.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/components/icon/Icon.module.css +4 -0
- package/src/components/icon/Icon.tsx +15 -4
- package/src/components/navBar/NavBar.tsx +5 -1
- package/src/components/typography/typography.module.css +6 -3
- package/src/themes.stories.tsx +11 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UseRenderComponentProps } from '@base-ui/react/use-render';
|
|
2
2
|
import { IconName } from './generated/iconNames.js';
|
|
3
3
|
export interface IconProps extends UseRenderComponentProps<'svg', {
|
|
4
|
-
size
|
|
4
|
+
size?: number;
|
|
5
5
|
name: IconName;
|
|
6
6
|
loading: boolean;
|
|
7
7
|
}> {
|
|
@@ -9,6 +9,6 @@ export interface IconProps extends UseRenderComponentProps<'svg', {
|
|
|
9
9
|
size?: number;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare const Icon: ({ ref, name, size, className, loading: loadingProp, render, ...rest }: IconProps & {
|
|
12
|
+
export declare const Icon: ({ ref, name, size, className, loading: loadingProp, render, style, ...rest }: IconProps & {
|
|
13
13
|
ref?: React.Ref<SVGSVGElement>;
|
|
14
14
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,13 +16,13 @@ import { Spinner } from '../spinner/Spinner.js';
|
|
|
16
16
|
import cls from './Icon.module.css';
|
|
17
17
|
import { useIconLoading } from './IconLoadingContext.js';
|
|
18
18
|
export const Icon = function Icon(_a) {
|
|
19
|
-
var { ref, name, size
|
|
19
|
+
var { ref, name, size, className, loading: loadingProp, render, style } = _a, rest = __rest(_a, ["ref", "name", "size", "className", "loading", "render", "style"]);
|
|
20
20
|
const loadingContext = useIconLoading();
|
|
21
21
|
const loading = loadingProp !== false && (loadingProp || loadingContext);
|
|
22
22
|
const slotted = useRender({
|
|
23
23
|
defaultTagName: 'svg',
|
|
24
24
|
ref,
|
|
25
|
-
props: Object.assign({ className: classNames('icon', cls.root, className),
|
|
25
|
+
props: Object.assign({ className: classNames('icon', cls.root, className), style: Object.assign(Object.assign({}, style), { '--size': size ? `${size}px` : undefined }), children: _jsx("use", { xlinkHref: `#icon-${name}` }) }, rest),
|
|
26
26
|
state: {
|
|
27
27
|
size,
|
|
28
28
|
name,
|
|
@@ -32,7 +32,7 @@ export const Icon = function Icon(_a) {
|
|
|
32
32
|
render,
|
|
33
33
|
});
|
|
34
34
|
if (loading) {
|
|
35
|
-
return (_jsx(Spinner, { size: size, "data-icon": true, className: classNames('icon', cls.spinner, className) }));
|
|
35
|
+
return (_jsx(Spinner, Object.assign({ size: size, "data-icon": true, style: Object.assign(Object.assign({}, style), { '--size': size }), className: classNames('icon', cls.spinner, className) }, rest)));
|
|
36
36
|
}
|
|
37
37
|
return slotted;
|
|
38
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA2B,MAAM,2BAA2B,CAAC;AAC/E,OAAO,UAAU,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/icon/Icon.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAA2B,MAAM,2BAA2B,CAAC;AAC/E,OAAO,UAAU,MAAM,MAAM,CAAC;AAE9B,OAA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,7 +2,7 @@ import type { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { Icon } from './Icon.js';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ ref, name, size, className, loading: loadingProp, render, ...rest }: import("./Icon.js").IconProps & {
|
|
5
|
+
component: ({ ref, name, size, className, loading: loadingProp, render, style, ...rest }: import("./Icon.js").IconProps & {
|
|
6
6
|
ref?: React.Ref<SVGSVGElement>;
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
argTypes: {
|
|
@@ -21,7 +21,7 @@ export const NavBarItem = function NavBarItem(_a) {
|
|
|
21
21
|
const mobile = useMediaQuery('(max-width: 768px)');
|
|
22
22
|
return (_jsx(Button, Object.assign({ ref: ref, className: classNames(cls.item, mobile ? `@mode-denser` : '@mode-dense', `@mode-${color}`, className), "data-active": active }, rest)));
|
|
23
23
|
};
|
|
24
|
-
export const NavBarItemIconWrapper = withClassName('div', cls.itemIconWrapper);
|
|
24
|
+
export const NavBarItemIconWrapper = withClassName('div', '@mode-dense', cls.itemIconWrapper);
|
|
25
25
|
export const NavBarItemText = withClassName('span', cls.itemText);
|
|
26
26
|
export const NavBarItemIcon = function NavBarItemIcon(_a) {
|
|
27
27
|
var { ref, className, name = 'placeholder' } = _a, rest = __rest(_a, ["ref", "className", "name"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavBar.js","sourceRoot":"","sources":["../../../src/components/navBar/NavBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAa,MAAM,kBAAkB,CAAC;AACnD,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
|
|
3
|
-
font-size: var(--m-prose-secondary-size);
|
|
4
|
-
line-height: var(--m-prose-secondary-lineHeight);
|
|
5
|
-
font-weight: var(--m-prose-secondary-weight);
|
|
6
3
|
|
|
7
4
|
&[data-emphasis='primary'] {
|
|
8
5
|
font-size: var(--m-prose-primary-size);
|
|
@@ -10,6 +7,12 @@
|
|
|
10
7
|
font-weight: var(--m-prose-primary-weight);
|
|
11
8
|
}
|
|
12
9
|
|
|
10
|
+
&[data-emphasis='secondary'] {
|
|
11
|
+
font-size: var(--m-prose-secondary-size);
|
|
12
|
+
line-height: var(--m-prose-secondary-lineHeight);
|
|
13
|
+
font-weight: var(--m-prose-secondary-weight);
|
|
14
|
+
}
|
|
15
|
+
|
|
13
16
|
&[data-emphasis='ambient'] {
|
|
14
17
|
font-size: var(--m-prose-ambient-size);
|
|
15
18
|
line-height: var(--m-prose-ambient-lineHeight);
|
package/dist/themes.stories.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ActionBar, ActionButton } from './components/actions/index.js';
|
|
|
5
5
|
import { Button } from './components/button/index.js';
|
|
6
6
|
import { Card } from './components/card/index.js';
|
|
7
7
|
import { Icon } from './components/icon/index.js';
|
|
8
|
-
import { AvatarList, Box, Checkbox, ContextMenu, DateRangePicker, Dialog, DropdownMenu, H2, H3, Heading, HorizontalList, ImageUploader, NavBarItem, NavBarItemIcon, NavBarItemIconWrapper, NavBarItemPip, NavBarItemText, NavBarRoot, Note, P, PageContent, PageNav, PageRoot, Progress, Select, Slider, TextSkeleton, ToggleGroup, Tooltip, } from './components/index.js';
|
|
8
|
+
import { AvatarList, Box, Checkbox, Chip, ContextMenu, DateRangePicker, Dialog, DropdownMenu, H2, H3, Heading, HorizontalList, ImageUploader, NavBarItem, NavBarItemIcon, NavBarItemIconWrapper, NavBarItemPip, NavBarItemText, NavBarRoot, Note, P, PageContent, PageNav, PageRoot, Progress, Select, Slider, TextSkeleton, ToggleGroup, Tooltip, } from './components/index.js';
|
|
9
9
|
import { Input } from './components/input/index.js';
|
|
10
10
|
import { Tabs } from './components/tabs/tabs.js';
|
|
11
11
|
import { TextArea } from './components/textArea/index.js';
|
|
@@ -23,7 +23,7 @@ export default meta;
|
|
|
23
23
|
export function DemoUI({ className, style, }) {
|
|
24
24
|
const nextWeek = new Date();
|
|
25
25
|
nextWeek.setDate(nextWeek.getDate() + 7);
|
|
26
|
-
return (_jsxs(PageRoot, { "data-testid": "demo", className: className, style: style, children: [_jsx(PageContent, { children: _jsxs("div", { className: cls.grid, children: [_jsxs(Box, { gap: true, wrap: true, p: true, children: [_jsx(Button, { emphasis: "primary", children: "Primary" }), _jsx(Button, { className: "@mode-accent", emphasis: "primary", children: "Accent" }), _jsx(Button, { children: "Default" }), _jsx(Button, { className: "@mode-inverted", children: "Contrast" }), _jsx(Button, { className: "@mode-attention", emphasis: "primary", children: "Destructive" }), _jsx(Button, { emphasis: "ghost", children: "Ghost" }), _jsx(Button, { className: "@mode-accent", emphasis: "ghost", children: "Ghost Accent" }), _jsx(Button, { size: "small", className: "@mode-attention", emphasis: "primary", children: "Destructive Small" }), _jsx(Button, { size: "small", className: "@mode-attention", emphasis: "ghost", children: "Ghost Destructive Small" })] }), _jsxs(Box, { gap: true, wrap: true, p: true, items: "start", children: [_jsx(Input, { placeholder: "Placeholder" }), _jsx(TextArea, { placeholder: "Placeholder" }), _jsxs(Box, { d: "row", gap: true, items: "center", children: [_jsx(Checkbox, { defaultChecked: true }), _jsx("span", { children: "Checkbox" })] }), _jsxs(ToggleGroup, { defaultValue: ['1'], children: [_jsx(ToggleGroup.Item, { value: "1", children: "Toggle 1" }), _jsx(ToggleGroup.Item, { value: "2", children: "Toggle 2" })] })] }), _jsxs(Box, { layout: "start safe-center", d: "col", gap: true, p: true, style: { maxHeight: 200 }, overflow: "auto-y", children: [_jsx(Heading, { emphasis: "primary", children: "Heading 1" }), _jsx(Heading, { emphasis: "secondary", children: "Heading 2" }), _jsx(Heading, { emphasis: "ambient", children: "Heading 3" }), _jsx(P, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." }), _jsx(TextSkeleton, { maxLength: 30 }), _jsx(TextSkeleton, { maxLength: 10 })] }), _jsxs(Box, { d: "col", gap: true, children: [_jsxs(Card, { children: [_jsxs(Card.Main, { onClick: () => { }, children: [_jsx(Card.Title, { children: "Card Title" }), _jsx(Card.Content, { children: "Card Content" })] }), _jsx(Card.Footer, { children: _jsxs(Card.Actions, { children: [_jsx(Button, { size: "small", children: "Action 1" }), _jsx(Button, { size: "small", emphasis: "ghost", children: _jsx(Icon, { name: "placeholder" }) })] }) })] }), _jsxs(Card, { children: [_jsxs(Card.Main, { compact: true, onClick: () => { }, children: [_jsx(Card.Title, { children: "Card Title" }), _jsx(Card.Content, { children: "Card Content" })] }), _jsx(Card.Footer, { children: _jsxs(Card.Actions, { children: [_jsx(Button, { size: "small", children: "Action 1" }), _jsx(Button, { size: "small", emphasis: "ghost", children: _jsx(Icon, { name: "placeholder" }) })] }) })] })] }), _jsxs(Tabs, { defaultValue: "tab1", children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Trigger, { value: "tab1", children: "Tab 1" }), _jsx(Tabs.Trigger, { value: "tab2", children: "Tab 2" })] }), _jsx(Tabs.Content, { value: "tab1", children: "Tab 1 Content" }), _jsx(Tabs.Content, { value: "tab2", children: "Tab 2 Content" })] }), _jsxs(ActionBar, { children: [_jsxs(ActionButton, { children: [_jsx(Icon, { name: "placeholder" }), "Hello"] }), _jsxs(ActionButton, { color: "primary", children: [_jsx(Icon, { name: "placeholder" }), "World"] }), _jsx(ActionButton, { children: _jsx(Icon, { name: "placeholder" }) })] }), _jsxs(AvatarList, { count: 3, children: [_jsx(AvatarList.Item, { index: 0, name: "John Doe" }), _jsx(AvatarList.Item, { index: 1, name: "Jane Doe" }), _jsx(AvatarList.Item, { index: 2, name: "John Smith" })] }), _jsxs(ContextMenu, { children: [_jsx(ContextMenu.Trigger, { render: _jsx(Tooltip, { content: "Hello World" }), children: _jsx(Button, { children: "Hover or right click" }) }), _jsxs(ContextMenu.Content, { children: [_jsx(ContextMenu.Item, { children: "Item 1" }), _jsx(ContextMenu.Item, { children: "Item 2" }), _jsx(ContextMenu.Item, { children: "Item 3" })] })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenu.Trigger, { render: _jsx(Button, {}), style: { margin: 'auto' }, children: "Dropdown" }), _jsxs(DropdownMenu.Content, { children: [_jsx(DropdownMenu.Item, { children: "Item 1" }), _jsx(DropdownMenu.Item, { children: "Item 2" }), _jsx(DropdownMenu.Item, { children: "Item 3" }), _jsx(DropdownMenu.Item, { disabled: true, children: "Disabled Item" }), _jsx(DropdownMenu.Separator, {}), _jsx(DropdownMenu.Item, { children: "Item 4" }), _jsx(DropdownMenu.Item, { children: "Item 5" }), _jsx(DropdownMenu.Item, { children: "Item 6" }), _jsxs(DropdownMenu.Item, { children: ["With icon", _jsx(DropdownMenu.ItemRightSlot, { children: _jsx(Icon, { name: "flag" }) })] })] })] }), _jsxs(Select, { value: "1", itemToStringLabel: (i) => `Item ${i}`, children: [_jsx(Select.Trigger, {}), _jsxs(Select.Content, { children: [_jsx(Select.Item, { value: "1", children: "Item 1" }), _jsx(Select.Item, { value: "2", children: "Item 2" }), _jsx(Select.Item, { value: "3", children: "Item 3" }), _jsx(Select.Item, { value: "4", children: "Item 4" }), _jsx(Select.Item, { value: "5", children: "Item 5" }), _jsx(Select.Item, { value: "6", children: "Item 6" }), _jsx(Select.Item, { value: "7", children: "Item 7" }), _jsx(Select.Item, { value: "8", children: "Item 8" }), _jsx(Select.Item, { value: "9", children: "Item 9" }), _jsx(Select.Item, { value: "10", children: "Item 10" })] })] }), _jsxs(Dialog, { children: [_jsx(Dialog.Trigger, { render: _jsx(Button, {}), children: "Click" }), _jsxs(Dialog.Content, { children: [_jsx(Dialog.Title, { children: "Hello there" }), _jsx(Dialog.Description, { children: "Im a dialog" }), _jsxs(Dialog.Actions, { children: [_jsx(Dialog.Close, { children: "Close" }), _jsx(Button, { color: "primary", children: "Action" })] })] })] }), _jsx(DateRangePicker, { style: { gridColumn: 'span 2' }, value: {
|
|
26
|
+
return (_jsxs(PageRoot, { "data-testid": "demo", className: className, style: style, children: [_jsx(PageContent, { children: _jsxs("div", { className: cls.grid, children: [_jsxs(Box, { gap: true, wrap: true, p: true, children: [_jsx(Button, { emphasis: "primary", children: "Primary" }), _jsx(Button, { className: "@mode-accent", emphasis: "primary", children: "Accent" }), _jsx(Button, { children: "Default" }), _jsx(Button, { className: "@mode-inverted", children: "Contrast" }), _jsx(Button, { className: "@mode-attention", emphasis: "primary", children: "Destructive" }), _jsx(Button, { emphasis: "ghost", children: "Ghost" }), _jsx(Button, { className: "@mode-accent", emphasis: "ghost", children: "Ghost Accent" }), _jsx(Button, { size: "small", className: "@mode-attention", emphasis: "primary", children: "Destructive Small" }), _jsx(Button, { size: "small", className: "@mode-attention", emphasis: "ghost", children: "Ghost Destructive Small" })] }), _jsxs(Box, { gap: true, wrap: true, p: true, items: "start", children: [_jsx(Input, { placeholder: "Placeholder" }), _jsx(TextArea, { placeholder: "Placeholder" }), _jsxs(Box, { d: "row", gap: true, items: "center", children: [_jsx(Checkbox, { defaultChecked: true }), _jsx("span", { children: "Checkbox" })] }), _jsxs(ToggleGroup, { defaultValue: ['1'], children: [_jsx(ToggleGroup.Item, { value: "1", children: "Toggle 1" }), _jsx(ToggleGroup.Item, { value: "2", children: "Toggle 2" })] })] }), _jsxs(Box, { layout: "start safe-center", d: "col", gap: true, p: true, style: { maxHeight: 200 }, overflow: "auto-y", children: [_jsx(Heading, { emphasis: "primary", children: "Heading 1" }), _jsx(Heading, { emphasis: "secondary", children: "Heading 2" }), _jsx(Heading, { emphasis: "ambient", children: "Heading 3" }), _jsx(P, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." }), _jsx(TextSkeleton, { maxLength: 30 }), _jsx(TextSkeleton, { maxLength: 10 })] }), _jsxs(Box, { d: "col", gap: true, children: [_jsxs(Card, { children: [_jsxs(Card.Main, { onClick: () => { }, children: [_jsx(Card.Title, { children: "Card Title" }), _jsx(Card.Content, { children: "Card Content" }), _jsx(Card.Content, { unstyled: true, children: _jsxs(Chip, { children: [_jsx(Icon, { name: "clock" }), " 2 hrs"] }) })] }), _jsx(Card.Footer, { children: _jsxs(Card.Actions, { children: [_jsx(Button, { size: "small", children: "Action 1" }), _jsx(Button, { size: "small", emphasis: "ghost", children: _jsx(Icon, { name: "placeholder" }) })] }) })] }), _jsxs(Card, { children: [_jsxs(Card.Main, { compact: true, onClick: () => { }, children: [_jsx(Card.Title, { children: "Card Title" }), _jsx(Card.Content, { children: "Card Content" }), _jsx(Card.Content, { unstyled: true, children: _jsxs(Chip, { children: [_jsx(Icon, { name: "clock" }), " 2 hrs"] }) })] }), _jsx(Card.Footer, { children: _jsxs(Card.Actions, { children: [_jsx(Button, { size: "small", children: "Action 1" }), _jsx(Button, { size: "small", emphasis: "ghost", children: _jsx(Icon, { name: "placeholder" }) })] }) })] })] }), _jsxs(Tabs, { defaultValue: "tab1", children: [_jsxs(Tabs.List, { children: [_jsx(Tabs.Trigger, { value: "tab1", children: "Tab 1" }), _jsx(Tabs.Trigger, { value: "tab2", children: "Tab 2" })] }), _jsx(Tabs.Content, { value: "tab1", children: "Tab 1 Content" }), _jsx(Tabs.Content, { value: "tab2", children: "Tab 2 Content" })] }), _jsxs(ActionBar, { children: [_jsxs(ActionButton, { children: [_jsx(Icon, { name: "placeholder" }), "Hello"] }), _jsxs(ActionButton, { color: "primary", children: [_jsx(Icon, { name: "placeholder" }), "World"] }), _jsx(ActionButton, { children: _jsx(Icon, { name: "placeholder" }) })] }), _jsxs(AvatarList, { count: 3, children: [_jsx(AvatarList.Item, { index: 0, name: "John Doe" }), _jsx(AvatarList.Item, { index: 1, name: "Jane Doe" }), _jsx(AvatarList.Item, { index: 2, name: "John Smith" })] }), _jsxs(ContextMenu, { children: [_jsx(ContextMenu.Trigger, { render: _jsx(Tooltip, { content: "Hello World" }), children: _jsx(Button, { children: "Hover or right click" }) }), _jsxs(ContextMenu.Content, { children: [_jsx(ContextMenu.Item, { children: "Item 1" }), _jsx(ContextMenu.Item, { children: "Item 2" }), _jsx(ContextMenu.Item, { children: "Item 3" })] })] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenu.Trigger, { render: _jsx(Button, {}), style: { margin: 'auto' }, children: "Dropdown" }), _jsxs(DropdownMenu.Content, { children: [_jsx(DropdownMenu.Item, { children: "Item 1" }), _jsx(DropdownMenu.Item, { children: "Item 2" }), _jsx(DropdownMenu.Item, { children: "Item 3" }), _jsx(DropdownMenu.Item, { disabled: true, children: "Disabled Item" }), _jsx(DropdownMenu.Separator, {}), _jsx(DropdownMenu.Item, { children: "Item 4" }), _jsx(DropdownMenu.Item, { children: "Item 5" }), _jsx(DropdownMenu.Item, { children: "Item 6" }), _jsxs(DropdownMenu.Item, { children: ["With icon", _jsx(DropdownMenu.ItemRightSlot, { children: _jsx(Icon, { name: "flag" }) })] })] })] }), _jsxs(Select, { value: "1", itemToStringLabel: (i) => `Item ${i}`, children: [_jsx(Select.Trigger, {}), _jsxs(Select.Content, { children: [_jsx(Select.Item, { value: "1", children: "Item 1" }), _jsx(Select.Item, { value: "2", children: "Item 2" }), _jsx(Select.Item, { value: "3", children: "Item 3" }), _jsx(Select.Item, { value: "4", children: "Item 4" }), _jsx(Select.Item, { value: "5", children: "Item 5" }), _jsx(Select.Item, { value: "6", children: "Item 6" }), _jsx(Select.Item, { value: "7", children: "Item 7" }), _jsx(Select.Item, { value: "8", children: "Item 8" }), _jsx(Select.Item, { value: "9", children: "Item 9" }), _jsx(Select.Item, { value: "10", children: "Item 10" })] })] }), _jsxs(Dialog, { children: [_jsx(Dialog.Trigger, { render: _jsx(Button, {}), children: "Click" }), _jsxs(Dialog.Content, { children: [_jsx(Dialog.Title, { children: "Hello there" }), _jsx(Dialog.Description, { children: "Im a dialog" }), _jsxs(Dialog.Actions, { children: [_jsx(Dialog.Close, { children: "Close" }), _jsx(Button, { color: "primary", children: "Action" })] })] })] }), _jsx(DateRangePicker, { style: { gridColumn: 'span 2' }, value: {
|
|
27
27
|
start: new Date(),
|
|
28
28
|
end: nextWeek,
|
|
29
29
|
}, onChange: () => { } }), _jsx(Progress, { value: 50, style: { margin: 'auto' } }), _jsx(Slider, { defaultValue: 50, min: 0, max: 100 }), _jsxs(Box, { surface: "primary", p: true, gap: true, d: "col", children: [_jsx(Heading, { emphasis: "primary", children: "Primary surface" }), _jsx(Heading, { emphasis: "secondary", children: "Primary surface" }), _jsx(Heading, { emphasis: "ambient", children: "Primary surface" }), _jsx("div", { children: "Primary surface" }), _jsx(Button, { emphasis: "ghost", children: "Ghost" })] }), _jsxs(Box, { surface: "primary", color: "accent", p: true, d: "col", style: { maxHeight: 200 }, overflow: "auto-y", children: [_jsx(Heading, { emphasis: "primary", children: "Accent surface" }), _jsx(P, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." }), _jsx(P, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." }), _jsx(P, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." }), _jsx(TextSkeleton, { maxLength: 30 }), _jsx(TextSkeleton, { maxLength: 10 }), "Accent surface"] }), _jsx(Box, { surface: "secondary", p: true, d: "col", children: "Secondary surface" }), _jsx(Box, { surface: "ambient", p: true, d: "col", children: "Ambient surface" }), _jsxs(Box, { surface: true, color: "attention", p: true, d: "col", children: [_jsx(H2, { children: "Attention surface" }), _jsx(H3, { children: "Attention surface" }), "Attention surface", _jsx(Button, { emphasis: "ghost", children: "Ghost" })] }), _jsx(Box, { children: _jsx(Note, { children: "Note note" }) }), _jsx(Box, { justify: "start", items: "start", children: _jsxs(HorizontalList, { openDirection: "down", children: [_jsx(Button, { size: "small", children: "One" }), _jsx(Button, { size: "small", children: "Two" }), _jsx(Button, { size: "small", children: "Three" }), _jsx(Button, { size: "small", children: "Four" }), _jsx(Button, { size: "small", children: "Five" }), _jsx(Button, { size: "small", children: "Six" }), _jsx(Button, { size: "small", children: "Seven" }), _jsx(Button, { size: "small", children: "Eight" }), _jsx(Button, { size: "small", children: "Nine" }), _jsx(Button, { size: "small", children: "Ten" }), _jsx(Button, { size: "small", children: "Eleven" })] }) }), _jsx(ImageUploader, { style: { height: 200 }, value: null, onChange: () => { } })] }) }), _jsx(PageNav, { children: _jsxs(NavBarRoot, { children: [_jsxs(NavBarItem, { children: [_jsx(NavBarItemIconWrapper, { children: _jsx(NavBarItemIcon, { name: "cart" }) }), _jsx(NavBarItemText, { children: "Item 1 long" })] }), _jsxs(NavBarItem, { active: true, children: [_jsx(NavBarItemIconWrapper, { children: _jsx(NavBarItemIcon, { name: "book" }) }), _jsx(NavBarItemText, { children: "Item 2" }), _jsx(NavBarItemPip, {})] }), _jsxs(NavBarItem, { color: "neutral", children: [_jsx(NavBarItemIconWrapper, { children: _jsx(NavBarItemIcon, { render: _jsx(Icon, { name: "book" }) }) }), _jsx(NavBarItemText, { children: "Neutral" })] }), _jsxs(NavBarItem, { color: "neutral", active: true, children: [_jsx(NavBarItemIconWrapper, { children: _jsx(NavBarItemIcon, { render: _jsx(Icon, { name: "book" }) }) }), _jsx(NavBarItemText, { children: "Neutral" }), _jsx(NavBarItemPip, {})] })] }) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.stories.js","sourceRoot":"","sources":["../src/themes.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MA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AAM;QACL,OAAO,CACN,MAAC,GAAG,IAAC,CAAC,EAAC,KAAK,EAAC,CAAC,QAAC,GAAG,mBACjB,KAAC,GAAG,IAAC,CAAC,EAAC,KAAK,EAAC,GAAG,QAAC,OAAO,EAAC,SAAS,YACjC,KAAC,MAAM,IAAC,KAAK,EAAC,SAAS,2BAAoB,GACtC,EACN,KAAC,MAAM,IAAC,SAAS,EAAC,8BAA8B,EAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAI,IAClE,CACN,CAAC;IACH,CAAC;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAU;IAC5B,MAAM;QACL,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC;YAClC,CAAC,aAAa,CAAC,EAAE,EAAE;YACnB,CAAC,oBAAoB,CAAC,EAAE,GAAG;SAC3B,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,GAAG,EAAE;YACnB,QAAQ,CAAC;gBACR,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;gBAChD,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE;aACrC,CAAC,CAAC;QACJ,CAAC,CAAC;QACF,OAAO,CACN,MAAC,GAAG,IAAC,CAAC,EAAC,KAAK,EAAC,IAAI,QAAC,GAAG,QAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,KAAY,aACxD,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,uBAAiB,EACxC,KAAC,MAAM,IAAC,SAAS,EAAC,YAAY,GAAG,IAC5B,CACN,CAAC;IACH,CAAC;CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useRender, UseRenderComponentProps } from '@base-ui/react/use-render';
|
|
2
2
|
import classNames from 'clsx';
|
|
3
|
+
import { CSSProperties } from 'react';
|
|
3
4
|
import { Spinner } from '../spinner/Spinner.js';
|
|
4
5
|
import { IconName } from './generated/iconNames.js';
|
|
5
6
|
import cls from './Icon.module.css';
|
|
@@ -8,7 +9,7 @@ import { useIconLoading } from './IconLoadingContext.js';
|
|
|
8
9
|
export interface IconProps
|
|
9
10
|
extends UseRenderComponentProps<
|
|
10
11
|
'svg',
|
|
11
|
-
{ size
|
|
12
|
+
{ size?: number; name: IconName; loading: boolean }
|
|
12
13
|
> {
|
|
13
14
|
name: IconName;
|
|
14
15
|
size?: number;
|
|
@@ -18,10 +19,11 @@ export interface IconProps
|
|
|
18
19
|
export const Icon = function Icon({
|
|
19
20
|
ref,
|
|
20
21
|
name,
|
|
21
|
-
size
|
|
22
|
+
size,
|
|
22
23
|
className,
|
|
23
24
|
loading: loadingProp,
|
|
24
25
|
render,
|
|
26
|
+
style,
|
|
25
27
|
...rest
|
|
26
28
|
}: IconProps & {
|
|
27
29
|
ref?: React.Ref<SVGSVGElement>;
|
|
@@ -34,8 +36,10 @@ export const Icon = function Icon({
|
|
|
34
36
|
ref,
|
|
35
37
|
props: {
|
|
36
38
|
className: classNames('icon', cls.root, className),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
style: {
|
|
40
|
+
...style,
|
|
41
|
+
'--size': size ? `${size}px` : undefined,
|
|
42
|
+
},
|
|
39
43
|
children: <use xlinkHref={`#icon-${name}`} />,
|
|
40
44
|
...rest,
|
|
41
45
|
},
|
|
@@ -53,7 +57,14 @@ export const Icon = function Icon({
|
|
|
53
57
|
<Spinner
|
|
54
58
|
size={size}
|
|
55
59
|
data-icon
|
|
60
|
+
style={
|
|
61
|
+
{
|
|
62
|
+
...style,
|
|
63
|
+
'--size': size,
|
|
64
|
+
} as CSSProperties
|
|
65
|
+
}
|
|
56
66
|
className={classNames('icon', cls.spinner, className)}
|
|
67
|
+
{...(rest as any)}
|
|
57
68
|
/>
|
|
58
69
|
);
|
|
59
70
|
}
|
|
@@ -40,7 +40,11 @@ export const NavBarItem = function NavBarItem({
|
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export const NavBarItemIconWrapper = withClassName(
|
|
43
|
+
export const NavBarItemIconWrapper = withClassName(
|
|
44
|
+
'div',
|
|
45
|
+
'@mode-dense',
|
|
46
|
+
cls.itemIconWrapper,
|
|
47
|
+
);
|
|
44
48
|
|
|
45
49
|
export const NavBarItemText = withClassName('span', cls.itemText);
|
|
46
50
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
.typography {
|
|
2
2
|
@apply --mx-fg(inherit);
|
|
3
|
-
font-size: var(--m-prose-secondary-size);
|
|
4
|
-
line-height: var(--m-prose-secondary-lineHeight);
|
|
5
|
-
font-weight: var(--m-prose-secondary-weight);
|
|
6
3
|
|
|
7
4
|
&[data-emphasis='primary'] {
|
|
8
5
|
font-size: var(--m-prose-primary-size);
|
|
@@ -10,6 +7,12 @@
|
|
|
10
7
|
font-weight: var(--m-prose-primary-weight);
|
|
11
8
|
}
|
|
12
9
|
|
|
10
|
+
&[data-emphasis='secondary'] {
|
|
11
|
+
font-size: var(--m-prose-secondary-size);
|
|
12
|
+
line-height: var(--m-prose-secondary-lineHeight);
|
|
13
|
+
font-weight: var(--m-prose-secondary-weight);
|
|
14
|
+
}
|
|
15
|
+
|
|
13
16
|
&[data-emphasis='ambient'] {
|
|
14
17
|
font-size: var(--m-prose-ambient-size);
|
|
15
18
|
line-height: var(--m-prose-ambient-lineHeight);
|
package/src/themes.stories.tsx
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
AvatarList,
|
|
10
10
|
Box,
|
|
11
11
|
Checkbox,
|
|
12
|
+
Chip,
|
|
12
13
|
ContextMenu,
|
|
13
14
|
DateRangePicker,
|
|
14
15
|
Dialog,
|
|
@@ -125,6 +126,11 @@ export function DemoUI({
|
|
|
125
126
|
<Card.Main onClick={() => {}}>
|
|
126
127
|
<Card.Title>Card Title</Card.Title>
|
|
127
128
|
<Card.Content>Card Content</Card.Content>
|
|
129
|
+
<Card.Content unstyled>
|
|
130
|
+
<Chip>
|
|
131
|
+
<Icon name="clock" /> 2 hrs
|
|
132
|
+
</Chip>
|
|
133
|
+
</Card.Content>
|
|
128
134
|
</Card.Main>
|
|
129
135
|
<Card.Footer>
|
|
130
136
|
<Card.Actions>
|
|
@@ -139,6 +145,11 @@ export function DemoUI({
|
|
|
139
145
|
<Card.Main compact onClick={() => {}}>
|
|
140
146
|
<Card.Title>Card Title</Card.Title>
|
|
141
147
|
<Card.Content>Card Content</Card.Content>
|
|
148
|
+
<Card.Content unstyled>
|
|
149
|
+
<Chip>
|
|
150
|
+
<Icon name="clock" /> 2 hrs
|
|
151
|
+
</Chip>
|
|
152
|
+
</Card.Content>
|
|
142
153
|
</Card.Main>
|
|
143
154
|
<Card.Footer>
|
|
144
155
|
<Card.Actions>
|