@pondipondi/mimas 0.1.1 → 0.1.3
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/README.md +1 -30
- package/dist/components/crumbs/Button/Button.d.ts +538 -0
- package/dist/components/crumbs/Button/Button.stories.d.ts +43 -0
- package/dist/components/crumbs/LoadingRing/LoadingRing.d.ts +39 -0
- package/dist/components/crumbs/LoadingRing/LoadingRing.stories.d.ts +22 -0
- package/dist/components/crumbs/ToggleSet/ToggleSet.d.ts +2 -0
- package/dist/components/{index.ts → index.d.ts} +4 -5
- package/dist/components/util/Noise/Noise.d.ts +2 -0
- package/dist/{index.ts → index.d.ts} +1 -1
- package/dist/mimas.cjs.js +30 -0
- package/dist/mimas.es.js +3306 -0
- package/package.json +12 -17
- package/dist/components/crumbs/Button/Button.stories.ts +0 -56
- package/dist/components/crumbs/Button/Button.tsx +0 -160
- package/dist/components/crumbs/LoadingRing/LoadingRing.stories.ts +0 -33
- package/dist/components/crumbs/LoadingRing/LoadingRing.tsx +0 -33
- package/dist/components/crumbs/ToggleSet/ToggleSet.tsx +0 -12
- package/dist/components/util/Noise/Noise.tsx +0 -19
- package/dist/index.css +0 -55
- package/dist/vite-env.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pondipondi/mimas",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
7
|
-
"build": "
|
|
7
|
+
"build": "vite build && tsc",
|
|
8
8
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
9
9
|
"preview": "vite preview",
|
|
10
10
|
"storybook": "storybook dev -p 6006",
|
|
11
11
|
"build-storybook": "storybook build",
|
|
12
|
-
"
|
|
13
|
-
"prepublishOnly": "npm run transpile"
|
|
12
|
+
"prepublishOnly": "npm run build"
|
|
14
13
|
},
|
|
15
14
|
"dependencies": {
|
|
16
15
|
"autoprefixer": "^10.4.19",
|
|
@@ -25,10 +24,6 @@
|
|
|
25
24
|
"react-dom": ">=18.3.1"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@babel/cli": "^7.27.2",
|
|
29
|
-
"@babel/core": "^7.27.4",
|
|
30
|
-
"@babel/preset-env": "^7.27.2",
|
|
31
|
-
"@babel/preset-react": "^7.27.1",
|
|
32
27
|
"@chromatic-com/storybook": "1.6.1",
|
|
33
28
|
"@storybook/addon-essentials": "^8.2.2",
|
|
34
29
|
"@storybook/addon-interactions": "^8.2.2",
|
|
@@ -49,23 +44,23 @@
|
|
|
49
44
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
50
45
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
51
46
|
"eslint-plugin-storybook": "^0.8.0",
|
|
52
|
-
"rimraf": "^6.0.1",
|
|
53
47
|
"storybook": "^8.2.1",
|
|
54
48
|
"storybook-dark-mode": "^4.0.2",
|
|
55
49
|
"typescript": "^5.2.2",
|
|
56
|
-
"vite": "^5.4.19"
|
|
57
|
-
"vite-plugin-dts": "^4.5.4"
|
|
58
|
-
},
|
|
59
|
-
"description": "This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.",
|
|
60
|
-
"main": "dist/index.js",
|
|
61
|
-
"repository": {
|
|
62
|
-
"type": "git",
|
|
63
|
-
"url": "git+https://github.com/bevans-o/mimas.git"
|
|
50
|
+
"vite": "^5.4.19"
|
|
64
51
|
},
|
|
52
|
+
"description": "Mimas components.",
|
|
53
|
+
"main": "dist/mimas.cjs.js",
|
|
54
|
+
"module": "dist/mimas.es.js",
|
|
55
|
+
"types": "dist/index.d.ts",
|
|
65
56
|
"files": [
|
|
66
57
|
"dist",
|
|
67
58
|
"README.md"
|
|
68
59
|
],
|
|
60
|
+
"repository": {
|
|
61
|
+
"type": "git",
|
|
62
|
+
"url": "git+https://github.com/bevans-o/mimas.git"
|
|
63
|
+
},
|
|
69
64
|
"keywords": [
|
|
70
65
|
"react",
|
|
71
66
|
"components"
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { fn } from "@storybook/test";
|
|
3
|
-
import Button from "./Button";
|
|
4
|
-
|
|
5
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Mimas/Crumbs/Button",
|
|
8
|
-
component: Button,
|
|
9
|
-
parameters: {
|
|
10
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
11
|
-
layout: "centered",
|
|
12
|
-
},
|
|
13
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
|
-
tags: ["autodocs"],
|
|
15
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
16
|
-
argTypes: {
|
|
17
|
-
size: {
|
|
18
|
-
control: "radio",
|
|
19
|
-
options: ["large", "small"],
|
|
20
|
-
},
|
|
21
|
-
width: {
|
|
22
|
-
control: "radio",
|
|
23
|
-
options: ["fit", "grow"],
|
|
24
|
-
},
|
|
25
|
-
colour: {
|
|
26
|
-
control: "select",
|
|
27
|
-
options: ["red", "blue", "green", "white", "neutral"],
|
|
28
|
-
},
|
|
29
|
-
corners: {
|
|
30
|
-
control: "select",
|
|
31
|
-
options: ["sharp", "round", "circle"],
|
|
32
|
-
},
|
|
33
|
-
leftCorners: {
|
|
34
|
-
control: "select",
|
|
35
|
-
options: ["none", "sharp", "round", "circle"],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
39
|
-
args: {
|
|
40
|
-
onClick: fn(),
|
|
41
|
-
size: "large",
|
|
42
|
-
noise: "medium",
|
|
43
|
-
colour: "neutral",
|
|
44
|
-
text: "Button",
|
|
45
|
-
width: "fit",
|
|
46
|
-
corners: "round",
|
|
47
|
-
},
|
|
48
|
-
} satisfies Meta<typeof Button>;
|
|
49
|
-
|
|
50
|
-
export default meta;
|
|
51
|
-
type Story = StoryObj<typeof meta>;
|
|
52
|
-
|
|
53
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
54
|
-
export const Primary: Story = {
|
|
55
|
-
args: {},
|
|
56
|
-
};
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import LoadingRing from "../LoadingRing/LoadingRing";
|
|
2
|
-
import Noise from "../../util/Noise/Noise";
|
|
3
|
-
import { tv, VariantProps } from "tailwind-variants";
|
|
4
|
-
|
|
5
|
-
const button = tv({
|
|
6
|
-
slots: {
|
|
7
|
-
outer: "group p-[2px] bg-neutral-200 dark:bg-neutral-900",
|
|
8
|
-
inner: "relative shadow-form border overflow-hidden animate-press",
|
|
9
|
-
chip: "pb-[2px]",
|
|
10
|
-
},
|
|
11
|
-
variants: {
|
|
12
|
-
corners: {
|
|
13
|
-
sharp: {
|
|
14
|
-
inner: "rounded-sm",
|
|
15
|
-
outer: "rounded-sm",
|
|
16
|
-
chip: "rounded-sm",
|
|
17
|
-
},
|
|
18
|
-
round: {
|
|
19
|
-
inner: "rounded-md",
|
|
20
|
-
outer: "rounded-lg",
|
|
21
|
-
chip: "rounded-md",
|
|
22
|
-
},
|
|
23
|
-
circle: {
|
|
24
|
-
inner: "rounded-full",
|
|
25
|
-
outer: "rounded-full",
|
|
26
|
-
chip: "rounded-full",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
leftCorners: {
|
|
30
|
-
none: {},
|
|
31
|
-
sharp: {
|
|
32
|
-
inner: "rounded-s-sm",
|
|
33
|
-
outer: "rounded-s-sm",
|
|
34
|
-
chip: "rounded-s-sm",
|
|
35
|
-
},
|
|
36
|
-
round: {
|
|
37
|
-
inner: "rounded-s-md",
|
|
38
|
-
outer: "rounded-s-lg",
|
|
39
|
-
chip: "rounded-s-md",
|
|
40
|
-
},
|
|
41
|
-
circle: {
|
|
42
|
-
inner: "rounded-s-full",
|
|
43
|
-
outer: "rounded-s-full",
|
|
44
|
-
chip: "rounded-s-full",
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
size: {
|
|
48
|
-
small: {
|
|
49
|
-
inner: "py-[2px] px-2 text-xs min-h-5",
|
|
50
|
-
},
|
|
51
|
-
large: {
|
|
52
|
-
inner: "py-1 px-3 min-h-8",
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
colour: {
|
|
56
|
-
neutral: {
|
|
57
|
-
inner:
|
|
58
|
-
"bg-neutral-800 border-neutral-700/70 group-disabled:border-neutral-700/40 group-active:border-neutral-700/40 text-neutral-200",
|
|
59
|
-
chip: "bg-neutral-800",
|
|
60
|
-
},
|
|
61
|
-
red: {
|
|
62
|
-
inner:
|
|
63
|
-
"bg-red-700 border-red-500/60 group-disabled:border-red-600/40 group-active:border-red-600/40 text-neutral-200",
|
|
64
|
-
chip: "bg-red-900",
|
|
65
|
-
},
|
|
66
|
-
green: {
|
|
67
|
-
inner:
|
|
68
|
-
"bg-lime-700 border-lime-600/70 group-disabled:border-lime-600/40 group-active:border-lime-600/40 text-neutral-200",
|
|
69
|
-
chip: "bg-lime-900",
|
|
70
|
-
},
|
|
71
|
-
blue: {
|
|
72
|
-
inner:
|
|
73
|
-
"bg-sky-700 border-sky-600/70 group-disabled:border-sky-600/40 group-active:border-sky-600/40 text-neutral-200",
|
|
74
|
-
chip: "bg-sky-900",
|
|
75
|
-
},
|
|
76
|
-
white: {
|
|
77
|
-
inner:
|
|
78
|
-
"bg-neutral-300 border-neutral-300/70 group-disabled:border-neutral-300/40 group-active:border-neutral-300/40 text-neutral-800",
|
|
79
|
-
chip: "bg-neutral-400",
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
width: {
|
|
83
|
-
fit: {},
|
|
84
|
-
grow: {
|
|
85
|
-
inner: "w-full",
|
|
86
|
-
outer: "w-full",
|
|
87
|
-
chip: "w-full",
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
defaultVariants: {
|
|
92
|
-
size: "large",
|
|
93
|
-
colour: "neutral",
|
|
94
|
-
corners: "round",
|
|
95
|
-
leftCorners: "none",
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
interface ButtonProps
|
|
100
|
-
extends VariantProps<typeof button>,
|
|
101
|
-
React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
102
|
-
loading?: boolean;
|
|
103
|
-
text?: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function Button({
|
|
107
|
-
size,
|
|
108
|
-
colour,
|
|
109
|
-
width,
|
|
110
|
-
corners,
|
|
111
|
-
leftCorners,
|
|
112
|
-
loading,
|
|
113
|
-
text,
|
|
114
|
-
children,
|
|
115
|
-
className,
|
|
116
|
-
disabled,
|
|
117
|
-
onClick,
|
|
118
|
-
...props
|
|
119
|
-
}: ButtonProps) {
|
|
120
|
-
const { outer, chip, inner } = button({
|
|
121
|
-
size,
|
|
122
|
-
colour,
|
|
123
|
-
width,
|
|
124
|
-
corners,
|
|
125
|
-
leftCorners,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
// TODO handle keyboard
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<button
|
|
132
|
-
className={outer()}
|
|
133
|
-
disabled={disabled || loading}
|
|
134
|
-
onClick={onClick}
|
|
135
|
-
{...props}
|
|
136
|
-
>
|
|
137
|
-
<div className={chip()}>
|
|
138
|
-
<div className={inner({ className })}>
|
|
139
|
-
<span
|
|
140
|
-
className="relative block z-10 text-inherit group-disabled:opacity-50"
|
|
141
|
-
style={{ visibility: loading ? "hidden" : "visible" }}
|
|
142
|
-
>
|
|
143
|
-
{children}
|
|
144
|
-
{text}
|
|
145
|
-
</span>
|
|
146
|
-
|
|
147
|
-
{loading && (
|
|
148
|
-
<div className="absolute inset-0 w-full h-full flex justify-center items-center">
|
|
149
|
-
<LoadingRing size={size} />
|
|
150
|
-
</div>
|
|
151
|
-
)}
|
|
152
|
-
|
|
153
|
-
<Noise />
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</button>
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export default Button;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import LoadingRing from "./LoadingRing";
|
|
3
|
-
|
|
4
|
-
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Mimas/Crumbs/LoadingRing",
|
|
7
|
-
component: LoadingRing,
|
|
8
|
-
parameters: {
|
|
9
|
-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: "centered",
|
|
11
|
-
},
|
|
12
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
13
|
-
tags: ["autodocs"],
|
|
14
|
-
// More on argTypes: https://storybook.js.org/docs/api/argtypes
|
|
15
|
-
argTypes: {
|
|
16
|
-
size: {
|
|
17
|
-
control: "radio",
|
|
18
|
-
options: ["large", "small"],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
|
|
22
|
-
args: {
|
|
23
|
-
size: "large",
|
|
24
|
-
},
|
|
25
|
-
} satisfies Meta<typeof LoadingRing>;
|
|
26
|
-
|
|
27
|
-
export default meta;
|
|
28
|
-
type Story = StoryObj<typeof meta>;
|
|
29
|
-
|
|
30
|
-
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
31
|
-
export const Primary: Story = {
|
|
32
|
-
args: {},
|
|
33
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { tv, VariantProps } from "tailwind-variants";
|
|
2
|
-
|
|
3
|
-
const loadingRing = tv({
|
|
4
|
-
base: "animate-spin",
|
|
5
|
-
variants: {
|
|
6
|
-
size: {
|
|
7
|
-
small: "w-5 h-5",
|
|
8
|
-
large: "w-8 h-8",
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
function LoadingRing({ size }: VariantProps<typeof loadingRing>) {
|
|
14
|
-
return (
|
|
15
|
-
<div className={loadingRing({ size })}>
|
|
16
|
-
<svg viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
-
<circle
|
|
18
|
-
cx="400"
|
|
19
|
-
cy="400"
|
|
20
|
-
fill="none"
|
|
21
|
-
r="200"
|
|
22
|
-
stroke-width="50"
|
|
23
|
-
stroke-dasharray="269 150"
|
|
24
|
-
stroke="currentColor"
|
|
25
|
-
opacity={0.5}
|
|
26
|
-
stroke-linecap="round"
|
|
27
|
-
/>
|
|
28
|
-
</svg>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default LoadingRing;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function Noise() {
|
|
2
|
-
return (
|
|
3
|
-
<>
|
|
4
|
-
<svg
|
|
5
|
-
className="pointer-events-none absolute inset-0 isolate z-10 h-full w-full opacity-25"
|
|
6
|
-
height="100%"
|
|
7
|
-
id="texture"
|
|
8
|
-
>
|
|
9
|
-
<filter id="noise">
|
|
10
|
-
<feTurbulence type="fractalNoise" baseFrequency="0.75" numOctaves="4" stitchTiles="stitch"></feTurbulence>
|
|
11
|
-
<feColorMatrix type="saturate" values="0"></feColorMatrix>
|
|
12
|
-
</filter>
|
|
13
|
-
<rect width="100%" height="100%" filter="url(#noise)"></rect>
|
|
14
|
-
</svg>
|
|
15
|
-
</>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default Noise;
|
package/dist/index.css
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss/base";
|
|
2
|
-
@import "tailwindcss/components";
|
|
3
|
-
@import "tailwindcss/utilities";
|
|
4
|
-
|
|
5
|
-
@import url("https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap");
|
|
6
|
-
|
|
7
|
-
:root {
|
|
8
|
-
font-family: "Rubik", sans-serif;
|
|
9
|
-
color: white;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.shadow-form {
|
|
13
|
-
box-shadow:
|
|
14
|
-
inset 0 1px 8px 2px rgba(255, 255, 255, 0.03),
|
|
15
|
-
inset 0 -6px 5px -3px rgba(0, 0, 0, 0.08);
|
|
16
|
-
|
|
17
|
-
transition:
|
|
18
|
-
background-color 200ms ease,
|
|
19
|
-
box-shadow 200ms ease;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.group:hover .shadow-form,
|
|
23
|
-
.shadow-form:hover {
|
|
24
|
-
box-shadow:
|
|
25
|
-
inset 0 1px 5px 3px rgba(255, 255, 255, 0.03),
|
|
26
|
-
inset 0 -7px 5px -3px rgba(0, 0, 0, 0.1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.group:active .shadow-form,
|
|
30
|
-
.shadow-form:active {
|
|
31
|
-
box-shadow:
|
|
32
|
-
inset 0 2px 6px 6px rgba(0, 0, 0, 0.12),
|
|
33
|
-
inset 0 -7px 5px -3px rgba(0, 0, 0, 0);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.group:disabled .shadow-form,
|
|
37
|
-
.shadow-form:disabled,
|
|
38
|
-
.shadow-form:disabled:hover {
|
|
39
|
-
box-shadow:
|
|
40
|
-
inset 0 2px 6px 6px rgba(0, 0, 0, 0.12),
|
|
41
|
-
inset 0 -7px 5px -3px rgba(0, 0, 0, 0);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.animate-press {
|
|
45
|
-
transition: all 100ms ease;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.group:hover .animate-press {
|
|
49
|
-
translate: 0 -1px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.group:disabled .animate-press,
|
|
53
|
-
.group:active .animate-press {
|
|
54
|
-
translate: 0 1px;
|
|
55
|
-
}
|
package/dist/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|