@keeper-security/keeper-js-ui 0.0.2 → 0.1.1
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 +22 -0
- package/dist/index.es.d.ts +39 -4
- package/dist/index.es.js +612 -370
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +51 -34
- package/.commitlintrc.cjs +0 -3
- package/.czrc +0 -3
- package/.eslintrc.cjs +0 -19
- package/.github/workflows/npm-publish.yml +0 -18
- package/.github/workflows/release-please.yml +0 -19
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -1
- package/.lintstagedrc.cjs +0 -4
- package/.nvmrc +0 -1
- package/.prettierrc +0 -4
- package/.storybook/main.ts +0 -23
- package/.storybook/preview.ts +0 -33
- package/.storybook/withDirection.tsx +0 -22
- package/components.json +0 -17
- package/postcss.config.js +0 -6
- package/src/components/ui/button.stories.tsx +0 -25
- package/src/components/ui/button.tsx +0 -56
- package/src/index.css +0 -81
- package/src/index.ts +0 -3
- package/src/lib/utils.ts +0 -6
- package/tailwind.config.js +0 -111
- package/tsconfig.app.json +0 -33
- package/tsconfig.json +0 -17
- package/tsconfig.node.json +0 -13
- package/vite.config.ts +0 -44
package/README.md
CHANGED
|
@@ -153,6 +153,16 @@ export const DisabledSecondary: Story = {
|
|
|
153
153
|
|
|
154
154
|
[Storybook](https://storybook.js.org/) is not limited to simply running and testing components in isolation. Complex scenarios can be created with the [render](https://storybook.js.org/docs/api/csf#custom-render-functions) and [play](https://storybook.js.org/docs/api/csf#play-function) functions.
|
|
155
155
|
|
|
156
|
+
### Prototyping in Storybook
|
|
157
|
+
|
|
158
|
+
Using [Tailwind CSS](https://tailwindcss.com/) classes within a component or a story will automatically get picked up by the Tailwind CSS compiler and write that CSS rule to a file/memory.
|
|
159
|
+
|
|
160
|
+
For a real-time experience where all of Tailwind CSS is available to your storybook preview and its interactive controls, enable `VITE_STORYBOOK_PROTOTYPING` in your `.env.local` file.
|
|
161
|
+
|
|
162
|
+
This will allow you to use any standard Tailwind CSS classes within the `className` control textfield, but it will slow Storybook rendering saved changes to your stories and components. At this time, arbitrary values (using `[]` notation, such as `w-[1234px]`) will not work, but you will have access to a `style` object.
|
|
163
|
+
|
|
164
|
+
> Note: If you don't already have a `.env.local` file, copy the contents of the `.env` file in the root and update the values as necessary. Never commit your changes to the `.env` file unless you are adding or removing a default key/value pair. Changes to your `.env.local` are ignored by git and will not get picked up as unstaged changes.
|
|
165
|
+
|
|
156
166
|
### Changing Themes in Storybook
|
|
157
167
|
|
|
158
168
|
[Storybook's Themes Addon](https://storybook.js.org/addons/@storybook/addon-themes) has been configured to pick between the `light` or `dark` theme based on your system settings. You can use the Theme button in the Storybook toolbar to switch themes manually should you need to test a component in another theme.
|
|
@@ -184,6 +194,18 @@ There are four themes to choose from:
|
|
|
184
194
|
4. Select `Emulate CSS forced-colors: active`.
|
|
185
195
|
5. To deactivate, repeat the `Run` command but select `Do not emulate CSS forced-colors`.
|
|
186
196
|
|
|
197
|
+
## Testing
|
|
198
|
+
|
|
199
|
+
The [Storybook test runner](https://storybook.js.org/docs/writing-tests/test-runner) will run smoke tests and unit tests with the command: `npm test`.
|
|
200
|
+
|
|
201
|
+
### Smoke Tests
|
|
202
|
+
|
|
203
|
+
Also known as confidence testing or sanity testing, smoke testing is the practice of testing the most important functionality of a system or feature. In this case, we use them to also check if any code changes have broken components in obvious ways. This automated process would be the equivalent of manually clicking on each story and verifying that it loaded without errors.
|
|
204
|
+
|
|
205
|
+
There is no additional code you need to write after creating a new story. Stories will get picked up automatically and tested whenever `npm test` is ran.
|
|
206
|
+
|
|
207
|
+
When you push a change up to Github, an [action will run](https://github.com/Keeper-Security/keeper-js-ui/actions/workflows/storybook-tests.yml) these tests and give you feedback to the outcome.
|
|
208
|
+
|
|
187
209
|
## Committing Changes
|
|
188
210
|
|
|
189
211
|
If you're familiar with [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary), feel free to commit using `git commit`.
|
package/dist/index.es.d.ts
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
|
-
import { ClassProp } from 'class-variance-authority/types';
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/dist/types';
|
|
2
2
|
import * as React_2 from 'react';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
export declare const Button: React_2.ForwardRefExoticComponent<ButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
|
|
7
|
-
declare interface ButtonProps extends React_2.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
7
|
+
declare interface ButtonProps extends Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
|
9
|
+
endContent?: React_2.ReactNode;
|
|
10
|
+
startContent?: React_2.ReactNode;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
declare const buttonVariants: (props?: ({
|
|
12
|
-
variant?: "
|
|
13
|
-
|
|
14
|
+
variant?: "solid" | "plain" | null | undefined;
|
|
15
|
+
color?: "neutral" | "primary" | null | undefined;
|
|
16
|
+
fullWidth?: boolean | null | undefined;
|
|
17
|
+
} & ClassProp) | undefined) => string;
|
|
18
|
+
|
|
19
|
+
export declare const Flex: React_2.ForwardRefExoticComponent<FlexProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
declare interface FlexProps extends React_2.HTMLAttributes<HTMLDivElement>, VariantProps<typeof flexVariants> {
|
|
22
|
+
as?: 'div' | 'span';
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const flexVariants: (props?: ({
|
|
27
|
+
wrap?: "wrap" | "nowrap" | "reverse" | null | undefined;
|
|
28
|
+
p?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
29
|
+
pb?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
30
|
+
pe?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
31
|
+
ps?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
32
|
+
pt?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
33
|
+
px?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
34
|
+
py?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
35
|
+
m?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
36
|
+
mb?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
37
|
+
me?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
38
|
+
ms?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
39
|
+
mt?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
40
|
+
mx?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
41
|
+
my?: "px" | "0" | "1" | "2" | "3" | "4" | "auto" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
42
|
+
justify?: "end" | "start" | "around" | "baseline" | "between" | "center" | "normal" | "stretch" | null | undefined;
|
|
43
|
+
gap?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
44
|
+
gapColumn?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
45
|
+
gapRow?: "px" | "0" | "1" | "2" | "3" | "4" | "0.5" | "1.5" | "2.5" | "3.5" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | "96" | null | undefined;
|
|
46
|
+
align?: "end" | "start" | "baseline" | "center" | "stretch" | null | undefined;
|
|
47
|
+
direction?: "row" | "column-reverse" | "row-reverse" | "column" | null | undefined;
|
|
48
|
+
display?: "flex" | "none" | "inline-flex" | null | undefined;
|
|
14
49
|
} & ClassProp) | undefined) => string;
|
|
15
50
|
|
|
16
51
|
export { }
|