@a-type/ui 1.3.4 → 1.3.6
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/cjs/components/avatar/AvatarList.d.ts +5 -1
- package/dist/cjs/components/avatar/AvatarList.js +8 -3
- package/dist/cjs/components/avatar/AvatarList.js.map +1 -1
- package/dist/cjs/components/icon/generated/IconSpritesheet.js +1 -1
- package/dist/cjs/components/icon/generated/IconSpritesheet.js.map +1 -1
- package/dist/cjs/components/icon/generated/iconNames.d.ts +1 -1
- package/dist/cjs/components/icon/generated/iconNames.js +6 -0
- package/dist/cjs/components/icon/generated/iconNames.js.map +1 -1
- package/dist/cjs/components/layouts/PageContent.js +1 -1
- package/dist/cjs/components/layouts/PageContent.js.map +1 -1
- package/dist/cjs/components/layouts/PageNav.js +1 -1
- package/dist/cjs/components/layouts/PageNav.js.map +1 -1
- package/dist/cjs/components/layouts/PageRoot.js +1 -1
- package/dist/cjs/components/layouts/PageRoot.js.map +1 -1
- package/dist/cjs/components/layouts/layouts.stories.js +2 -1
- package/dist/cjs/components/layouts/layouts.stories.js.map +1 -1
- package/dist/css/main.css +1 -1
- package/dist/esm/components/avatar/AvatarList.d.ts +5 -1
- package/dist/esm/components/avatar/AvatarList.js +6 -2
- package/dist/esm/components/avatar/AvatarList.js.map +1 -1
- package/dist/esm/components/icon/generated/IconSpritesheet.js +1 -1
- package/dist/esm/components/icon/generated/IconSpritesheet.js.map +1 -1
- package/dist/esm/components/icon/generated/iconNames.d.ts +1 -1
- package/dist/esm/components/icon/generated/iconNames.js +6 -0
- package/dist/esm/components/icon/generated/iconNames.js.map +1 -1
- package/dist/esm/components/layouts/PageContent.js +1 -1
- package/dist/esm/components/layouts/PageContent.js.map +1 -1
- package/dist/esm/components/layouts/PageNav.js +1 -1
- package/dist/esm/components/layouts/PageNav.js.map +1 -1
- package/dist/esm/components/layouts/PageRoot.js +1 -1
- package/dist/esm/components/layouts/PageRoot.js.map +1 -1
- package/dist/esm/components/layouts/layouts.stories.js +2 -1
- package/dist/esm/components/layouts/layouts.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/AvatarList.tsx +7 -2
- package/src/components/icon/generated/IconSpritesheet.tsx +72 -0
- package/src/components/icon/generated/iconNames.ts +6 -0
- package/src/components/layouts/PageContent.tsx +0 -1
- package/src/components/layouts/PageNav.tsx +2 -1
- package/src/components/layouts/PageRoot.tsx +1 -1
- package/src/components/layouts/layouts.stories.tsx +8 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { Button } from '../button/index.js';
|
|
5
|
+
import { Card } from '../card/Card.js';
|
|
5
6
|
import { Icon } from '../icon/index.js';
|
|
6
7
|
import { Input } from '../input/index.js';
|
|
7
8
|
import { NavBarItem, NavBarItemIcon, NavBarItemIconWrapper, NavBarItemPip, NavBarItemText, NavBarRoot, } from '../navBar/index.js';
|
|
@@ -19,7 +20,7 @@ const meta = {
|
|
|
19
20
|
};
|
|
20
21
|
export default meta;
|
|
21
22
|
export const Default = {
|
|
22
|
-
render: () => (_jsxs(PageRoot, { className: "w-full h-full", children: [_jsxs(PageContent, { children: [_jsxs("div", { className: "text-center", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Hello, World!" }), _jsx("p", { className: "text-lg", children: "This is a simple page layout." })] }), _jsx(PageNowPlaying, { children: "Now playing" })] }), _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, { asChild: true, children: _jsx(Icon, { name: "book" }) }) }), _jsx(NavBarItemText, { children: "Item 2" }), _jsx(NavBarItemPip, {})] })] }) })] })),
|
|
23
|
+
render: () => (_jsxs(PageRoot, { className: "w-full h-full", children: [_jsxs(PageContent, { children: [_jsxs("div", { className: "text-center", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Hello, World!" }), _jsx("p", { className: "text-lg", children: "This is a simple page layout." }), _jsx(Card.Grid, { children: new Array(100).fill(null).map((_, i) => (_jsx(Card, { children: _jsx(Card.Main, {}) }, i))) })] }), _jsx(PageNowPlaying, { children: "Now playing" })] }), _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, { asChild: true, children: _jsx(Icon, { name: "book" }) }) }), _jsx(NavBarItemText, { children: "Item 2" }), _jsx(NavBarItemPip, {})] })] }) })] })),
|
|
23
24
|
};
|
|
24
25
|
export const WithoutNav = {
|
|
25
26
|
render: () => (_jsx(PageRoot, { className: "w-full h-full", children: _jsxs(PageContent, { children: [_jsxs("div", { className: "text-center", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Hello, World!" }), _jsx("p", { className: "text-lg", children: "This is a simple page layout." })] }), _jsx(PageNowPlaying, { children: "Now playing" })] }) })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.stories.js","sourceRoot":"","sources":["../../../../src/components/layouts/layouts.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EACN,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,aAA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cAAc,IAAC,IAAI,EAAC,MAAM,GAAG,GACP,EACxB,KAAC,cAAc,8BAA6B,IAChC,EACb,MAAC,UAAU,IAAC,MAAM,EAAE,IAAI,aACvB,KAAC,qBAAqB,cACrB,KAAC,cAAc,IAAC,OAAO,kBACtB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACJ,GACM,EACxB,KAAC,cAAc,yBAAwB,EACvC,KAAC,aAAa,KAAG,IACL,IACD,GACJ,EACV,cAAK,SAAS,EAAC,2GAA2G,GAAG,IACnH,CACX,CAAC;IACH,CAAC;CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ReactNode, createContext, useContext } from 'react';
|
|
2
1
|
import classNames from 'clsx';
|
|
2
|
+
import { ReactNode, createContext, useContext } from 'react';
|
|
3
3
|
import { Avatar, AvatarProps } from './Avatar.js';
|
|
4
4
|
|
|
5
5
|
const AvatarListContext = createContext<{ size: number }>({
|
|
6
6
|
size: 24,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
export function
|
|
9
|
+
export function AvatarListRoot({
|
|
10
10
|
children,
|
|
11
11
|
count,
|
|
12
12
|
size = 24,
|
|
@@ -69,3 +69,8 @@ export function AvatarListItem({
|
|
|
69
69
|
</AvatarListItemRoot>
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
export const AvatarList = Object.assign(AvatarListRoot, {
|
|
74
|
+
Item: AvatarListItem,
|
|
75
|
+
ItemRoot: AvatarListItemRoot,
|
|
76
|
+
});
|
|
@@ -865,6 +865,78 @@ export const IconSpritesheet = (props: any) => (
|
|
|
865
865
|
stroke="currentColor"
|
|
866
866
|
/>
|
|
867
867
|
</symbol>
|
|
868
|
+
<symbol id="icon-next" viewBox="0 0 15 15">
|
|
869
|
+
<path
|
|
870
|
+
d="M11 7.5L4 1V14L11 7.5Z"
|
|
871
|
+
stroke="currentColor"
|
|
872
|
+
strokeLinecap="round"
|
|
873
|
+
strokeLinejoin="round"
|
|
874
|
+
/>
|
|
875
|
+
</symbol>
|
|
876
|
+
<symbol id="icon-playPause" viewBox="0 0 15 15">
|
|
877
|
+
<path
|
|
878
|
+
d="M14.5 8L5 1V14L14.5 8Z"
|
|
879
|
+
stroke="currentColor"
|
|
880
|
+
strokeLinecap="round"
|
|
881
|
+
strokeLinejoin="round"
|
|
882
|
+
/>
|
|
883
|
+
<path
|
|
884
|
+
d="M2 1V14"
|
|
885
|
+
stroke="currentColor"
|
|
886
|
+
strokeLinecap="round"
|
|
887
|
+
strokeLinejoin="round"
|
|
888
|
+
/>
|
|
889
|
+
</symbol>
|
|
890
|
+
<symbol id="icon-pause" viewBox="0 0 15 15">
|
|
891
|
+
<path
|
|
892
|
+
d="M2 14H6V1H2V14Z"
|
|
893
|
+
stroke="currentColor"
|
|
894
|
+
strokeLinecap="round"
|
|
895
|
+
strokeLinejoin="round"
|
|
896
|
+
/>
|
|
897
|
+
<path
|
|
898
|
+
d="M9 14H13V1H9V14Z"
|
|
899
|
+
stroke="currentColor"
|
|
900
|
+
strokeLinecap="round"
|
|
901
|
+
strokeLinejoin="round"
|
|
902
|
+
/>
|
|
903
|
+
</symbol>
|
|
904
|
+
<symbol id="icon-previous" viewBox="0 0 15 15">
|
|
905
|
+
<path
|
|
906
|
+
d="M4 7.5L11 14L11 1L4 7.5Z"
|
|
907
|
+
stroke="currentColor"
|
|
908
|
+
strokeLinecap="round"
|
|
909
|
+
strokeLinejoin="round"
|
|
910
|
+
/>
|
|
911
|
+
</symbol>
|
|
912
|
+
<symbol id="icon-skipStart" viewBox="0 0 15 15">
|
|
913
|
+
<path
|
|
914
|
+
d="M4 7.5L11 14L11 1L4 7.5Z"
|
|
915
|
+
stroke="currentColor"
|
|
916
|
+
strokeLinecap="round"
|
|
917
|
+
strokeLinejoin="round"
|
|
918
|
+
/>
|
|
919
|
+
<path
|
|
920
|
+
d="M3 1V14"
|
|
921
|
+
stroke="currentColor"
|
|
922
|
+
strokeLinecap="round"
|
|
923
|
+
strokeLinejoin="round"
|
|
924
|
+
/>
|
|
925
|
+
</symbol>
|
|
926
|
+
<symbol id="icon-skipEnd" viewBox="0 0 15 15">
|
|
927
|
+
<path
|
|
928
|
+
d="M11 7.5L4 1L4 14L11 7.5Z"
|
|
929
|
+
stroke="currentColor"
|
|
930
|
+
strokeLinecap="round"
|
|
931
|
+
strokeLinejoin="round"
|
|
932
|
+
/>
|
|
933
|
+
<path
|
|
934
|
+
d="M12 14L12 1"
|
|
935
|
+
stroke="currentColor"
|
|
936
|
+
strokeLinecap="round"
|
|
937
|
+
strokeLinejoin="round"
|
|
938
|
+
/>
|
|
939
|
+
</symbol>
|
|
868
940
|
</defs>
|
|
869
941
|
</svg>
|
|
870
942
|
);
|
|
@@ -29,7 +29,6 @@ export function PageContent({
|
|
|
29
29
|
<div
|
|
30
30
|
className={classNames(
|
|
31
31
|
'layer-components:([grid-area:content] max-w-full min-w-0 w-full flex flex-col items-start relative flex-1 gap-3)',
|
|
32
|
-
'layer-components:(rounded-b-lg border-b border-b-solid border-b-[#00000070] bg-wash [box-shadow:0_0_10px_0_var(--color-shadow-1)] sm:border-none sm:rounded-0 sm:shadow-none)',
|
|
33
32
|
{ 'layer-variants:(overflow-y-auto h-full)': scrollable },
|
|
34
33
|
className,
|
|
35
34
|
)}
|
|
@@ -24,7 +24,8 @@ export function PageNav({
|
|
|
24
24
|
{...props}
|
|
25
25
|
className={classNames(
|
|
26
26
|
'layer-components:([grid-area:nav] relative z-nav pb-[calc(0.25rem+env(safe-area-inset-bottom,0px))])',
|
|
27
|
-
'layer-components:
|
|
27
|
+
'layer-components:before:(content-[""] absolute inset-x-4 top-0 h-px bg-[#00000070])',
|
|
28
|
+
'layer-components:sm:([grid-area:nav] sticky top-0 h-auto bottom-auto left-auto right-auto) layer-components:sm:before:(hidden)',
|
|
28
29
|
className,
|
|
29
30
|
)}
|
|
30
31
|
ref={ref}
|
|
@@ -2,7 +2,7 @@ import { withClassName } from '../../hooks.js';
|
|
|
2
2
|
|
|
3
3
|
export const PageRoot = withClassName(
|
|
4
4
|
'div',
|
|
5
|
-
'layer-components:(flex-grow-1 flex-shrink-1 flex-basis-0 min-h-0 h-full bg-
|
|
5
|
+
'layer-components:(flex-grow-1 flex-shrink-1 flex-basis-0 min-h-0 h-full bg-wash)',
|
|
6
6
|
'layer-components:(grid grid-areas-[content]-[nav] grid-cols-[1fr] grid-rows-[1fr] items-start justify-center)',
|
|
7
7
|
'sm:layer-responsive:(grid-areas-[gutter1_nav_content_gutter2] grid-cols-[1fr_auto_min(800px,60vw)_1fr] min-h-auto bg-wash)',
|
|
8
8
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { Button } from '../button/index.js';
|
|
4
|
+
import { Card } from '../card/Card.js';
|
|
4
5
|
import { Icon } from '../icon/index.js';
|
|
5
6
|
import { Input } from '../input/index.js';
|
|
6
7
|
import {
|
|
@@ -36,6 +37,13 @@ export const Default: Story = {
|
|
|
36
37
|
<div className="text-center">
|
|
37
38
|
<h1 className="text-3xl font-bold">Hello, World!</h1>
|
|
38
39
|
<p className="text-lg">This is a simple page layout.</p>
|
|
40
|
+
<Card.Grid>
|
|
41
|
+
{new Array(100).fill(null).map((_, i) => (
|
|
42
|
+
<Card key={i}>
|
|
43
|
+
<Card.Main />
|
|
44
|
+
</Card>
|
|
45
|
+
))}
|
|
46
|
+
</Card.Grid>
|
|
39
47
|
</div>
|
|
40
48
|
<PageNowPlaying>Now playing</PageNowPlaying>
|
|
41
49
|
</PageContent>
|