buildgrid-ui 1.1.0-alpha.6 → 1.1.0-dev.11

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 (86) hide show
  1. package/dist/blocks/help-carousel/help-carousel.d.ts +9 -0
  2. package/dist/blocks/help-carousel/index.d.ts +1 -0
  3. package/dist/blocks/index.d.ts +2 -0
  4. package/dist/blocks/pagination-controls/index.d.ts +1 -0
  5. package/dist/blocks/pagination-controls/pagination-controls.d.ts +7 -0
  6. package/dist/buildgrid-ui.es.js +4948 -3824
  7. package/dist/buildgrid-ui.umd.js +98 -58
  8. package/dist/components/adaptive-input/index.d.ts +1 -0
  9. package/dist/components/alert-dialog/alert-dialog.d.ts +20 -0
  10. package/dist/components/alert-dialog/index.d.ts +1 -0
  11. package/dist/components/badge/badge.d.ts +1 -1
  12. package/dist/components/button/button.d.ts +1 -1
  13. package/dist/components/currency-input/currency-input.d.ts +10 -0
  14. package/dist/components/currency-input/index.d.ts +1 -0
  15. package/dist/components/dialog/dialog.d.ts +19 -0
  16. package/dist/components/dialog/index.d.ts +1 -0
  17. package/dist/components/index.d.ts +8 -1
  18. package/dist/components/pagination/index.d.ts +1 -0
  19. package/dist/components/pagination/pagination.d.ts +28 -0
  20. package/dist/components/password-input/index.d.ts +1 -0
  21. package/dist/components/password-input/password-input.d.ts +16 -0
  22. package/dist/components/progress/index.d.ts +1 -0
  23. package/dist/components/progress/progress.d.ts +4 -0
  24. package/dist/components/switch/index.d.ts +1 -0
  25. package/dist/components/switch/switch.d.ts +4 -0
  26. package/dist/index.d.ts +3 -12
  27. package/dist/lib/index.d.ts +1 -0
  28. package/dist/lib/utils/formatters.d.ts +8 -0
  29. package/package.json +12 -2
  30. package/.editorconfig +0 -5
  31. package/.eslintrc.json +0 -3
  32. package/.github/workflows/release.yml +0 -25
  33. package/.husky/commit-msg +0 -1
  34. package/.prettierignore +0 -6
  35. package/.prettierrc +0 -6
  36. package/.releaserc.json +0 -40
  37. package/.storybook/main.ts +0 -26
  38. package/.storybook/preview.ts +0 -15
  39. package/commitlint.config.js +0 -3
  40. package/components.json +0 -21
  41. package/dist/components/adaptative-input/index.d.ts +0 -1
  42. package/eslint.config.mjs +0 -13
  43. package/postcss.config.js +0 -6
  44. package/src/components/adaptative-input/adaptative-input.stories.tsx +0 -30
  45. package/src/components/adaptative-input/adaptative-input.tsx +0 -66
  46. package/src/components/adaptative-input/index.ts +0 -1
  47. package/src/components/autocomplete/autocomplete.stories.tsx +0 -85
  48. package/src/components/autocomplete/autocomplete.tsx +0 -136
  49. package/src/components/autocomplete/index.ts +0 -1
  50. package/src/components/avatar/avatar.stories.tsx +0 -29
  51. package/src/components/avatar/avatar.tsx +0 -48
  52. package/src/components/avatar/index.ts +0 -1
  53. package/src/components/badge/badge.stories.tsx +0 -30
  54. package/src/components/badge/badge.tsx +0 -34
  55. package/src/components/badge/index.ts +0 -1
  56. package/src/components/button/button.stories.tsx +0 -62
  57. package/src/components/button/button.tsx +0 -82
  58. package/src/components/button/index.ts +0 -1
  59. package/src/components/card/card.stories.tsx +0 -41
  60. package/src/components/card/card.tsx +0 -61
  61. package/src/components/card/index.ts +0 -1
  62. package/src/components/checkbox/checkbox.stories.tsx +0 -36
  63. package/src/components/checkbox/checkbox.tsx +0 -28
  64. package/src/components/checkbox/index.ts +0 -1
  65. package/src/components/dropdown-menu/dropdown-menu.stories.tsx +0 -90
  66. package/src/components/dropdown-menu/dropdown-menu.tsx +0 -192
  67. package/src/components/dropdown-menu/index.ts +0 -1
  68. package/src/components/index.ts +0 -11
  69. package/src/components/input/index.ts +0 -1
  70. package/src/components/input/input.stories.tsx +0 -22
  71. package/src/components/input/input.tsx +0 -41
  72. package/src/components/popover/index.ts +0 -1
  73. package/src/components/popover/popover.stories.tsx +0 -32
  74. package/src/components/popover/popover.tsx +0 -30
  75. package/src/components/skeleton/index.ts +0 -1
  76. package/src/components/skeleton/skeleton.stories.tsx +0 -24
  77. package/src/components/skeleton/skeleton.tsx +0 -19
  78. package/src/index.ts +0 -12
  79. package/src/lib/index.ts +0 -1
  80. package/src/lib/utils/cn.ts +0 -6
  81. package/src/styles/tailwind.css +0 -66
  82. package/tailwind.config.js +0 -57
  83. package/tsconfig.app.json +0 -10
  84. package/tsconfig.json +0 -29
  85. package/vite.config.ts +0 -34
  86. /package/dist/components/{adaptative-input/adaptative-input.d.ts → adaptive-input/adaptive-input.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ export * from './adaptive-input';
@@ -0,0 +1,20 @@
1
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
2
+ import * as React from 'react';
3
+ declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
4
+ declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
6
+ declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const AlertDialogHeader: {
9
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ declare const AlertDialogFooter: {
13
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
17
+ declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
18
+ declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
19
+ declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
20
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
@@ -0,0 +1 @@
1
+ export * from './alert-dialog';
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const badgeVariants: (props?: ({
4
- variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
5
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
6
6
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  import * as React from 'react';
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
4
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
5
  size?: "default" | "sm" | "lg" | "xl" | "icon" | null | undefined;
6
6
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AdaptiveInputProps } from '../adaptive-input';
3
+ export interface CurrencyInputProps extends AdaptiveInputProps {
4
+ currencySymbol?: string;
5
+ decimalSeparator?: string;
6
+ thousandSeparator?: string;
7
+ onValueChange: (value: number) => void;
8
+ }
9
+ declare const CurrencyInput: React.ForwardRefExoticComponent<CurrencyInputProps & React.RefAttributes<HTMLInputElement>>;
10
+ export { CurrencyInput };
@@ -0,0 +1 @@
1
+ export * from './currency-input';
@@ -0,0 +1,19 @@
1
+ import * as DialogPrimitive from '@radix-ui/react-dialog';
2
+ import * as React from 'react';
3
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DialogHeader: {
10
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ declare const DialogFooter: {
14
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
18
+ declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
19
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1 @@
1
+ export * from './dialog';
@@ -1,11 +1,18 @@
1
- export * from './adaptative-input';
1
+ export * from './adaptive-input';
2
+ export * from './alert-dialog';
2
3
  export * from './autocomplete';
3
4
  export * from './avatar';
4
5
  export * from './badge';
5
6
  export * from './button';
6
7
  export * from './card';
7
8
  export * from './checkbox';
9
+ export * from './currency-input';
10
+ export * from './dialog';
8
11
  export * from './dropdown-menu';
9
12
  export * from './input';
13
+ export * from './pagination';
14
+ export * from './password-input';
10
15
  export * from './popover';
16
+ export * from './progress';
11
17
  export * from './skeleton';
18
+ export * from './switch';
@@ -0,0 +1 @@
1
+ export * from './pagination';
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { ButtonProps } from '../button';
3
+ declare const Pagination: {
4
+ ({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ declare const PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
8
+ declare const PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
9
+ type PaginationLinkProps = {
10
+ isActive?: boolean;
11
+ } & ButtonProps;
12
+ declare const PaginationLink: {
13
+ ({ className, isActive, size, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ declare const PaginationPrevious: {
17
+ ({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ declare const PaginationNext: {
21
+ ({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ declare const PaginationEllipsis: {
25
+ ({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
26
+ displayName: string;
27
+ };
28
+ export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
@@ -0,0 +1 @@
1
+ export * from './password-input';
@@ -0,0 +1,16 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
3
+ showStrengthMeter?: boolean;
4
+ strengthLabels?: {
5
+ veryWeak: string;
6
+ weak: string;
7
+ medium: string;
8
+ strong: string;
9
+ veryStrong: string;
10
+ };
11
+ showPasswordLabel?: string;
12
+ hidePasswordLabel?: string;
13
+ strengthTitle?: string;
14
+ }
15
+ export declare function PasswordInput(props: PasswordInputProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1 @@
1
+ export * from './progress';
@@ -0,0 +1,4 @@
1
+ import * as ProgressPrimitive from '@radix-ui/react-progress';
2
+ import * as React from 'react';
3
+ declare const Progress: React.ForwardRefExoticComponent<Omit<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export { Progress };
@@ -0,0 +1 @@
1
+ export * from './switch';
@@ -0,0 +1,4 @@
1
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
2
+ import * as React from 'react';
3
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ export { Switch };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,3 @@
1
- export * from './components/adaptative-input';
2
- export * from './components/autocomplete';
3
- export * from './components/avatar';
4
- export * from './components/badge';
5
- export * from './components/button';
6
- export * from './components/card';
7
- export * from './components/checkbox';
8
- export * from './components/dropdown-menu';
9
- export * from './components/input';
10
- export * from './components/popover';
11
- export * from './components/skeleton';
12
- export * from './lib/utils/cn';
1
+ export * from './blocks';
2
+ export * from './components';
3
+ export * from './lib';
@@ -1 +1,2 @@
1
1
  export * from './utils/cn';
2
+ export * from './utils/formatters';
@@ -0,0 +1,8 @@
1
+ export declare const formatCurrency: (number: number, language?: string, currency?: string) => string;
2
+ export declare const formatDateAndWeekday: (date: Date | string, language?: string) => string;
3
+ export declare const formatDateAndWeekdayAndYear: (date: Date | string, language?: string) => string;
4
+ export declare const formatDateAndMonth: (date: Date | string, language?: string) => string;
5
+ export declare const formatLongDate: (date: Date | string, language?: string) => string;
6
+ export declare const formatShortDate: (date: Date, language?: string) => string;
7
+ export declare const getMonthYearFromISODate: (date: string) => string;
8
+ export declare const formatWeekDayAndShortDate: (date: Date, language?: string) => string;
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "buildgrid-ui",
3
- "version": "1.1.0-alpha.6",
3
+ "version": "1.1.0-dev.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
+ "files": [
8
+ "dist",
9
+ "README.md",
10
+ "CHANGELOG.md",
11
+ "LICENSE"
12
+ ],
7
13
  "main": "dist/buildgrid-ui.umd.js",
8
14
  "module": "dist/buildgrid-ui.esm.js",
9
15
  "types": "dist/index.d.ts",
@@ -15,18 +21,22 @@
15
21
  "storybook": "storybook dev -p 6006",
16
22
  "build-storybook": "storybook build",
17
23
  "release": "semantic-release",
18
- "prepublishOnly": "npm run build"
24
+ "prepublishOnly": "npm run build",
25
+ "build:publish": "npm run build && npm publish"
19
26
  },
20
27
  "keywords": [],
21
28
  "author": "",
22
29
  "license": "ISC",
23
30
  "description": "",
24
31
  "dependencies": {
32
+ "@radix-ui/react-alert-dialog": "^1.1.4",
25
33
  "@radix-ui/react-avatar": "^1.1.2",
26
34
  "@radix-ui/react-checkbox": "^1.1.3",
27
35
  "@radix-ui/react-dropdown-menu": "^2.1.4",
28
36
  "@radix-ui/react-popover": "^1.1.4",
37
+ "@radix-ui/react-progress": "^1.1.1",
29
38
  "@radix-ui/react-slot": "^1.1.1",
39
+ "@radix-ui/react-switch": "^1.1.2",
30
40
  "@shadcn/ui": "^0.0.4",
31
41
  "class-variance-authority": "^0.7.1",
32
42
  "clsx": "^2.1.1",
package/.editorconfig DELETED
@@ -1,5 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = tab
5
- indent_size = 2
package/.eslintrc.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": ["next/core-web-vitals", "next/typescript", "prettier"]
3
- }
@@ -1,25 +0,0 @@
1
- name: Release
2
- on:
3
- push:
4
- branches:
5
- - main
6
- - alpha
7
- - beta
8
- - rc
9
- jobs:
10
- release:
11
- runs-on: ubuntu-latest
12
- steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v3
15
- - name: Setup Node.js
16
- uses: actions/setup-node@v3
17
- with:
18
- node-version: "20.8.1"
19
- - name: Install dependencies
20
- run: npm ci
21
- - name: Run semantic-release
22
- env:
23
- GH_TOKEN: ${{ secrets.GH_TOKEN }}
24
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
25
- run: npm run release
package/.husky/commit-msg DELETED
@@ -1 +0,0 @@
1
- npx --no-install commitlint --edit "$1"
package/.prettierignore DELETED
@@ -1,6 +0,0 @@
1
- .github
2
- node_modules
3
- build
4
- dist
5
-
6
- *.md
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "semi": false,
3
- "singleQuote": true,
4
- "printWidth": 90,
5
- "plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-organize-imports"]
6
- }
package/.releaserc.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "branches": [
3
- "main",
4
- {
5
- "name": "alpha",
6
- "prerelease": "alpha"
7
- },
8
- {
9
- "name": "beta",
10
- "prerelease": "beta"
11
- },
12
- {
13
- "name": "release-candidate",
14
- "prerelease": "rc"
15
- }
16
- ],
17
- "plugins": [
18
- "@semantic-release/commit-analyzer",
19
- "@semantic-release/release-notes-generator",
20
- [
21
- "@semantic-release/changelog",
22
- {
23
- "changelogFile": "CHANGELOG.md"
24
- }
25
- ],
26
- [
27
- "@semantic-release/npm",
28
- {
29
- "npmPublish": true
30
- }
31
- ],
32
- [
33
- "@semantic-release/git",
34
- {
35
- "assets": ["package.json", "CHANGELOG.md"],
36
- "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
37
- }
38
- ]
39
- ]
40
- }
@@ -1,26 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/react-vite'
2
- import { mergeConfig } from 'vite'
3
-
4
- const config: StorybookConfig = {
5
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
6
- addons: [
7
- '@storybook/addon-onboarding',
8
- '@storybook/addon-essentials',
9
- '@chromatic-com/storybook',
10
- '@storybook/addon-interactions',
11
- ],
12
- framework: {
13
- name: '@storybook/react-vite',
14
- options: {},
15
- },
16
- async viteFinal(config) {
17
- return mergeConfig(config, {
18
- css: {
19
- postcss: {
20
- plugins: [require('tailwindcss'), require('autoprefixer')],
21
- },
22
- },
23
- })
24
- },
25
- }
26
- export default config
@@ -1,15 +0,0 @@
1
- import type { Preview } from "@storybook/react";
2
- import "../src/styles/tailwind.css";
3
-
4
- const preview: Preview = {
5
- parameters: {
6
- controls: {
7
- matchers: {
8
- color: /(background|color)$/i,
9
- date: /Date$/i,
10
- },
11
- },
12
- },
13
- };
14
-
15
- export default preview;
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ["@commitlint/config-conventional"],
3
- };
package/components.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "default",
4
- "rsc": false,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "tailwind.config.js",
8
- "css": "src/styles/tailwind.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true,
11
- "prefix": ""
12
- },
13
- "aliases": {
14
- "components": "@/components",
15
- "utils": "@/lib/utils",
16
- "ui": "@/components/ui",
17
- "lib": "@/lib",
18
- "hooks": "@/hooks"
19
- },
20
- "iconLibrary": "lucide"
21
- }
@@ -1 +0,0 @@
1
- export * from './adaptative-input';
package/eslint.config.mjs DELETED
@@ -1,13 +0,0 @@
1
- import path from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- import js from "@eslint/js";
4
- import { FlatCompat } from "@eslint/eslintrc";
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
- const __dirname = path.dirname(__filename);
8
- const compat = new FlatCompat({
9
- baseDirectory: __dirname,
10
- recommendedConfig: js.configs.recommended,
11
- allConfig: js.configs.all
12
- });
13
- export default [...compat.extends("next/core-web-vitals", "next/typescript", "prettier")];
package/postcss.config.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- };
@@ -1,30 +0,0 @@
1
- // organize-imports-ignore
2
- import React from 'react'
3
- import type { Meta, StoryObj } from '@storybook/react'
4
-
5
- import { AdaptiveInput } from './adaptative-input'
6
- import { HelpCircle, Phone, User } from 'lucide-react'
7
-
8
- const meta: Meta<typeof AdaptiveInput> = {
9
- title: 'Components/Input/AdaptiveInput',
10
- component: AdaptiveInput,
11
- }
12
-
13
- export default meta
14
- type Story = StoryObj<typeof AdaptiveInput>
15
-
16
- const Template = () => {
17
- return (
18
- <AdaptiveInput
19
- className="w-64"
20
- leftIcon={<Phone className="w-4 h-4" />}
21
- rightIcon={<HelpCircle className="w-4 h-4" />}
22
- mask="+00 0000-0000"
23
- />
24
- )
25
- }
26
-
27
- export const Default: Story = {
28
- render: Template.bind({}),
29
- args: {},
30
- }
@@ -1,66 +0,0 @@
1
- import { cn } from '@/lib'
2
- import * as React from 'react'
3
- import { Input, InputProps } from '../input'
4
-
5
- export interface AdaptiveInputProps extends InputProps {
6
- leftIcon?: React.ReactNode
7
- rightIcon?: React.ReactNode
8
- mask?: string // New prop for the mask
9
- }
10
-
11
- const applyMask = (value: string, mask: string): string => {
12
- const cleanValue = value.replace(/\D/g, '')
13
- let maskedValue = ''
14
- let maskIndex = 0
15
- let valueIndex = 0
16
-
17
- while (maskIndex < mask.length && valueIndex < cleanValue.length) {
18
- if (mask[maskIndex] === '0') {
19
- maskedValue += cleanValue[valueIndex]
20
- valueIndex++
21
- } else {
22
- maskedValue += mask[maskIndex]
23
- }
24
- maskIndex++
25
- }
26
-
27
- return maskedValue
28
- }
29
-
30
- const AdaptiveInput = React.forwardRef<HTMLInputElement, AdaptiveInputProps>(
31
- ({ className, leftIcon, rightIcon, mask, onChange, ...props }, ref) => {
32
- const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
33
- const input = e.target
34
- if (mask) {
35
- const maskedValue = applyMask(input.value, mask)
36
- input.value = maskedValue
37
- }
38
- onChange?.(e) // Call the original onChange if provided
39
- }
40
-
41
- return (
42
- <div className="relative w-fit">
43
- {leftIcon && (
44
- <div className="absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground">
45
- {leftIcon}
46
- </div>
47
- )}
48
- <Input
49
- className={cn(leftIcon && 'pl-8', rightIcon && 'pr-8', className)}
50
- ref={ref}
51
- onInput={handleInputChange} // Attach the input handler
52
- {...props}
53
- />
54
- {rightIcon && (
55
- <div className="absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground">
56
- {rightIcon}
57
- </div>
58
- )}
59
- </div>
60
- )
61
- },
62
- )
63
-
64
- AdaptiveInput.displayName = 'AdaptiveInput'
65
-
66
- export { AdaptiveInput }
@@ -1 +0,0 @@
1
- export * from './adaptative-input'
@@ -1,85 +0,0 @@
1
- // organize-imports-ignore
2
- import React from 'react'
3
- import type { Meta, StoryObj } from '@storybook/react'
4
-
5
- import { Autocomplete } from './autocomplete'
6
-
7
- const meta: Meta<typeof Autocomplete> = {
8
- title: 'Components/Input/Autocomplete',
9
- component: Autocomplete,
10
- }
11
-
12
- export default meta
13
- type Story = StoryObj<typeof Autocomplete>
14
-
15
- // list of 50 names of countries
16
- const options = [
17
- 'United States',
18
- 'Canada',
19
- 'Argentina',
20
- 'Brazil',
21
- 'Chile',
22
- 'Colombia',
23
- 'Ecuador',
24
- 'Peru',
25
- 'Uruguay',
26
- 'Venezuela',
27
- 'Australia',
28
- 'China',
29
- 'India',
30
- 'Indonesia',
31
- 'Japan',
32
- 'Korea',
33
- 'Malaysia',
34
- 'Philippines',
35
- 'Singapore',
36
- 'Thailand',
37
- 'Vietnam',
38
- 'Austria',
39
- 'Belgium',
40
- 'Croatia',
41
- 'Denmark',
42
- 'Finland',
43
- 'France',
44
- 'Germany',
45
- 'Greece',
46
- 'Hungary',
47
- 'Ireland',
48
- 'Italy',
49
- 'Netherlands',
50
- 'Norway',
51
- 'Poland',
52
- 'Portugal',
53
- 'Romania',
54
- 'Russia',
55
- 'Spain',
56
- 'Sweden',
57
- 'Switzerland',
58
- 'Turkey',
59
- 'Ukraine',
60
- 'United Kingdom',
61
- 'Egypt',
62
- 'Nigeria',
63
- 'South Africa',
64
- 'Kenya',
65
- ]
66
-
67
- const Template = () => {
68
- const [value, setValue] = React.useState('')
69
- return (
70
- <>
71
- <Autocomplete
72
- value={value}
73
- onChange={(value) => setValue(value)}
74
- className="w-80"
75
- options={options.map((option) => ({ value: option, label: option }))}
76
- />
77
- <p className="mt-4">Selected value: {value}</p>
78
- </>
79
- )
80
- }
81
-
82
- export const Default: Story = {
83
- render: Template.bind({}),
84
- args: {},
85
- }