@keeper-security/keeper-js-ui 0.0.1 → 0.1.0

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.
@@ -1,18 +0,0 @@
1
- name: Publish to NPM
2
- on:
3
- workflow_dispatch:
4
-
5
- jobs:
6
- publish-npm:
7
- runs-on: ubuntu-latest
8
- steps:
9
- - uses: actions/checkout@v4
10
- - uses: actions/setup-node@v4
11
- with:
12
- node-version-file: .nvmrc
13
- registry-url: https://registry.npmjs.org/
14
- - run: npm ci
15
- - run: npm run build
16
- - run: npm publish
17
- env:
18
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -1,19 +0,0 @@
1
- on:
2
- push:
3
- branches:
4
- - main
5
-
6
- permissions:
7
- contents: write # creates a release commit
8
- pull-requests: write # creates a release PR
9
-
10
- name: release-please
11
-
12
- jobs:
13
- release-please:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: googleapis/release-please-action@v4
17
- with:
18
- token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
19
- release-type: node
package/.husky/commit-msg DELETED
@@ -1 +0,0 @@
1
- npx --no -- commitlint --edit $1
package/.husky/pre-commit DELETED
@@ -1 +0,0 @@
1
- npx lint-staged
package/.lintstagedrc.cjs DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- '!(*.ts)': 'prettier --write --ignore-unknown',
3
- '*.ts': ['eslint --fix', 'prettier --write'],
4
- }
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v18
package/.prettierrc DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true
4
- }
@@ -1,23 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/react-vite'
2
-
3
- const config: StorybookConfig = {
4
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
- addons: [
6
- '@storybook/addon-onboarding',
7
- '@storybook/addon-links',
8
- '@storybook/addon-essentials',
9
- '@chromatic-com/storybook',
10
- '@storybook/addon-interactions',
11
- '@storybook/addon-a11y',
12
- '@storybook/addon-themes',
13
- 'storybook-addon-rtl',
14
- ],
15
- framework: {
16
- name: '@storybook/react-vite',
17
- options: {},
18
- },
19
- typescript: {
20
- reactDocgen: 'react-docgen-typescript',
21
- },
22
- }
23
- export default config
@@ -1,33 +0,0 @@
1
- import type { Preview } from '@storybook/react'
2
- import { withThemeByClassName } from '@storybook/addon-themes'
3
- import { withDirection } from './withDirection'
4
- import '../src/index.css'
5
-
6
- const preview: Preview = {
7
- decorators: [
8
- withDirection,
9
- withThemeByClassName({
10
- themes: {
11
- light: '',
12
- dark: 'dark',
13
- 'high contrast light': 'contrast-light',
14
- 'high contrast dark': 'contrast-dark',
15
- },
16
- // Set the theme based on user's browser pref.
17
- defaultTheme: window.matchMedia?.('(prefers-color-scheme: dark)').matches
18
- ? 'dark'
19
- : 'light',
20
- }),
21
- ],
22
- parameters: {
23
- controls: {
24
- matchers: {
25
- color: /(background|color)$/i,
26
- date: /Date$/i,
27
- },
28
- },
29
- },
30
- tags: ['autodocs'],
31
- }
32
-
33
- export default preview
@@ -1,22 +0,0 @@
1
- import React from 'react'
2
- import { RTL_UPDATE_EVENT, type RTLChangeEvent } from 'storybook-addon-rtl'
3
- import { useChannel } from 'storybook/internal/preview-api'
4
- import { DirectionProvider } from '@radix-ui/react-direction'
5
-
6
- type Direction = 'ltr' | 'rtl'
7
-
8
- export function withDirection(Story) {
9
- const [direction, setDirection] = React.useState<Direction>('ltr')
10
-
11
- useChannel({
12
- [RTL_UPDATE_EVENT]: (rtlChangeEvent: RTLChangeEvent) => {
13
- setDirection(rtlChangeEvent.direction)
14
- },
15
- })
16
-
17
- return (
18
- <DirectionProvider dir={direction}>
19
- <Story />
20
- </DirectionProvider>
21
- )
22
- }
package/components.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "default",
4
- "rsc": true,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "tailwind.config.js",
8
- "css": "src/index.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true,
11
- "prefix": ""
12
- },
13
- "aliases": {
14
- "components": "@/components",
15
- "utils": "@/lib/utils"
16
- }
17
- }
package/postcss.config.js DELETED
@@ -1,6 +0,0 @@
1
- export default {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
@@ -1,25 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react'
2
- import { fn } from '@storybook/test'
3
- import { Mail } from 'lucide-react'
4
- import { Button } from '@/components/ui/button'
5
-
6
- type Story = StoryObj<typeof meta>
7
-
8
- const meta = {
9
- component: Button,
10
- args: {
11
- children: 'Button',
12
- disabled: false,
13
- onClick: fn(),
14
- },
15
- } satisfies Meta<typeof Button>
16
-
17
- export default meta
18
-
19
- export const Default: Story = {}
20
-
21
- export const WithIcon: Story = {
22
- args: {
23
- children: [<Mail className="me-2 size-4" />, 'Button with Icon'],
24
- },
25
- }
@@ -1,56 +0,0 @@
1
- import * as React from 'react'
2
- import { Slot } from '@radix-ui/react-slot'
3
- import { cva, type VariantProps } from 'class-variance-authority'
4
-
5
- import { cn } from '@/lib/utils'
6
-
7
- const buttonVariants = cva(
8
- 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
9
- {
10
- variants: {
11
- variant: {
12
- default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
- destructive:
14
- 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
15
- outline:
16
- 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
17
- secondary:
18
- 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
19
- ghost: 'hover:bg-accent hover:text-accent-foreground',
20
- link: 'text-primary underline-offset-4 hover:underline',
21
- },
22
- size: {
23
- default: 'h-10 px-4 py-2',
24
- sm: 'h-9 rounded-md px-3',
25
- lg: 'h-11 rounded-md px-8',
26
- icon: 'h-10 w-10',
27
- },
28
- },
29
- defaultVariants: {
30
- variant: 'default',
31
- size: 'default',
32
- },
33
- },
34
- )
35
-
36
- export interface ButtonProps
37
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
- VariantProps<typeof buttonVariants> {
39
- asChild?: boolean
40
- }
41
-
42
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
- ({ className, variant, size, asChild = false, ...props }, ref) => {
44
- const Comp = asChild ? Slot : 'button'
45
- return (
46
- <Comp
47
- className={cn(buttonVariants({ variant, size, className }))}
48
- ref={ref}
49
- {...props}
50
- />
51
- )
52
- },
53
- )
54
- Button.displayName = 'Button'
55
-
56
- export { Button, buttonVariants }
package/src/index.css DELETED
@@ -1,81 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- @layer base {
6
- :root {
7
- --background: 0 0% 100%;
8
- --foreground: 0 0% 3.9%;
9
- --card: 0 0% 100%;
10
- --card-foreground: 0 0% 3.9%;
11
- --popover: 0 0% 100%;
12
- --popover-foreground: 0 0% 3.9%;
13
- --primary: 0 0% 9%;
14
- --primary-foreground: 0 0% 98%;
15
- --secondary: 0 0% 96.1%;
16
- --secondary-foreground: 0 0% 9%;
17
- --muted: 0 0% 96.1%;
18
- --muted-foreground: 0 0% 45.1%;
19
- --accent: 0 0% 96.1%;
20
- --accent-foreground: 0 0% 9%;
21
- --destructive: 0 84.2% 60.2%;
22
- --destructive-foreground: 0 0% 98%;
23
- --border: 0 0% 89.8%;
24
- --input: 0 0% 89.8%;
25
- --ring: 0 0% 3.9%;
26
- --radius: 0.5rem;
27
- --chart-1: 12 76% 61%;
28
- --chart-2: 173 58% 39%;
29
- --chart-3: 197 37% 24%;
30
- --chart-4: 43 74% 66%;
31
- --chart-5: 27 87% 67%;
32
- }
33
-
34
- .dark {
35
- --background: 0 0% 3.9%;
36
- --foreground: 0 0% 98%;
37
- --card: 0 0% 3.9%;
38
- --card-foreground: 0 0% 98%;
39
- --popover: 0 0% 3.9%;
40
- --popover-foreground: 0 0% 98%;
41
- --primary: 0 0% 98%;
42
- --primary-foreground: 0 0% 9%;
43
- --secondary: 0 0% 14.9%;
44
- --secondary-foreground: 0 0% 98%;
45
- --muted: 0 0% 14.9%;
46
- --muted-foreground: 0 0% 63.9%;
47
- --accent: 0 0% 14.9%;
48
- --accent-foreground: 0 0% 98%;
49
- --destructive: 0 62.8% 30.6%;
50
- --destructive-foreground: 0 0% 98%;
51
- --border: 0 0% 14.9%;
52
- --input: 0 0% 14.9%;
53
- --ring: 0 0% 83.1%;
54
- --chart-1: 220 70% 50%;
55
- --chart-2: 160 60% 45%;
56
- --chart-3: 30 80% 55%;
57
- --chart-4: 280 65% 60%;
58
- --chart-5: 340 75% 55%;
59
- }
60
-
61
- .contrast-dark {
62
- /* TODO: Finish list of high-contrast values */
63
- --background: 0 0% 0%;
64
- --foreground: 0 0% 98%;
65
- }
66
-
67
- .contrast-light {
68
- /* TODO: Finish list of high-contrast values */
69
- --background: 0 0% 100%;
70
- --foreground: 0 0% 3.9%;
71
- }
72
- }
73
-
74
- @layer base {
75
- * {
76
- @apply border-border;
77
- }
78
- body {
79
- @apply bg-background text-foreground;
80
- }
81
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- import '@/index.css'
2
-
3
- export { Button } from '@/components/ui/button'
package/src/lib/utils.ts DELETED
@@ -1,6 +0,0 @@
1
- import { type ClassValue, clsx } from 'clsx'
2
- import { twMerge } from 'tailwind-merge'
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }
@@ -1,111 +0,0 @@
1
- const plugin = require('tailwindcss/plugin')
2
-
3
- const isProductionBuild = process.env.NODE_ENV === 'production'
4
-
5
- // Configure which files Tailwind CSS (TW) scans to produce CSS classes.
6
- const content = [
7
- // We want the ability to use TW anywhere in the project (like Storybook)...
8
- './src/**/*.{ts,tsx}',
9
- // But we only want to export the classes used by library components.
10
- ...(isProductionBuild ? ['!./src/**/*.{spec,stories,test}.{ts,tsx}'] : []),
11
- ]
12
-
13
- const safelist = [
14
- 'dark',
15
- /**
16
- * We only want these modifiers available to Storybook.
17
- * To use them in Storybook, prepend them to any Tailwind CSS utility class.
18
- * Example: add a white border while simulating a high contrast dark theme:
19
- * `className="contrast-dark:border contrast-dark:border-white"`
20
- */
21
- ...(isProductionBuild ? [] : ['contrast-dark', 'contrast-light']),
22
- ]
23
-
24
- /** @type {import('tailwindcss').Config} */
25
- module.exports = {
26
- darkMode: ['class'],
27
- content,
28
- prefix: '',
29
- safelist,
30
- theme: {
31
- container: {
32
- center: true,
33
- padding: '2rem',
34
- screens: {
35
- '2xl': '1400px',
36
- },
37
- },
38
- extend: {
39
- colors: {
40
- border: 'hsl(var(--border))',
41
- input: 'hsl(var(--input))',
42
- ring: 'hsl(var(--ring))',
43
- background: 'hsl(var(--background))',
44
- foreground: 'hsl(var(--foreground))',
45
- primary: {
46
- DEFAULT: 'hsl(var(--primary))',
47
- foreground: 'hsl(var(--primary-foreground))',
48
- },
49
- secondary: {
50
- DEFAULT: 'hsl(var(--secondary))',
51
- foreground: 'hsl(var(--secondary-foreground))',
52
- },
53
- destructive: {
54
- DEFAULT: 'hsl(var(--destructive))',
55
- foreground: 'hsl(var(--destructive-foreground))',
56
- },
57
- muted: {
58
- DEFAULT: 'hsl(var(--muted))',
59
- foreground: 'hsl(var(--muted-foreground))',
60
- },
61
- accent: {
62
- DEFAULT: 'hsl(var(--accent))',
63
- foreground: 'hsl(var(--accent-foreground))',
64
- },
65
- popover: {
66
- DEFAULT: 'hsl(var(--popover))',
67
- foreground: 'hsl(var(--popover-foreground))',
68
- },
69
- card: {
70
- DEFAULT: 'hsl(var(--card))',
71
- foreground: 'hsl(var(--card-foreground))',
72
- },
73
- },
74
- borderRadius: {
75
- lg: 'var(--radius)',
76
- md: 'calc(var(--radius) - 2px)',
77
- sm: 'calc(var(--radius) - 4px)',
78
- },
79
- keyframes: {
80
- 'accordion-down': {
81
- from: { height: '0' },
82
- to: { height: 'var(--radix-accordion-content-height)' },
83
- },
84
- 'accordion-up': {
85
- from: { height: 'var(--radix-accordion-content-height)' },
86
- to: { height: '0' },
87
- },
88
- },
89
- animation: {
90
- 'accordion-down': 'accordion-down 0.2s ease-out',
91
- 'accordion-up': 'accordion-up 0.2s ease-out',
92
- },
93
- },
94
- },
95
- plugins: [
96
- require('tailwindcss-animate'),
97
- ...(isProductionBuild
98
- ? []
99
- : [
100
- plugin(({ addVariant }) => {
101
- // Simulate high contrast dark themes.
102
- addVariant('contrast-dark', ['.contrast-dark &', '&.contrast-dark'])
103
- // Simulate high contrast light themes.
104
- addVariant('contrast-light', [
105
- '.contrast-light &',
106
- '&.contrast-light',
107
- ])
108
- }),
109
- ]),
110
- ],
111
- }
package/tsconfig.app.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "target": "ES2020",
6
- "useDefineForClassFields": true,
7
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
- "module": "ESNext",
9
- "skipLibCheck": true,
10
-
11
- /* Bundler mode */
12
- "moduleResolution": "bundler",
13
- "allowImportingTsExtensions": true,
14
- "resolveJsonModule": true,
15
- "isolatedModules": true,
16
- "moduleDetection": "force",
17
- "noEmit": true,
18
- "jsx": "react-jsx",
19
-
20
- /* Linting */
21
- "strict": true,
22
- "noUnusedLocals": true,
23
- "noUnusedParameters": true,
24
- "noFallthroughCasesInSwitch": true,
25
-
26
- /* UI components config */
27
- "baseUrl": ".",
28
- "paths": {
29
- "@/*": ["./src/*"]
30
- }
31
- },
32
- "include": ["src"]
33
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.app.json"
6
- },
7
- {
8
- "path": "./tsconfig.node.json"
9
- }
10
- ],
11
- "compilerOptions": {
12
- "baseUrl": ".",
13
- "paths": {
14
- "@/*": ["./src/*"]
15
- }
16
- }
17
- }
@@ -1,13 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
- "skipLibCheck": true,
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "allowSyntheticDefaultImports": true,
9
- "strict": true,
10
- "noEmit": true
11
- },
12
- "include": ["vite.config.ts"]
13
- }
package/vite.config.ts DELETED
@@ -1,44 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react-swc'
3
- import { resolve } from 'path'
4
- import dts from 'vite-plugin-dts'
5
- import { peerDependencies } from './package.json'
6
-
7
- // https://vitejs.dev/config/
8
- export default defineConfig({
9
- plugins: [
10
- react(),
11
- dts({
12
- tsconfigPath: resolve(__dirname, 'tsconfig.app.json'),
13
- rollupTypes: true,
14
- include: ['src/**/*'],
15
- }),
16
- ],
17
- resolve: {
18
- alias: {
19
- '@': resolve(__dirname, './src'),
20
- },
21
- },
22
- build: {
23
- lib: {
24
- entry: resolve(__dirname, 'src/index.ts'),
25
- name: 'keeper-js-ui',
26
- fileName: (format) => `index.${format}.js`,
27
- },
28
- rollupOptions: {
29
- external: [
30
- ...Object.keys(peerDependencies),
31
- 'react/jsx-runtime',
32
- 'react-dom/client',
33
- ],
34
- output: {
35
- exports: 'named',
36
- globals: {
37
- react: 'React',
38
- 'react-dom': 'ReactDOM',
39
- 'react/jsx-runtime': 'react/jsx-runtime',
40
- },
41
- },
42
- },
43
- },
44
- })