@fuf-stack/pixels 0.0.5 → 0.0.8

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.
Files changed (64) hide show
  1. package/dist/Button/Button.cjs +3 -3
  2. package/dist/Button/Button.cjs.map +1 -1
  3. package/dist/Button/Button.js +2 -2
  4. package/dist/Button/index.cjs +5 -5
  5. package/dist/Button/index.cjs.map +1 -1
  6. package/dist/Button/index.js +3 -3
  7. package/dist/Button/index.js.map +1 -1
  8. package/dist/Button/subcomponents/LoadingSpinner.cjs +1 -1
  9. package/dist/Button/subcomponents/LoadingSpinner.cjs.map +1 -1
  10. package/dist/Button/subcomponents/LoadingSpinner.js +1 -1
  11. package/dist/Card/Card.cjs +1 -1
  12. package/dist/Card/Card.cjs.map +1 -1
  13. package/dist/Card/Card.d.cts +3 -3
  14. package/dist/Card/Card.d.ts +3 -3
  15. package/dist/Card/Card.js +1 -1
  16. package/dist/Card/index.cjs +3 -3
  17. package/dist/Card/index.cjs.map +1 -1
  18. package/dist/Card/index.d.cts +1 -1
  19. package/dist/Card/index.d.ts +1 -1
  20. package/dist/Card/index.js +2 -2
  21. package/dist/Card/index.js.map +1 -1
  22. package/dist/{chunk-XWTXH2TR.js → chunk-XPTSDDXG.js} +2 -2
  23. package/dist/chunk-XPTSDDXG.js.map +1 -0
  24. package/dist/{chunk-YOPQSZ46.js → chunk-ZFEVTQWW.js} +2 -2
  25. package/dist/chunk-ZFEVTQWW.js.map +1 -0
  26. package/dist/{chunk-WQN756O7.js → chunk-ZXTDGCUF.js} +3 -3
  27. package/dist/chunk-ZXTDGCUF.js.map +1 -0
  28. package/dist/hooks/useDebounce.cjs +43 -0
  29. package/dist/hooks/useDebounce.cjs.map +1 -0
  30. package/dist/hooks/useDebounce.d.cts +3 -0
  31. package/dist/hooks/useDebounce.d.ts +3 -0
  32. package/dist/hooks/useDebounce.js +22 -0
  33. package/dist/hooks/useDebounce.js.map +1 -0
  34. package/dist/hooks/useLocalStorage.cjs +73 -0
  35. package/dist/hooks/useLocalStorage.cjs.map +1 -0
  36. package/dist/hooks/useLocalStorage.d.cts +5 -0
  37. package/dist/hooks/useLocalStorage.d.ts +5 -0
  38. package/dist/hooks/useLocalStorage.js +52 -0
  39. package/dist/hooks/useLocalStorage.js.map +1 -0
  40. package/package.json +6 -5
  41. package/.eslintrc +0 -16
  42. package/.storybook/main.ts +0 -8
  43. package/.storybook/preview-head.html +0 -3
  44. package/.storybook/preview.tsx +0 -7
  45. package/CHANGELOG.md +0 -36
  46. package/Globals.d.ts +0 -3
  47. package/dist/chunk-WQN756O7.js.map +0 -1
  48. package/dist/chunk-XWTXH2TR.js.map +0 -1
  49. package/dist/chunk-YOPQSZ46.js.map +0 -1
  50. package/src/components/Button/Button.stories.tsx +0 -75
  51. package/src/components/Button/Button.test.tsx +0 -9
  52. package/src/components/Button/Button.tsx +0 -74
  53. package/src/components/Button/__snapshots__/Button.test.tsx.snap +0 -235
  54. package/src/components/Button/index.ts +0 -7
  55. package/src/components/Button/subcomponents/LoadingSpinner.tsx +0 -26
  56. package/src/components/Card/Card.stories.tsx +0 -56
  57. package/src/components/Card/Card.test.tsx +0 -9
  58. package/src/components/Card/Card.tsx +0 -120
  59. package/src/components/Card/__snapshots__/Card.test.tsx.snap +0 -94
  60. package/src/components/Card/index.ts +0 -3
  61. package/tailwind.config.js +0 -7
  62. package/tsconfig.json +0 -7
  63. package/tsup.config.ts +0 -15
  64. package/vitest.config.ts +0 -9
@@ -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
- };
@@ -1,9 +0,0 @@
1
- import { describe } from 'vitest';
2
-
3
- import storySnapshots from 'storybook-config/story-snapshots';
4
-
5
- import * as stories from './Card.stories';
6
-
7
- describe('Story Snapshots', () => {
8
- storySnapshots(stories);
9
- });
@@ -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
- `;
@@ -1,3 +0,0 @@
1
- import Card from './Card';
2
-
3
- export default Card;
@@ -1,7 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
-
3
- const sharedConfig = require('tailwind-config/tailwind.config');
4
-
5
- module.exports = {
6
- presets: [sharedConfig],
7
- };
package/tsconfig.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "lib": ["DOM", "DOM.Iterable", "ESNext"]
5
- },
6
- "include": ["src", "globals.d.ts"]
7
- }
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
@@ -1,9 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
-
3
- import { defineProject } from 'vitest/config';
4
-
5
- export default defineProject({
6
- test: {
7
- environment: 'jsdom',
8
- },
9
- });