@fuf-stack/pixels 0.0.4 → 0.0.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/{chunk-ZXTDGCUF.js → chunk-WQN756O7.js} +3 -3
- package/dist/chunk-WQN756O7.js.map +1 -0
- package/dist/{chunk-XPTSDDXG.js → chunk-XWTXH2TR.js} +2 -2
- package/dist/chunk-XWTXH2TR.js.map +1 -0
- package/dist/{chunk-ZFEVTQWW.js → chunk-YOPQSZ46.js} +2 -2
- package/dist/chunk-YOPQSZ46.js.map +1 -0
- package/dist/{Button → components/Button}/Button.cjs +3 -3
- package/dist/components/Button/Button.cjs.map +1 -0
- package/dist/components/Button/Button.js +8 -0
- package/dist/{Button → components/Button}/index.cjs +5 -5
- package/dist/components/Button/index.cjs.map +1 -0
- package/dist/components/Button/index.js +11 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/{Button → components/Button}/subcomponents/LoadingSpinner.cjs +1 -1
- package/dist/components/Button/subcomponents/LoadingSpinner.cjs.map +1 -0
- package/dist/{Button → components/Button}/subcomponents/LoadingSpinner.js +1 -1
- package/dist/{Card → components/Card}/Card.cjs +1 -1
- package/dist/components/Card/Card.cjs.map +1 -0
- package/dist/{Card → components/Card}/Card.js +1 -1
- package/dist/{Card → components/Card}/index.cjs +3 -3
- package/dist/components/Card/index.cjs.map +1 -0
- package/dist/components/Card/index.js +10 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/hooks/useDebounce.cjs +43 -0
- package/dist/hooks/useDebounce.cjs.map +1 -0
- package/dist/hooks/useDebounce.d.cts +3 -0
- package/dist/hooks/useDebounce.d.ts +3 -0
- package/dist/hooks/useDebounce.js +22 -0
- package/dist/hooks/useDebounce.js.map +1 -0
- package/dist/hooks/useLocalStorage.cjs +73 -0
- package/dist/hooks/useLocalStorage.cjs.map +1 -0
- package/dist/hooks/useLocalStorage.d.cts +5 -0
- package/dist/hooks/useLocalStorage.d.ts +5 -0
- package/dist/hooks/useLocalStorage.js +52 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/package.json +6 -2
- package/.eslintrc +0 -16
- package/.storybook/main.ts +0 -8
- package/.storybook/preview-head.html +0 -3
- package/.storybook/preview.tsx +0 -7
- package/CHANGELOG.md +0 -29
- package/Globals.d.ts +0 -3
- package/dist/Button/Button.cjs.map +0 -1
- package/dist/Button/Button.js +0 -8
- package/dist/Button/index.cjs.map +0 -1
- package/dist/Button/index.js +0 -11
- package/dist/Button/index.js.map +0 -1
- package/dist/Button/subcomponents/LoadingSpinner.cjs.map +0 -1
- package/dist/Card/Card.cjs.map +0 -1
- package/dist/Card/index.cjs.map +0 -1
- package/dist/Card/index.js +0 -10
- package/dist/Card/index.js.map +0 -1
- package/dist/chunk-XPTSDDXG.js.map +0 -1
- package/dist/chunk-ZFEVTQWW.js.map +0 -1
- package/dist/chunk-ZXTDGCUF.js.map +0 -1
- package/src/Button/Button.stories.tsx +0 -75
- package/src/Button/Button.test.tsx +0 -9
- package/src/Button/Button.tsx +0 -74
- package/src/Button/__snapshots__/Button.test.tsx.snap +0 -235
- package/src/Button/index.ts +0 -7
- package/src/Button/subcomponents/LoadingSpinner.tsx +0 -26
- package/src/Card/Card.stories.tsx +0 -56
- package/src/Card/Card.test.tsx +0 -9
- package/src/Card/Card.tsx +0 -120
- package/src/Card/__snapshots__/Card.test.tsx.snap +0 -94
- package/src/Card/index.ts +0 -3
- package/tailwind.config.js +0 -7
- package/tsconfig.json +0 -7
- package/tsup.config.ts +0 -15
- package/vitest.config.ts +0 -9
- /package/dist/{Button → components/Button}/Button.d.cts +0 -0
- /package/dist/{Button → components/Button}/Button.d.ts +0 -0
- /package/dist/{Button → components/Button}/Button.js.map +0 -0
- /package/dist/{Button → components/Button}/index.d.cts +0 -0
- /package/dist/{Button → components/Button}/index.d.ts +0 -0
- /package/dist/{Button → components/Button}/subcomponents/LoadingSpinner.d.cts +0 -0
- /package/dist/{Button → components/Button}/subcomponents/LoadingSpinner.d.ts +0 -0
- /package/dist/{Button → components/Button}/subcomponents/LoadingSpinner.js.map +0 -0
- /package/dist/{Card → components/Card}/Card.d.cts +0 -0
- /package/dist/{Card → components/Card}/Card.d.ts +0 -0
- /package/dist/{Card → components/Card}/Card.js.map +0 -0
- /package/dist/{Card → components/Card}/index.d.cts +0 -0
- /package/dist/{Card → components/Card}/index.d.ts +0 -0
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import Card from './Card';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof Card> = {
|
|
6
|
-
title: 'pixels/Card',
|
|
7
|
-
component: Card,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default meta;
|
|
11
|
-
type Story = StoryObj<typeof Card>;
|
|
12
|
-
|
|
13
|
-
export const Default: Story = {
|
|
14
|
-
args: {
|
|
15
|
-
children: (
|
|
16
|
-
<p className="w-96">
|
|
17
|
-
Lorem commodo nulla adipisicing cillum Lorem sunt laboris exercitation
|
|
18
|
-
esse. Exercitation ut cillum cupidatat deserunt occaecat pariatur
|
|
19
|
-
laborum ut reprehenderit veniam. Culpa fugiat aliqua consectetur sit
|
|
20
|
-
esse.
|
|
21
|
-
</p>
|
|
22
|
-
),
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const FooterAndHeader: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
footer: 'Footer',
|
|
29
|
-
header: 'Header',
|
|
30
|
-
children: (
|
|
31
|
-
<p className="w-96">
|
|
32
|
-
Lorem commodo nulla adipisicing cillum Lorem sunt laboris exercitation
|
|
33
|
-
esse. Exercitation ut cillum cupidatat deserunt occaecat pariatur
|
|
34
|
-
laborum ut reprehenderit veniam. Culpa fugiat aliqua consectetur sit
|
|
35
|
-
esse.
|
|
36
|
-
</p>
|
|
37
|
-
),
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const CustomSlotStyles: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
footer: 'Footer',
|
|
44
|
-
header: 'Header',
|
|
45
|
-
children: (
|
|
46
|
-
<p className="w-96">
|
|
47
|
-
Lorem commodo nulla adipisicing cillum Lorem sunt laboris exercitatio
|
|
48
|
-
</p>
|
|
49
|
-
),
|
|
50
|
-
className: {
|
|
51
|
-
base: 'text-blue-400',
|
|
52
|
-
body: 'text-green-400',
|
|
53
|
-
divider: 'bg-yellow-400',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
};
|
package/src/Card/Card.test.tsx
DELETED
package/src/Card/Card.tsx
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { VariantProps } from 'tailwind-variants';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Card as NextCard,
|
|
6
|
-
CardBody as NextCardBody,
|
|
7
|
-
CardFooter as NextCardFooter,
|
|
8
|
-
CardHeader as NextCardHeader,
|
|
9
|
-
} from '@nextui-org/card';
|
|
10
|
-
import { Divider as NextDivider } from '@nextui-org/divider';
|
|
11
|
-
import createDebug from 'debug';
|
|
12
|
-
import { tv } from 'tailwind-variants';
|
|
13
|
-
|
|
14
|
-
const debug = createDebug('component:Card');
|
|
15
|
-
|
|
16
|
-
// card styling variants
|
|
17
|
-
export const cardVariants = tv({
|
|
18
|
-
slots: {
|
|
19
|
-
base: 'border border-slate-300',
|
|
20
|
-
body: '',
|
|
21
|
-
divider: 'my-0 bg-slate-300',
|
|
22
|
-
footer: '',
|
|
23
|
-
header: 'text-base font-semibold',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
type CardVariantProps = VariantProps<typeof cardVariants>;
|
|
28
|
-
type CardVariantSlots = Partial<
|
|
29
|
-
Record<keyof ReturnType<typeof cardVariants>, string>
|
|
30
|
-
>;
|
|
31
|
-
|
|
32
|
-
export interface CardProps extends CardVariantProps {
|
|
33
|
-
/** child components */
|
|
34
|
-
children?: ReactNode;
|
|
35
|
-
/** CSS class name */
|
|
36
|
-
className?: string | CardVariantSlots;
|
|
37
|
-
/** footer content */
|
|
38
|
-
footer?: ReactNode;
|
|
39
|
-
/** header content */
|
|
40
|
-
header?: ReactNode;
|
|
41
|
-
/** HTML data-testid attribute used in e2e tests */
|
|
42
|
-
testId?: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Card component based on [NextUI Card](https://nextui.org/docs/components/card)
|
|
47
|
-
*/
|
|
48
|
-
const Card = ({
|
|
49
|
-
children = null,
|
|
50
|
-
className = undefined,
|
|
51
|
-
testId = undefined,
|
|
52
|
-
header = undefined,
|
|
53
|
-
footer = undefined,
|
|
54
|
-
}: CardProps) => {
|
|
55
|
-
debug('Card', { className, testId });
|
|
56
|
-
const {
|
|
57
|
-
base: baseSlot,
|
|
58
|
-
body: bodySlot,
|
|
59
|
-
divider: dividerSlot,
|
|
60
|
-
footer: footerSlot,
|
|
61
|
-
header: headerSlot,
|
|
62
|
-
} = cardVariants();
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<NextCard
|
|
66
|
-
data-testid={testId && `card_${testId}`}
|
|
67
|
-
className={baseSlot({
|
|
68
|
-
className: typeof className === 'object' ? className.base : className,
|
|
69
|
-
})}
|
|
70
|
-
fullWidth
|
|
71
|
-
radius="sm"
|
|
72
|
-
shadow="none"
|
|
73
|
-
>
|
|
74
|
-
{header && (
|
|
75
|
-
<>
|
|
76
|
-
<NextCardHeader
|
|
77
|
-
data-testid={testId && `card_header_${testId}`}
|
|
78
|
-
className={headerSlot({
|
|
79
|
-
className: typeof className === 'object' && className.header,
|
|
80
|
-
})}
|
|
81
|
-
>
|
|
82
|
-
{header}
|
|
83
|
-
</NextCardHeader>
|
|
84
|
-
<NextDivider
|
|
85
|
-
className={dividerSlot({
|
|
86
|
-
className: typeof className === 'object' && className.divider,
|
|
87
|
-
})}
|
|
88
|
-
/>
|
|
89
|
-
</>
|
|
90
|
-
)}
|
|
91
|
-
<NextCardBody
|
|
92
|
-
data-testid={testId && `card_body_${testId}`}
|
|
93
|
-
className={bodySlot({
|
|
94
|
-
className: typeof className === 'object' && className.body,
|
|
95
|
-
})}
|
|
96
|
-
>
|
|
97
|
-
{children}
|
|
98
|
-
</NextCardBody>
|
|
99
|
-
{footer && (
|
|
100
|
-
<>
|
|
101
|
-
<NextDivider
|
|
102
|
-
className={dividerSlot({
|
|
103
|
-
className: typeof className === 'object' && className.divider,
|
|
104
|
-
})}
|
|
105
|
-
/>
|
|
106
|
-
<NextCardFooter
|
|
107
|
-
data-testid={testId && `card_footer_${testId}`}
|
|
108
|
-
className={footerSlot({
|
|
109
|
-
className: typeof className === 'object' && className.footer,
|
|
110
|
-
})}
|
|
111
|
-
>
|
|
112
|
-
{footer}
|
|
113
|
-
</NextCardFooter>
|
|
114
|
-
</>
|
|
115
|
-
)}
|
|
116
|
-
</NextCard>
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export default Card;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
-
|
|
3
|
-
exports[`Story Snapshots > CustomSlotStyles 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="flex flex-col relative overflow-hidden height-auto box-border bg-content1 outline-none data-[focus-visible=true]:z-10 data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-focus data-[focus-visible=true]:outline-offset-2 shadow-none rounded-small w-full transition-transform-background motion-reduce:transition-none border border-slate-300 text-blue-400"
|
|
7
|
-
tabindex="-1"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
class="flex p-3 z-10 w-full justify-start items-center shrink-0 overflow-inherit color-inherit subpixel-antialiased rounded-t-small text-base font-semibold"
|
|
11
|
-
>
|
|
12
|
-
Header
|
|
13
|
-
</div>
|
|
14
|
-
<hr
|
|
15
|
-
class="shrink-0 border-none w-full h-divider my-0 bg-yellow-400"
|
|
16
|
-
role="separator"
|
|
17
|
-
/>
|
|
18
|
-
<div
|
|
19
|
-
class="relative flex w-full p-3 flex-auto flex-col place-content-inherit align-items-inherit h-auto break-words text-left overflow-y-auto subpixel-antialiased text-green-400"
|
|
20
|
-
>
|
|
21
|
-
<p
|
|
22
|
-
class="w-96"
|
|
23
|
-
>
|
|
24
|
-
Lorem commodo nulla adipisicing cillum Lorem sunt laboris exercitatio
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
<hr
|
|
28
|
-
class="shrink-0 border-none w-full h-divider my-0 bg-yellow-400"
|
|
29
|
-
role="separator"
|
|
30
|
-
/>
|
|
31
|
-
<div
|
|
32
|
-
class="p-3 h-auto flex w-full items-center overflow-hidden color-inherit subpixel-antialiased rounded-b-small"
|
|
33
|
-
>
|
|
34
|
-
Footer
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
exports[`Story Snapshots > Default 1`] = `
|
|
41
|
-
<div>
|
|
42
|
-
<div
|
|
43
|
-
class="flex flex-col relative overflow-hidden height-auto text-foreground box-border bg-content1 outline-none data-[focus-visible=true]:z-10 data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-focus data-[focus-visible=true]:outline-offset-2 shadow-none rounded-small w-full transition-transform-background motion-reduce:transition-none border border-slate-300"
|
|
44
|
-
tabindex="-1"
|
|
45
|
-
>
|
|
46
|
-
<div
|
|
47
|
-
class="relative flex w-full p-3 flex-auto flex-col place-content-inherit align-items-inherit h-auto break-words text-left overflow-y-auto subpixel-antialiased"
|
|
48
|
-
>
|
|
49
|
-
<p
|
|
50
|
-
class="w-96"
|
|
51
|
-
>
|
|
52
|
-
Lorem commodo nulla adipisicing cillum Lorem sunt laboris exercitation esse. Exercitation ut cillum cupidatat deserunt occaecat pariatur laborum ut reprehenderit veniam. Culpa fugiat aliqua consectetur sit esse.
|
|
53
|
-
</p>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
exports[`Story Snapshots > FooterAndHeader 1`] = `
|
|
60
|
-
<div>
|
|
61
|
-
<div
|
|
62
|
-
class="flex flex-col relative overflow-hidden height-auto text-foreground box-border bg-content1 outline-none data-[focus-visible=true]:z-10 data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-focus data-[focus-visible=true]:outline-offset-2 shadow-none rounded-small w-full transition-transform-background motion-reduce:transition-none border border-slate-300"
|
|
63
|
-
tabindex="-1"
|
|
64
|
-
>
|
|
65
|
-
<div
|
|
66
|
-
class="flex p-3 z-10 w-full justify-start items-center shrink-0 overflow-inherit color-inherit subpixel-antialiased rounded-t-small text-base font-semibold"
|
|
67
|
-
>
|
|
68
|
-
Header
|
|
69
|
-
</div>
|
|
70
|
-
<hr
|
|
71
|
-
class="shrink-0 border-none w-full h-divider my-0 bg-slate-300"
|
|
72
|
-
role="separator"
|
|
73
|
-
/>
|
|
74
|
-
<div
|
|
75
|
-
class="relative flex w-full p-3 flex-auto flex-col place-content-inherit align-items-inherit h-auto break-words text-left overflow-y-auto subpixel-antialiased"
|
|
76
|
-
>
|
|
77
|
-
<p
|
|
78
|
-
class="w-96"
|
|
79
|
-
>
|
|
80
|
-
Lorem commodo nulla adipisicing cillum Lorem sunt laboris exercitation esse. Exercitation ut cillum cupidatat deserunt occaecat pariatur laborum ut reprehenderit veniam. Culpa fugiat aliqua consectetur sit esse.
|
|
81
|
-
</p>
|
|
82
|
-
</div>
|
|
83
|
-
<hr
|
|
84
|
-
class="shrink-0 border-none w-full h-divider my-0 bg-slate-300"
|
|
85
|
-
role="separator"
|
|
86
|
-
/>
|
|
87
|
-
<div
|
|
88
|
-
class="p-3 h-auto flex w-full items-center overflow-hidden color-inherit subpixel-antialiased rounded-b-small"
|
|
89
|
-
>
|
|
90
|
-
Footer
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
`;
|
package/src/Card/index.ts
DELETED
package/tailwind.config.js
DELETED
package/tsconfig.json
DELETED
package/tsup.config.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
import { defineConfig } from 'tsup';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
clean: true,
|
|
6
|
-
dts: true,
|
|
7
|
-
entry: [
|
|
8
|
-
'src',
|
|
9
|
-
'!src/**/__snapshots__/**',
|
|
10
|
-
'!src/**/*.stories.*',
|
|
11
|
-
'!src/**/*.test.*',
|
|
12
|
-
],
|
|
13
|
-
format: ['cjs', 'esm'],
|
|
14
|
-
sourcemap: true,
|
|
15
|
-
});
|
package/vitest.config.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|