@betterinternship/components 2.0.0 → 2.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.
- package/README.md +25 -15
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/icons.js.map +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/hooks/useClientProcess.js.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +230 -228
- package/theme.css +12 -7
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.setup.d.ts +0 -1
- /package/dist/{src/components → components}/ui/accordion.d.ts +0 -0
- /package/dist/{src/components → components}/ui/avatar.d.ts +0 -0
- /package/dist/{src/components → components}/ui/badge.d.ts +0 -0
- /package/dist/{src/components → components}/ui/button.d.ts +0 -0
- /package/dist/{src/components → components}/ui/button.test.d.ts +0 -0
- /package/dist/{src/components → components}/ui/calendar.d.ts +0 -0
- /package/dist/{src/components → components}/ui/card.d.ts +0 -0
- /package/dist/{src/components → components}/ui/checkbox.d.ts +0 -0
- /package/dist/{src/components → components}/ui/dialog.d.ts +0 -0
- /package/dist/{src/components → components}/ui/icons.d.ts +0 -0
- /package/dist/{src/components → components}/ui/input.d.ts +0 -0
- /package/dist/{src/components → components}/ui/label.d.ts +0 -0
- /package/dist/{src/components → components}/ui/popover.d.ts +0 -0
- /package/dist/{src/components → components}/ui/separator.d.ts +0 -0
- /package/dist/{src/components → components}/ui/skeleton.d.ts +0 -0
- /package/dist/{src/components → components}/ui/switch.d.ts +0 -0
- /package/dist/{src/components → components}/ui/table.d.ts +0 -0
- /package/dist/{src/components → components}/ui/textarea.d.ts +0 -0
- /package/dist/{src/components → components}/ui/tooltip.d.ts +0 -0
- /package/dist/{src/config.d.ts → config.d.ts} +0 -0
- /package/dist/{src/hooks → hooks}/useClientProcess.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,39 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
Contains common components shared between the different interfaces of the site.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Running the playground
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This package comes with a simple React app that you can use to test components. It runs on `localhost:5173` in your browser.
|
|
8
|
+
|
|
9
|
+
Run the playground:
|
|
8
10
|
|
|
9
11
|
```bash
|
|
10
|
-
npm run
|
|
12
|
+
npm run dev:playground
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## Running the test suite
|
|
16
|
+
|
|
17
|
+
Run the test suite:
|
|
14
18
|
|
|
15
19
|
```bash
|
|
16
|
-
|
|
17
|
-
git commit -m "<follow conventional commits, k thanks>"
|
|
18
|
-
git push
|
|
20
|
+
npm run test
|
|
19
21
|
```
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
or run the test suite in watch mode if you're making changes:
|
|
22
24
|
|
|
23
25
|
```bash
|
|
24
|
-
npm
|
|
25
|
-
npm publish
|
|
26
|
+
npm run test:watch
|
|
26
27
|
```
|
|
27
28
|
|
|
28
|
-
##
|
|
29
|
+
## Updating the package
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
1. Build the package:
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
|
-
npm run
|
|
34
|
+
npm run build
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
2. Commit the build:
|
|
37
38
|
|
|
38
39
|
```bash
|
|
39
|
-
|
|
40
|
+
git add .
|
|
41
|
+
git commit -m "<follow conventional commits, k thanks>"
|
|
42
|
+
git push
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
3. Update the version and publish the package to NPM:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm version <major|minor|patch>
|
|
49
|
+
npm publish
|
|
40
50
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sources":["
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../../src/components/ui/accordion.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AccordionPrimitive from '@radix-ui/react-accordion';\nimport { ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Accordion({\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Root>) {\n return <AccordionPrimitive.Root data-slot=\"accordion\" {...props} />;\n}\n\nfunction AccordionItem({\n className,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Item>) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('border-b last:border-b-0', className)}\n {...props}\n />\n );\n}\n\nfunction AccordionTrigger({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {\n return (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\nfunction AccordionContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof AccordionPrimitive.Content>) {\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className=\"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm\"\n {...props}\n >\n <div className={cn('pt-0 pb-4', className)}>{children}</div>\n </AccordionPrimitive.Content>\n );\n}\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,SAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EAC6C,EAAA;IACrD,OAAOA,qBAAA,CAAC,kBAAkB,CAAC,IAAI,iBAAW,WAAW,EAAA,GAAK,KAAK,EAAA,CAAI;AACrE;AAEA,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EAC6C,EAAA;IACrD,QACEA,sBAAC,kBAAkB,CAAC,IAAI,EAAA,EAAA,WAAA,EACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgD,EAAA;AACxD,IAAA,QACEA,qBAAA,CAAC,kBAAkB,CAAC,MAAM,EAAA,EAAC,SAAS,EAAC,MAAM,EAAA,QAAA,EACzCC,sBAAA,CAAC,kBAAkB,CAAC,OAAO,iBACf,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CACX,4SAA4S,EAC5S,SAAS,CACV,KACG,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACTD,qBAAA,CAAC,eAAe,EAAA,EAAC,SAAS,EAAC,6GAA6G,GAAG,CAAA,EAAA,CAChH,EAAA,CACH;AAEhC;AAEA,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgD,EAAA;AACxD,IAAA,QACEA,qBAAA,CAAC,kBAAkB,CAAC,OAAO,EAAA,EAAA,WAAA,EACf,mBAAmB,EAC7B,SAAS,EAAC,2GAA2G,EAAA,GACjH,KAAK,EAAA,QAAA,EAETA,qBAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO,EAAA,CACjC;AAEjC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":["
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../../src/components/ui/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\n\nimport { cn } from '@/utils';\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n 'relative flex size-8 shrink-0 overflow-hidden rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted flex size-full items-center justify-center rounded-full',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Avatar, AvatarImage, AvatarFallback };\n"],"names":["_jsx"],"mappings":";;;;AAKA,SAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC0C,EAAA;IAClD,QACEA,sBAAC,eAAe,CAAC,IAAI,EAAA,EAAA,WAAA,EACT,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,4DAA4D,EAC5D,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EAC2C,EAAA;IACnD,QACEA,sBAAC,eAAe,CAAC,KAAK,EAAA,EAAA,WAAA,EACV,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,KAC/C,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,cAAc,CAAC,EACtB,SAAS,EACT,GAAG,KAAK,EAC8C,EAAA;IACtD,QACEA,sBAAC,eAAe,CAAC,QAAQ,EAAA,EAAA,WAAA,EACb,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,kEAAkE,EAClE,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/ui/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/utils';\nimport { BooleanCheckIcon } from './icons';\n\nconst badgeVariants = cva(\n [\n 'border',\n 'cursor-default',\n 'font-semibold',\n 'inline-flex',\n 'items-center',\n 'px-[0.75em]',\n 'py-[0.25em]',\n 'rounded-[0.33em]',\n 'select-none',\n 'text-xs',\n 'transition-colors',\n 'whitespace-nowrap',\n ],\n {\n variants: {\n variant: {\n outline: ['bg-transparent', 'border-opacity-70'],\n solid: ['border-transparent'],\n },\n type: {\n default: [],\n primary: [],\n accent: [],\n supportive: [],\n warning: [],\n destructive: [],\n },\n strength: {\n default: ['opacity-100'],\n medium: ['opacity-80'],\n light: ['opacity-50'],\n invisible: ['opacity-0'],\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n type: 'default',\n class: 'border-gray-400 text-gray-600',\n },\n {\n variant: 'outline',\n type: 'primary',\n class: 'border-primary/80 text-primary',\n },\n {\n variant: 'outline',\n type: 'accent',\n class: 'border-accent/80 text-accent',\n },\n {\n variant: 'outline',\n type: 'supportive',\n class: 'border-supportive/80 text-supportive',\n },\n {\n variant: 'outline',\n type: 'warning',\n class: 'border-warning/80 text-warning',\n },\n {\n variant: 'outline',\n type: 'destructive',\n class: 'border-destructive/80 text-destructive',\n },\n { variant: 'solid', type: 'default', class: 'bg-gray-100 text-gray-700' },\n {\n variant: 'solid',\n type: 'primary',\n class: 'bg-primary text-primary-foreground',\n },\n {\n variant: 'solid',\n type: 'accent',\n class: 'bg-accent text-accent-foreground',\n },\n {\n variant: 'solid',\n type: 'supportive',\n class: 'bg-supportive text-supportive-foreground',\n },\n {\n variant: 'solid',\n type: 'warning',\n class: 'bg-warning text-warning-foreground',\n },\n {\n variant: 'solid',\n type: 'destructive',\n class: 'bg-destructive text-destructive-foreground',\n },\n ],\n defaultVariants: {\n variant: 'outline',\n type: 'default',\n strength: 'default',\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport function Badge({\n className,\n variant,\n type,\n strength,\n ...props\n}: BadgeProps) {\n return (\n <div\n className={cn(badgeVariants({ variant, type, strength }), className)}\n {...props}\n />\n );\n}\nBadge.displayName = 'Badge';\n\nexport function BoolBadge({\n state,\n onValue,\n offValue,\n onScheme = 'supportive',\n offScheme = 'accent',\n className = '',\n ...props\n}: {\n state: boolean | null | undefined;\n onValue: string;\n offValue: string;\n onScheme?: 'default' | 'primary' | 'accent' | 'supportive' | 'destructive';\n offScheme?: 'default' | 'primary' | 'accent' | 'supportive' | 'destructive';\n className?: string;\n}) {\n return (\n <Badge\n variant=\"solid\"\n type={state ? onScheme : offScheme}\n {...props}\n className={cn('pointer-events-none rounded-[0.33em]', className)}\n >\n <BooleanCheckIcon checked={state} />\n {state ? onValue : offValue}\n </Badge>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,MAAM,aAAa,GAAG,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AA,GAChE,KAAK,EAAA,CACT;AAEN;AACA,KAAK,CAAC,WAAW,GAAG,OAAO;AAErB,SAAU,SAAS,CAAC,EACxB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,YAAY,EACvB,SAAS,GAAG,QAAQ,EACpB,SAAS,GAAG,EAAE,EACd,GAAG,KAAK,EAQT,EAAA;IACC,QACEC,uBAAC,KAAK,EAAA,EACJ,OAAO,EAAC,OAAO,EACf,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,EAAA,GAC9B,KAAK,EACT,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CAEhED,sBAAC,gBAAgB,EAAA,EAAC,OAAO,EAAE,KAAK,EAAA,CAAI,EACnC,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAA,EAAA,CACrB;AAEZ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/utils';\n\nconst buttonVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'whitespace-nowrap',\n 'rounded-[0.33em]',\n 'text-sm',\n 'font-medium',\n 'transition-colors',\n 'cursor-pointer',\n 'focus:outline-none',\n 'focus:ring-transparent',\n 'disabled:pointer-events-none',\n 'disabled:opacity-50',\n '[&_svg]:pointer-events-none',\n '[&_svg]:size-4',\n '[&_svg]:shrink-0',\n ],\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n outline:\n 'border border-gray-300 text-gray-700 bg-background hover:bg-accent',\n ghost: 'hover:bg-accent text-gray-700 hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n scheme: {\n default: '',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n supportive:\n 'bg-supportive text-supportive-foreground hover:bg-supportive/90',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n },\n size: {\n default: 'h-8 px-[1em] py-[0.33em]',\n sm: 'h-8 px-3',\n lg: 'h-11 px-8',\n md: 'h-10 px-6',\n icon: 'h-10 w-10',\n xs: 'h-6 px-3 text-xs',\n },\n expandIcon: {\n true: 'max-w-8 gap-0 overflow-hidden px-2 transition-[max-width,padding,gap] duration-200 hover:max-w-48 hover:gap-2 hover:px-3 focus-visible:max-w-48 focus-visible:gap-2 focus-visible:px-3 [&_.button-label]:max-w-0 [&_.button-label]:overflow-hidden [&_.button-label]:opacity-0 [&_.button-label]:transition-[max-width,opacity] [&_.button-label]:duration-200 hover:[&_.button-label]:max-w-40 hover:[&_.button-label]:opacity-100 focus-visible:[&_.button-label]:max-w-40 focus-visible:[&_.button-label]:opacity-100',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n scheme: 'primary',\n class:\n 'bg-background border border-primary text-primary hover:bg-blue-50',\n },\n {\n variant: 'outline',\n scheme: 'supportive',\n class:\n 'bg-background border border-supportive text-supportive hover:bg-green-50',\n },\n {\n variant: 'outline',\n scheme: 'destructive',\n class:\n 'bg-background border border-destructive text-destructive hover:bg-red-50',\n },\n {\n variant: 'ghost',\n scheme: 'destructive',\n class:\n 'bg-transparent text-destructive hover:bg-red-50 hover:text-destructive',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n expandIcon: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n { className, variant, scheme, size, expandIcon, asChild = false, ...props },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, scheme, size, expandIcon, className }),\n )}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\n"],"names":["React","_jsx"],"mappings":";;;;;;AAMA,MAAM,cAAc,GAAG,GAAG,CACxB;IACE,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,mBAAmB;IACnB,kBAAkB;IAClB,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,wBAAwB;IACxB,8BAA8B;IAC9B,qBAAqB;IACrB,6BAA6B;IAC7B,gBAAgB;IAChB,kBAAkB;CACnB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,wDAAwD;AACjE,YAAA,OAAO,EACL,oEAAoE;AACtE,YAAA,KAAK,EAAE,4DAA4D;AACnE,YAAA,IAAI,EAAE,iDAAiD;AACxD,SAAA;AACD,QAAA,MAAM,EAAE;AACN,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,OAAO,EAAE,wDAAwD;AACjE,YAAA,UAAU,EACR,iEAAiE;AACnE,YAAA,WAAW,EACT,oEAAoE;AACtE,YAAA,SAAS,EACP,8DAA8D;AACjE,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,OAAO,EAAE,0BAA0B;AACnC,YAAA,EAAE,EAAE,UAAU;AACd,YAAA,EAAE,EAAE,WAAW;AACf,YAAA,EAAE,EAAE,WAAW;AACf,YAAA,IAAI,EAAE,WAAW;AACjB,YAAA,EAAE,EAAE,kBAAkB;AACvB,SAAA;AACD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,0fAA0f;AAChgB,YAAA,KAAK,EAAE,EAAE;AACV,SAAA;AACF,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,KAAK,EACH,mEAAmE;AACtE,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,MAAM,EAAE,YAAY;AACpB,YAAA,KAAK,EACH,0EAA0E;AAC7E,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,MAAM,EAAE,aAAa;AACrB,YAAA,KAAK,EACH,0EAA0E;AAC7E,SAAA;AACD,QAAA;AACE,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,MAAM,EAAE,aAAa;AACrB,YAAA,KAAK,EACH,wEAAwE;AAC3E,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,UAAU,EAAE,KAAK;AAClB,KAAA;AACF,CAAA;AAUH,MAAM,MAAM,GAAGA,cAAK,CAAC,UAAU,CAC7B,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAC3E,GAAG,KACD;IACF,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ;AACtC,IAAA,QACEC,qBAAA,CAAC,IAAI,EAAA,EACH,SAAS,EAAE,EAAE,CACX,cAAc,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CACjE,EACD,GAAG,EAAE,GAAG,EAAA,GACJ,KAAK,EAAA,CACT;AAEN,CAAC;AAEH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","sources":["
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'bg-card text-card-foreground flex flex-col gap-6 rounded-[0.33em] border border-gray-300 py-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 self-start justify-self-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6 [.border-t]:pt-6', className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n};\n"],"names":["_jsx"],"mappings":";;;AAIA,SAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AAChE,IAAA,QACEA,qBAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,MAAM,EAChB,SAAS,EAAE,EAAE,CACX,+FAA+F,EAC/F,SAAS,CACV,EAAA,GACG,KAAK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,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,EAAA,GAC/D,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { CheckIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n onClick={(e) => e.stopPropagation()}\n className={cn(\n 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"flex items-center justify-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"names":["_jsx"],"mappings":";;;;;AAMA,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EAC4C,EAAA;IACpD,QACEA,qBAAA,CAAC,iBAAiB,CAAC,IAAI,iBACX,UAAU,EACpB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,EACnC,SAAS,EAAE,EAAE,CACX,4fAA4f,EAC5f,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAETA,qBAAA,CAAC,iBAAiB,CAAC,SAAS,EAAA,EAAA,WAAA,EAChB,oBAAoB,EAC9B,SAAS,EAAC,+DAA+D,EAAA,QAAA,EAEzEA,qBAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAC,UAAU,EAAA,CAAG,EAAA,CACN,EAAA,CACP;AAE7B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction DialogBottomSheet({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom fixed bottom-0 left-0 right-0 z-50 w-full rounded-t-xl border-t shadow-lg duration-300',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nexport {\n Dialog,\n DialogBottomSheet,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAMA,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C,EAAA;IAClD,OAAOA,qBAAA,CAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ,EAAA,GAAK,KAAK,EAAA,CAAI;AAC/D;AAEA,SAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EAC6C,EAAA;IACrD,OAAOA,qBAAA,CAAC,eAAe,CAAC,OAAO,iBAAW,gBAAgB,EAAA,GAAK,KAAK,EAAA,CAAI;AAC1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AAkP,EAClP,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAAA,CAER,QAAQ,EACR,eAAe,KACdA,sBAAA,CAAC,eAAe,CAAC,KAAK,EAAA,EAAA,WAAA,EACV,cAAc,EACxB,SAAS,EAAC,+RAA+R,EAAA,QAAA,EAAA,CAEzSD,qBAAA,CAAC,KAAK,EAAA,EAAA,CAAG,EACTA,qBAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,SAAS,EAAA,QAAA,EAAA,OAAA,EAAA,CAAa,CAAA,EAAA,CAChB,CACzB,CAAA,EAAA,CACuB,CAAA,EAAA,CACb;AAEnB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["
|
|
1
|
+
{"version":3,"file":"icons.js","sources":["../../../src/components/ui/icons.tsx"],"sourcesContent":["import {\n CircleCheck,\n XCircle,\n Clipboard,\n Briefcase,\n Users2,\n Globe,\n Wifi,\n GraduationCap,\n Clock,\n PhilippinePeso,\n} from 'lucide-react';\n\nexport const BooleanCheckIcon = ({ checked }: { checked?: boolean | null }) => {\n if (checked)\n return <CircleCheck className=\"w-[1.1em] h-[1.1em] mr-1\"></CircleCheck>;\n else return <XCircle className=\"w-[1.1em] h-[1.1em] mr-1\"></XCircle>;\n};\n\nexport const JobModeIcon = ({ mode }: { mode: number | null | undefined }) => {\n switch (mode) {\n case 0: // On site\n return <Users2 className=\"w-3 h-3 mr-1\" />;\n case 1: // Hybrid\n return <Globe className=\"w-3 h-3 mr-1\" />;\n case 2: // Remote\n return <Wifi className=\"w-3 h-3 mr-1\" />;\n }\n\n // Not specified\n return <Briefcase className=\"w-3 h-3 mr-1\" />;\n};\n\nexport const JobTypeIcon = ({ type }: { type: number | null | undefined }) => {\n switch (type) {\n case 0:\n return <GraduationCap className=\"w-3 h-3 mr-1\" />;\n case 1:\n return <Clock className=\"w-3 h-3 mr-1\" />;\n case 2:\n return <Briefcase className=\"w-3 h-3 mr-1\" />;\n }\n\n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B,IAAA,OAAOA,sBAAC,cAAc,EAAA,EAAC,SAAS,EAAC,cAAc,GAAG;AACpD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../../src/components/ui/input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(\n ({ className, type, disabled, ...props }, ref) => {\n const [passwordVisible, setPasswordVisible] = React.useState(false);\n\n if (type === 'password') {\n const Icon = passwordVisible ? EyeOff : Eye;\n\n return (\n <div className=\"relative\">\n <input\n type={passwordVisible ? 'text' : 'password'}\n className={cn(\n 'bg-background pointer-events-auto relative z-10 box-border flex h-8 min-h-8 max-h-8 w-full rounded-[0.33em] border border-gray-200 px-[0.75em] py-0 pr-10 text-base ring-0 focus:ring-transparent sm:text-sm',\n 'file:text-foreground placeholder:text-muted-foreground/40 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n ref={ref}\n disabled={disabled}\n {...props}\n />\n <button\n type=\"button\"\n className=\"text-muted-foreground hover:text-foreground absolute inset-y-0 right-0 z-20 flex w-10 items-center justify-center disabled:cursor-not-allowed disabled:opacity-50\"\n onClick={() => setPasswordVisible((current) => !current)}\n disabled={disabled}\n aria-label={passwordVisible ? 'Hide password' : 'Show password'}\n aria-pressed={passwordVisible}\n >\n <Icon className=\"h-4 w-4\" aria-hidden=\"true\" />\n </button>\n </div>\n );\n }\n\n return (\n <input\n type={type}\n className={cn(\n 'bg-background pointer-events-auto relative z-10 box-border flex h-8 min-h-8 max-h-8 w-full rounded-[0.33em] border border-gray-200 px-[0.75em] py-0 text-base ring-0 focus:ring-transparent sm:text-sm',\n 'file:text-foreground placeholder:text-muted-foreground/40 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n ref={ref}\n disabled={disabled}\n {...props}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAKA,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAC5B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC/C,IAAA,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AAEnE,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;QACvB,MAAM,IAAI,GAAG,eAAe,GAAG,MAAM,GAAG,GAAG;QAE3C,QACEA,gCAAK,SAAS,EAAC,UAAU,EAAA,QAAA,EAAA,CACvBC,qBAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAE,eAAe,GAAG,MAAM,GAAG,UAAU,EAC3C,SAAS,EAAE,EAAE,CACX,8MAA8M,EAC9M,sMAAsM,EACtM,SAAS,CACV,EACD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,KACd,KAAK,EAAA,CACT,EACFA,qBAAA,CAAA,QAAA,EAAA,EACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,mKAAmK,EAC7K,OAAO,EAAE,MAAM,kBAAkB,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,EACxD,QAAQ,EAAE,QAAQ,EAAA,YAAA,EACN,eAAe,GAAG,eAAe,GAAG,eAAe,EAAA,cAAA,EACjD,eAAe,EAAA,QAAA,EAE7BA,qBAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAC,SAAS,EAAA,aAAA,EAAa,MAAM,EAAA,CAAG,EAAA,CACxC,CAAA,EAAA,CACL;IAEV;AAEA,IAAA,QACEA,qBAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,wMAAwM,EACxM,sMAAsM,EACtM,SAAS,CACV,EACD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAAA,GACd,KAAK,EAAA,CACT;AAEN,CAAC;AAEH,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sources":["
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../../../src/components/ui/label.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/utils';\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"names":["_jsx"],"mappings":";;;;AAKA,SAAS,KAAK,CAAC,EACb,SAAS,EACT,GAAG,KAAK,EACyC,EAAA;IACjD,QACEA,sBAAC,cAAc,CAAC,IAAI,EAAA,EAAA,WAAA,EACR,OAAO,EACjB,SAAS,EAAE,EAAE,CACX,qNAAqN,EACrN,SAAS,CACV,KACG,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sources":["
|
|
1
|
+
{"version":3,"file":"popover.js","sources":["../../../src/components/ui/popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { cn } from '@/utils';\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nconst PopoverTrigger = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <PopoverPrimitive.Trigger\n ref={ref}\n className={className}\n data-slot=\"popover-trigger\"\n {...props}\n />\n));\nPopoverTrigger.displayName = PopoverPrimitive.Trigger.displayName;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-[0.33em] border p-4 shadow-md outline-hidden',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nconst PopoverAnchor = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Anchor>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>\n>(({ className, ...props }, ref) => (\n <PopoverPrimitive.Anchor\n ref={ref}\n data-slot=\"popover-anchor\"\n className={className}\n {...props}\n />\n));\nPopoverAnchor.displayName = PopoverPrimitive.Anchor.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n"],"names":["_jsx"],"mappings":";;;;;AAKA,SAAS,OAAO,CAAC,EACf,GAAG,KAAK,EAC2C,EAAA;IACnD,OAAOA,qBAAA,CAAC,gBAAgB,CAAC,IAAI,iBAAW,SAAS,EAAA,GAAK,KAAK,EAAA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
|
+
{"version":3,"file":"separator.js","sources":["../../../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '@/utils';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n"],"names":["_jsx"],"mappings":";;;;AAKA,SAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,IAAI,EACjB,GAAG,KAAK,EAC6C,EAAA;AACrD,IAAA,QACEA,qBAAA,CAAC,kBAAkB,CAAC,IAAI,EAAA,EAAA,WAAA,EACZ,WAAW,EACrB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACX,gKAAgK,EAChK,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.js","sources":["
|
|
1
|
+
{"version":3,"file":"skeleton.js","sources":["../../../src/components/ui/skeleton.tsx"],"sourcesContent":["import { cn } from '@/utils';\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn('bg-accent animate-pulse rounded-md', className)}\n {...props}\n />\n );\n}\n\nexport { Skeleton };\n"],"names":["_jsx"],"mappings":";;;AAEA,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B,EAAA;AACpE,IAAA,QACEA,qBAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,UAAU,EACpB,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,EAAA,GAC1D,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sources":["
|
|
1
|
+
{"version":3,"file":"switch.js","sources":["../../../src/components/ui/switch.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SwitchPrimitive from '@radix-ui/react-switch';\n\nimport { cn } from '@/utils';\n\nfunction Switch({\n className,\n ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n 'bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0',\n )}\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n"],"names":["_jsx"],"mappings":";;;;AAKA,SAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EAC0C,EAAA;AAClD,IAAA,QACEA,qBAAA,CAAC,eAAe,CAAC,IAAI,EAAA,EAAA,WAAA,EACT,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,2WAA2W,EAC3W,SAAS,CACV,EAAA,GACG,KAAK,EAAA,QAAA,EAETA,sBAAC,eAAe,CAAC,KAAK,EAAA,EAAA,WAAA,EACV,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,0QAA0Q,CAC3Q,EAAA,CACD,EAAA,CACmB;AAE3B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sources":["
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../../src/components/ui/table.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nfunction Table({ className, ...props }: React.ComponentProps<'table'>) {\n return (\n <div\n data-slot=\"table-container\"\n className=\"relative w-full overflow-x-auto [scrollbar-gutter:stable]\"\n >\n <table\n data-slot=\"table\"\n className={cn('w-full caption-bottom text-sm', className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn('[&_tr]:border-b', className)}\n {...props}\n />\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn('[&_tr:last-child]:border-0', className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n 'bg-muted/50 border-t font-medium [&>tr]:last:border-b-0',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n 'hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n 'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<'caption'>) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn('text-muted-foreground mt-4 text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n};\n"],"names":["_jsx"],"mappings":";;;AAIA,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC,EAAA;IACnE,QACEA,qBAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EACY,iBAAiB,EAC3B,SAAS,EAAC,2DAA2D,EAAA,QAAA,EAErEA,qBAAA,CAAA,OAAA,EAAA,EAAA,WAAA,EACY,OAAO,EACjB,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,EAAA,CACT,EAAA,CACE;AAEV;AAEA,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC,EAAA;AACzE,IAAA,QACEA,qBAAA,CAAA,OAAA,EAAA,EAAA,WAAA,EACY,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAA,GACvC,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC,EAAA;AACvE,IAAA,QACEA,qBAAA,CAAA,OAAA,EAAA,EAAA,WAAA,EACY,YAAY,EACtB,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,EAAA,GAClD,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC,EAAA;AACzE,IAAA,QACEA,qBAAA,CAAA,OAAA,EAAA,EAAA,WAAA,EACY,cAAc,EACxB,SAAS,EAAE,EAAE,CACX,yDAAyD,EACzD,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B,EAAA;AACnE,IAAA,QACEA,qBAAA,CAAA,IAAA,EAAA,EAAA,WAAA,EACY,WAAW,EACrB,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B,EAAA;AACpE,IAAA,QACEA,qBAAA,CAAA,IAAA,EAAA,EAAA,WAAA,EACY,YAAY,EACtB,SAAS,EAAE,EAAE,CACX,oJAAoJ,EACpJ,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B,EAAA;AACpE,IAAA,QACEA,qBAAA,CAAA,IAAA,EAAA,EAAA,WAAA,EACY,YAAY,EACtB,SAAS,EAAE,EAAE,CACX,wGAAwG,EACxG,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACwB,EAAA;AAChC,IAAA,QACEA,qBAAA,CAAA,SAAA,EAAA,EAAA,WAAA,EACY,eAAe,EACzB,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,EAAA,GAC1D,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sources":["
|
|
1
|
+
{"version":3,"file":"textarea.js","sources":["../../../src/components/ui/textarea.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nfunction Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n 'placeholder:text-muted-foreground/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-[0.33em] border border-gray-300 bg-transparent px-3 py-2 text-base shadow-xs ring-0 transition-[color,box-shadow] outline-none focus:border-gray-500 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n"],"names":["_jsx"],"mappings":";;;AAIA,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoC,EAAA;AACzE,IAAA,QACEA,qBAAA,CAAA,UAAA,EAAA,EAAA,WAAA,EACY,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,gaAAga,EACha,SAAS,CACV,EAAA,GACG,KAAK,EAAA,CACT;AAEN;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport { cn } from '@/utils';\n\nfunction TooltipProvider({\n delayDuration = 0,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...props}\n />\n );\n}\n\nfunction Tooltip({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n className,\n arrowClassName,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content> & {\n arrowClassName?: string;\n}) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-[0.15em] bg-gray-900 px-3 py-1.5 text-xs text-balance text-white',\n className,\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow\n width={10}\n height={5}\n className={cn('z-50 fill-gray-900', arrowClassName)}\n />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"names":["_jsx","_jsxs"],"mappings":";;;;AAKA,SAAS,eAAe,CAAC,EACvB,aAAa,GAAG,CAAC,EACjB,GAAG,KAAK,EAC+C,EAAA;AACvD,IAAA,QACEA,qBAAA,CAAC,gBAAgB,CAAC,QAAQ,EAAA,EAAA,WAAA,EACd,kBAAkB,EAC5B,aAAa,EAAE,aAAa,EAAA,GACxB,KAAK,EAAA,CACT;AAEN;AAEA,SAAS,OAAO,CAAC,EACf,GAAG,KAAK,EAC2C,EAAA;AACnD,IAAA,QACEA,qBAAA,CAAC,eAAe,EAAA,EAAA,QAAA,EACdA,sBAAC,gBAAgB,CAAC,IAAI,EAAA,EAAA,WAAA,EAAW,SAAS,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CACxC;AAEtB;AAEA,SAAS,cAAc,CAAC,EACtB,GAAG,KAAK,EAC8C,EAAA;IACtD,OAAOA,qBAAA,CAAC,gBAAgB,CAAC,OAAO,iBAAW,iBAAiB,EAAA,GAAK,KAAK,EAAA,CAAI;AAC5E;AAEA,SAAS,cAAc,CAAC,EACtB,SAAS,EACT,cAAc,EACd,UAAU,GAAG,CAAC,EACd,QAAQ,EACR,GAAG,KAAK,EAGT,EAAA;IACC,QACEA,qBAAA,CAAC,gBAAgB,CAAC,MAAM,cACtBC,sBAAA,CAAC,gBAAgB,CAAC,OAAO,EAAA,EAAA,WAAA,EACb,iBAAiB,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,EAAE,CACX,kaAAka,EACla,SAAS,CACV,EAAA,GACG,KAAK,aAER,QAAQ,EACTD,qBAAA,CAAC,gBAAgB,CAAC,KAAK,EAAA,EACrB,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,cAAc,CAAC,EAAA,CACnD,CAAA,EAAA,CACuB,EAAA,CACH;AAE9B;;;;"}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../src/config.tsx"],"sourcesContent":["interface PackageConfig {\r\n\torchestratorApi: string;\r\n}\r\n\r\nexport let config: PackageConfig = {\r\n orchestratorApi: 'https://orca.betterinternship.com/process',\r\n}; \r\n\r\nexport const configure = (newConfig: PackageConfig) => {\r\n\tconfig = { ...config, ...newConfig }\r\n}"],"names":[],"mappings":"AAIO,IAAI,MAAM,GAAkB;AACjC,IAAA,eAAe,EAAE,2CAA2C;;AAGvD,MAAM,SAAS,GAAG,CAAC,SAAwB,KAAI;IACrD,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE;AACrC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClientProcess.js","sources":["../../../src/hooks/useClientProcess.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useRef, createContext, useContext, useEffect } from 'react';\nimport { Query, useQueries, useQueryClient } from '@tanstack/react-query';\nimport { config } from '../config';\n\ntype ProcessStatus = 'pending' | 'handled' | 'failed';\n\ninterface Process<T> {\n id: string;\n name: string;\n status: ProcessStatus;\n result?: T;\n error?: string;\n timestamp: string;\n}\n\ninterface ClientProcess<T> {\n dto?: ProcessCallbackDto;\n metadata?: ClientProcessMetadata;\n options?: ClientProcessOptions;\n result?: T;\n success?: boolean;\n pending?: boolean;\n error?: string;\n}\n\nexport interface ProcessCallbackDto {\n processId: string;\n processName: string;\n processCallbackUrl: string;\n}\n\nexport interface ClientProcessOptions {\n onLoading?: (processId: string, processName: string) => void;\n onSuccess?: <R>(processId: string, processName: string, result: R) => void;\n onFailure?: (processId: string, processName: string, error?: string) => void;\n}\n\nexport interface ClientProcessMetadata {\n filterKey: string;\n metadata?: Record<string, string>;\n}\n\nexport interface ProcessResponse {\n processId: string;\n processName: string;\n processCallbackUrl: string;\n success: boolean;\n message?: string;\n}\n\n/**\n * The orchestrator service to get the process from.\n *\n * @param processId\n * @returns\n */\nconst processStatusChecker = <T,>(processId: string) => {\n if (!processId) return { process: null };\n return fetch(`${config.orchestratorApi}/${encodeURIComponent(processId)}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((response) => response.json()) as unknown as Promise<{\n process: Omit<Process<T>, 'result'>;\n }>;\n};\n\n/**\n * This fetches from the callback endpoint.\n *\n * @param processId\n * @returns\n */\nconst processCallbackResultFetcher = <T,>(\n processId: string,\n processName: string,\n processCallbackUrl?: string,\n) =>\n fetch(`${processCallbackUrl}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n processId,\n processName,\n }),\n }).then((response) => response.json()) as unknown as Promise<T>;\n\ninterface ClientProcesses {\n registerProcess: (\n processId: string,\n dto: ProcessCallbackDto,\n metadata: ClientProcessMetadata,\n options?: ClientProcessOptions,\n ) => void;\n getProcess: <T>(processId: string) => ClientProcess<T> | null;\n filterProcesses: <T>(filter: string) => ClientProcess<T>[];\n invalidateBasedOnResult: <R>(\n filter: string,\n invalidator?: (result: R) => boolean,\n ) => Promise<void>;\n}\n\n/**\n * We need a context to keep track of all client processes.\n * This helps us manage the state of the toasts as well.\n */\nconst clientProcessesContext = createContext<ClientProcesses>(\n {} as ClientProcesses,\n);\n\n/**\n * This should be at the root layout.\n *\n * @context\n */\nexport const ClientProcessesProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const queryClient = useQueryClient();\n const clientProcessAttempts = useRef<Record<string, number>>({});\n const [clientProcessDtos, setClientProcessDtos] = useState<\n Record<\n string,\n {\n dto: ProcessCallbackDto;\n metadata: ClientProcessMetadata;\n options?: ClientProcessOptions;\n }\n >\n >({});\n\n // Populates the state object with cached data on mount\n useEffect(() => {\n setClientProcessDtos((oldData) => {\n if (Object.keys(oldData).length > 0) return oldData;\n\n const cachedClientProcesses = queryClient\n .getQueryCache()\n .findAll({ queryKey: ['.__process'], exact: false });\n const seededClientProcesses: typeof oldData = {};\n\n for (const query of cachedClientProcesses) {\n const processId = query.queryKey[2];\n if (typeof processId !== 'string') continue;\n\n const data = query.state.data as ClientProcess<any>;\n if (!data?.dto || !data?.metadata) continue;\n\n seededClientProcesses[processId] = {\n dto: data.dto,\n metadata: data.metadata,\n options: data.options,\n };\n }\n\n return { ...oldData, ...seededClientProcesses };\n });\n }, [queryClient]);\n\n // The query for all the processes, pending and sht\n const clientProcesses = useQueries({\n queries: Object.entries(clientProcessDtos).map(\n ([processId, { dto, metadata, options }]) => ({\n staleTime: Infinity,\n gcTime: 3 * 60 * 1000,\n refetchOnWindowFocus: true,\n refetchIntervalInBackground: true,\n refetchOnMount: true,\n refetchOnReconnect: true,\n queryKey: ['.__process', metadata.filterKey, processId],\n queryFn: async () => {\n if (!processId) throw new Error('No processId');\n const { process } = await processStatusChecker(processId);\n\n // Handled! Return the proper response too\n if (process?.status === 'handled') {\n const result = await processCallbackResultFetcher(\n process.id,\n process.name,\n dto.processCallbackUrl,\n );\n\n // Log and call runner\n console.warn(`Handled ${process.name} (${process.id})!`);\n options?.onSuccess?.(process.id, process.name, result);\n\n return {\n dto,\n metadata,\n options,\n success: true,\n pending: false,\n result,\n };\n }\n\n // Pending or failed\n if (process?.status === 'pending') {\n console.log(`Running process ${process.name} (${process.id})...`);\n options?.onLoading?.(process.id, process.name);\n return { dto, metadata, options, pending: true };\n } else if (process?.status === 'failed') {\n console.error(\n `Failed ${process.name} (${process.id}) - ${process.error}.`,\n );\n\n return {\n dto,\n metadata,\n options,\n success: false,\n pending: false,\n error: process.error,\n };\n }\n\n // Return null since no response\n return { dto, metadata, options, pending: true };\n },\n\n // Returns the next interval length to use to wait for fetch\n refetchInterval: <T,>(query: Query) => {\n const data = query.state.data as ClientProcess<T>;\n if (data?.success !== undefined) return false;\n\n // If not defined, init to 0\n if (!clientProcessAttempts.current[processId])\n clientProcessAttempts.current[processId] = 0;\n\n const interval = Math.min(\n 500 * 2 ** clientProcessAttempts.current[processId],\n 10000,\n );\n\n clientProcessAttempts.current[processId] += 1;\n return interval;\n },\n }),\n ),\n });\n\n /**\n * Registers a new process to handle\n *\n * @param processId\n * @param processCallbackDto\n * @param options\n */\n const registerProcess = (\n processId: string,\n processCallbackDto: ProcessCallbackDto,\n metadata: ClientProcessMetadata,\n options?: ClientProcessOptions,\n ) => {\n setClientProcessDtos({\n ...clientProcessDtos,\n [processId]: { dto: processCallbackDto, metadata, options },\n });\n };\n\n /**\n * Retrieves a process\n *\n * @param processId\n * @returns\n */\n const getProcess = <T,>(processId: string) => {\n const clientProcess =\n clientProcesses.find(\n (clientProcess) => clientProcess.data?.dto?.processId === processId,\n )?.data ?? null;\n\n return (clientProcess as ClientProcess<T>) ?? null;\n };\n\n /**\n * Filters processes by the provided attribute.\n *\n * @param filterKey\n */\n const filterProcesses = <T,>(filterKey: string) => {\n return clientProcesses\n .filter((clientProcess) => !!clientProcess.data?.dto)\n .map((clientProcess) => clientProcess.data)\n .filter(\n (clientProcessData) =>\n clientProcessData?.metadata.filterKey === filterKey,\n ) as ClientProcess<T>[];\n };\n\n /**\n * Refreshes the cache and invalidates all related processes.\n */\n const invalidateBasedOnResult = async <R,>(\n filter: string,\n invalidator?: (result: R) => boolean,\n ) => {\n await queryClient.invalidateQueries({\n queryKey: ['.__process', filter],\n exact: false,\n });\n\n const cachedClientProcesses = queryClient\n .getQueryCache()\n .findAll({ queryKey: ['.__process', filter], exact: false });\n\n for (const query of cachedClientProcesses) {\n const processId = query.queryKey[2];\n if (typeof processId !== 'string') continue;\n\n const data = query.state.data as ClientProcess<any>;\n if (!data.result) continue;\n\n // If invalidator says we gotta clear the cache, we clear it\n if (invalidator && invalidator?.(data.result as R)) {\n queryClient.removeQueries({ queryKey: query.queryKey });\n }\n }\n };\n\n return (\n <clientProcessesContext.Provider\n value={{\n registerProcess,\n getProcess,\n filterProcesses,\n invalidateBasedOnResult,\n }}\n >\n {children}\n </clientProcessesContext.Provider>\n );\n};\n\n/**\n * A simpler version, where u just pass the async function that returns process data.\n *\n * @param caller\n * @returns\n */\nexport function useClientProcess<T, R>({\n caller,\n invalidator,\n filterKey,\n onLoading,\n onSuccess,\n onFailure,\n}: {\n caller?: (inputs: T) => Promise<ProcessResponse>;\n invalidator?: (result: R) => boolean;\n filterKey: string;\n onLoading?: (processId: string, processName: string) => void;\n onSuccess?: <R>(processId: string, processName: string, result: R) => void;\n onFailure?: (processId: string, processName: string, error?: string) => void;\n}) {\n const clientProcessesApi = useContext(clientProcessesContext);\n\n // Note that the exposed function doesn't return process ids\n // Client should be oblivious to those\n // Abstraction BABY!\n const wrappedCaller = async (\n inputs: T,\n metadata?: Record<string, string>,\n ) => {\n const response = await caller?.(inputs);\n if (response) {\n clientProcessesApi.registerProcess(\n response.processId,\n response,\n { filterKey, metadata },\n {\n onLoading,\n onSuccess,\n onFailure,\n },\n );\n\n return {\n id: response.processId,\n success: response.success,\n message: response.message,\n };\n }\n\n return {\n id: null,\n success: false,\n message: 'No `caller` specified for useClientProcess().',\n };\n };\n\n return {\n run: wrappedCaller,\n get: (id: string) => clientProcessesApi.getProcess(id),\n getAll: () => clientProcessesApi.filterProcesses(filterKey),\n getAllPending: () =>\n clientProcessesApi\n .filterProcesses(filterKey)\n .filter((process) => process.pending),\n getAllHandled: () =>\n clientProcessesApi\n .filterProcesses(filterKey)\n .filter((process) => process.success),\n getAllFailed: () =>\n clientProcessesApi\n .filterProcesses(filterKey)\n .filter((process) => !process.success),\n refreshCache: () =>\n clientProcessesApi.invalidateBasedOnResult(filterKey, invalidator),\n };\n}\n"],"names":[],"mappings":";;;;;;AAoDA;;;;;AAKG;AACH;AACE;AAAgB;AAChB;AACE;AACA;AACE;AACD;AACF;AAGH;AAEA;;;;;AAKG;AACH;AAMI;AACA;AACE;AACD;AACD;;;;AAID;AAiBH;;;AAGG;AACH;AAIA;;;;AAIG;;AAMD;AACA;;;;AAcE;;AACuC;;AAGlC;AACA;;AAGH;;;;AAIE;;;;;;;;;AAUF;AACF;AACF;;;;AAMM;AACA;AACA;AACA;AACA;AACA;;;AAGE;AAAgB;;;AAIhB;AACE;;AAOA;AACA;;;;;AAME;AACA;;;;;AAMJ;AACE;AACA;;;AAEK;AACL;;;;;AAQE;AACA;;;;;;;;AAUN;AACE;AACA;AAAiC;;AAGjC;AACE;AAEF;AAKA;AACA;;AAEH;AAEJ;AAED;;;;;;AAMG;;AAOD;AACE;;AAED;AACH;AAEA;;;;;AAKG;AACH;;;AAOA;AAEA;;;;AAIG;AACH;AACE;AACG;;AAEA;AAIL;AAEA;;AAEG;;;AAMC;AACA;AACD;;AAGE;AACA;AAEH;;;;AAIE;;;;;;;;AAQJ;AAEA;;;;;;AAYF;AAEA;;;;;AAKG;AACG;AAeJ;;;;;;;AAWI;;;;AAQG;;;;;;;;AAWH;AACA;AACA;;AAEJ;;AAGE;;;AAGA;;;AAIA;;;AAIA;;;;;AAOJ;;"}
|
|
1
|
+
{"version":3,"file":"useClientProcess.js","sources":["../../src/hooks/useClientProcess.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useRef, createContext, useContext, useEffect } from 'react';\nimport { Query, useQueries, useQueryClient } from '@tanstack/react-query';\nimport { config } from '../config';\n\ntype ProcessStatus = 'pending' | 'handled' | 'failed';\n\ninterface Process<T> {\n id: string;\n name: string;\n status: ProcessStatus;\n result?: T;\n error?: string;\n timestamp: string;\n}\n\ninterface ClientProcess<T> {\n dto?: ProcessCallbackDto;\n metadata?: ClientProcessMetadata;\n options?: ClientProcessOptions;\n result?: T;\n success?: boolean;\n pending?: boolean;\n error?: string;\n}\n\nexport interface ProcessCallbackDto {\n processId: string;\n processName: string;\n processCallbackUrl: string;\n}\n\nexport interface ClientProcessOptions {\n onLoading?: (processId: string, processName: string) => void;\n onSuccess?: <R>(processId: string, processName: string, result: R) => void;\n onFailure?: (processId: string, processName: string, error?: string) => void;\n}\n\nexport interface ClientProcessMetadata {\n filterKey: string;\n metadata?: Record<string, string>;\n}\n\nexport interface ProcessResponse {\n processId: string;\n processName: string;\n processCallbackUrl: string;\n success: boolean;\n message?: string;\n}\n\n/**\n * The orchestrator service to get the process from.\n *\n * @param processId\n * @returns\n */\nconst processStatusChecker = <T,>(processId: string) => {\n if (!processId) return { process: null };\n return fetch(`${config.orchestratorApi}/${encodeURIComponent(processId)}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n }).then((response) => response.json()) as unknown as Promise<{\n process: Omit<Process<T>, 'result'>;\n }>;\n};\n\n/**\n * This fetches from the callback endpoint.\n *\n * @param processId\n * @returns\n */\nconst processCallbackResultFetcher = <T,>(\n processId: string,\n processName: string,\n processCallbackUrl?: string,\n) =>\n fetch(`${processCallbackUrl}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n processId,\n processName,\n }),\n }).then((response) => response.json()) as unknown as Promise<T>;\n\ninterface ClientProcesses {\n registerProcess: (\n processId: string,\n dto: ProcessCallbackDto,\n metadata: ClientProcessMetadata,\n options?: ClientProcessOptions,\n ) => void;\n getProcess: <T>(processId: string) => ClientProcess<T> | null;\n filterProcesses: <T>(filter: string) => ClientProcess<T>[];\n invalidateBasedOnResult: <R>(\n filter: string,\n invalidator?: (result: R) => boolean,\n ) => Promise<void>;\n}\n\n/**\n * We need a context to keep track of all client processes.\n * This helps us manage the state of the toasts as well.\n */\nconst clientProcessesContext = createContext<ClientProcesses>(\n {} as ClientProcesses,\n);\n\n/**\n * This should be at the root layout.\n *\n * @context\n */\nexport const ClientProcessesProvider = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const queryClient = useQueryClient();\n const clientProcessAttempts = useRef<Record<string, number>>({});\n const [clientProcessDtos, setClientProcessDtos] = useState<\n Record<\n string,\n {\n dto: ProcessCallbackDto;\n metadata: ClientProcessMetadata;\n options?: ClientProcessOptions;\n }\n >\n >({});\n\n // Populates the state object with cached data on mount\n useEffect(() => {\n setClientProcessDtos((oldData) => {\n if (Object.keys(oldData).length > 0) return oldData;\n\n const cachedClientProcesses = queryClient\n .getQueryCache()\n .findAll({ queryKey: ['.__process'], exact: false });\n const seededClientProcesses: typeof oldData = {};\n\n for (const query of cachedClientProcesses) {\n const processId = query.queryKey[2];\n if (typeof processId !== 'string') continue;\n\n const data = query.state.data as ClientProcess<any>;\n if (!data?.dto || !data?.metadata) continue;\n\n seededClientProcesses[processId] = {\n dto: data.dto,\n metadata: data.metadata,\n options: data.options,\n };\n }\n\n return { ...oldData, ...seededClientProcesses };\n });\n }, [queryClient]);\n\n // The query for all the processes, pending and sht\n const clientProcesses = useQueries({\n queries: Object.entries(clientProcessDtos).map(\n ([processId, { dto, metadata, options }]) => ({\n staleTime: Infinity,\n gcTime: 3 * 60 * 1000,\n refetchOnWindowFocus: true,\n refetchIntervalInBackground: true,\n refetchOnMount: true,\n refetchOnReconnect: true,\n queryKey: ['.__process', metadata.filterKey, processId],\n queryFn: async () => {\n if (!processId) throw new Error('No processId');\n const { process } = await processStatusChecker(processId);\n\n // Handled! Return the proper response too\n if (process?.status === 'handled') {\n const result = await processCallbackResultFetcher(\n process.id,\n process.name,\n dto.processCallbackUrl,\n );\n\n // Log and call runner\n console.warn(`Handled ${process.name} (${process.id})!`);\n options?.onSuccess?.(process.id, process.name, result);\n\n return {\n dto,\n metadata,\n options,\n success: true,\n pending: false,\n result,\n };\n }\n\n // Pending or failed\n if (process?.status === 'pending') {\n console.log(`Running process ${process.name} (${process.id})...`);\n options?.onLoading?.(process.id, process.name);\n return { dto, metadata, options, pending: true };\n } else if (process?.status === 'failed') {\n console.error(\n `Failed ${process.name} (${process.id}) - ${process.error}.`,\n );\n\n return {\n dto,\n metadata,\n options,\n success: false,\n pending: false,\n error: process.error,\n };\n }\n\n // Return null since no response\n return { dto, metadata, options, pending: true };\n },\n\n // Returns the next interval length to use to wait for fetch\n refetchInterval: <T,>(query: Query) => {\n const data = query.state.data as ClientProcess<T>;\n if (data?.success !== undefined) return false;\n\n // If not defined, init to 0\n if (!clientProcessAttempts.current[processId])\n clientProcessAttempts.current[processId] = 0;\n\n const interval = Math.min(\n 500 * 2 ** clientProcessAttempts.current[processId],\n 10000,\n );\n\n clientProcessAttempts.current[processId] += 1;\n return interval;\n },\n }),\n ),\n });\n\n /**\n * Registers a new process to handle\n *\n * @param processId\n * @param processCallbackDto\n * @param options\n */\n const registerProcess = (\n processId: string,\n processCallbackDto: ProcessCallbackDto,\n metadata: ClientProcessMetadata,\n options?: ClientProcessOptions,\n ) => {\n setClientProcessDtos({\n ...clientProcessDtos,\n [processId]: { dto: processCallbackDto, metadata, options },\n });\n };\n\n /**\n * Retrieves a process\n *\n * @param processId\n * @returns\n */\n const getProcess = <T,>(processId: string) => {\n const clientProcess =\n clientProcesses.find(\n (clientProcess) => clientProcess.data?.dto?.processId === processId,\n )?.data ?? null;\n\n return (clientProcess as ClientProcess<T>) ?? null;\n };\n\n /**\n * Filters processes by the provided attribute.\n *\n * @param filterKey\n */\n const filterProcesses = <T,>(filterKey: string) => {\n return clientProcesses\n .filter((clientProcess) => !!clientProcess.data?.dto)\n .map((clientProcess) => clientProcess.data)\n .filter(\n (clientProcessData) =>\n clientProcessData?.metadata.filterKey === filterKey,\n ) as ClientProcess<T>[];\n };\n\n /**\n * Refreshes the cache and invalidates all related processes.\n */\n const invalidateBasedOnResult = async <R,>(\n filter: string,\n invalidator?: (result: R) => boolean,\n ) => {\n await queryClient.invalidateQueries({\n queryKey: ['.__process', filter],\n exact: false,\n });\n\n const cachedClientProcesses = queryClient\n .getQueryCache()\n .findAll({ queryKey: ['.__process', filter], exact: false });\n\n for (const query of cachedClientProcesses) {\n const processId = query.queryKey[2];\n if (typeof processId !== 'string') continue;\n\n const data = query.state.data as ClientProcess<any>;\n if (!data.result) continue;\n\n // If invalidator says we gotta clear the cache, we clear it\n if (invalidator && invalidator?.(data.result as R)) {\n queryClient.removeQueries({ queryKey: query.queryKey });\n }\n }\n };\n\n return (\n <clientProcessesContext.Provider\n value={{\n registerProcess,\n getProcess,\n filterProcesses,\n invalidateBasedOnResult,\n }}\n >\n {children}\n </clientProcessesContext.Provider>\n );\n};\n\n/**\n * A simpler version, where u just pass the async function that returns process data.\n *\n * @param caller\n * @returns\n */\nexport function useClientProcess<T, R>({\n caller,\n invalidator,\n filterKey,\n onLoading,\n onSuccess,\n onFailure,\n}: {\n caller?: (inputs: T) => Promise<ProcessResponse>;\n invalidator?: (result: R) => boolean;\n filterKey: string;\n onLoading?: (processId: string, processName: string) => void;\n onSuccess?: <R>(processId: string, processName: string, result: R) => void;\n onFailure?: (processId: string, processName: string, error?: string) => void;\n}) {\n const clientProcessesApi = useContext(clientProcessesContext);\n\n // Note that the exposed function doesn't return process ids\n // Client should be oblivious to those\n // Abstraction BABY!\n const wrappedCaller = async (\n inputs: T,\n metadata?: Record<string, string>,\n ) => {\n const response = await caller?.(inputs);\n if (response) {\n clientProcessesApi.registerProcess(\n response.processId,\n response,\n { filterKey, metadata },\n {\n onLoading,\n onSuccess,\n onFailure,\n },\n );\n\n return {\n id: response.processId,\n success: response.success,\n message: response.message,\n };\n }\n\n return {\n id: null,\n success: false,\n message: 'No `caller` specified for useClientProcess().',\n };\n };\n\n return {\n run: wrappedCaller,\n get: (id: string) => clientProcessesApi.getProcess(id),\n getAll: () => clientProcessesApi.filterProcesses(filterKey),\n getAllPending: () =>\n clientProcessesApi\n .filterProcesses(filterKey)\n .filter((process) => process.pending),\n getAllHandled: () =>\n clientProcessesApi\n .filterProcesses(filterKey)\n .filter((process) => process.success),\n getAllFailed: () =>\n clientProcessesApi\n .filterProcesses(filterKey)\n .filter((process) => !process.success),\n refreshCache: () =>\n clientProcessesApi.invalidateBasedOnResult(filterKey, invalidator),\n };\n}\n"],"names":[],"mappings":";;;;;;AAoDA;;;;;AAKG;AACH;AACE;AAAgB;AAChB;AACE;AACA;AACE;AACD;AACF;AAGH;AAEA;;;;;AAKG;AACH;AAMI;AACA;AACE;AACD;AACD;;;;AAID;AAiBH;;;AAGG;AACH;AAIA;;;;AAIG;;AAMD;AACA;;;;AAcE;;AACuC;;AAGlC;AACA;;AAGH;;;;AAIE;;;;;;;;;AAUF;AACF;AACF;;;;AAMM;AACA;AACA;AACA;AACA;AACA;;;AAGE;AAAgB;;;AAIhB;AACE;;AAOA;AACA;;;;;AAME;AACA;;;;;AAMJ;AACE;AACA;;;AAEK;AACL;;;;;AAQE;AACA;;;;;;;;AAUN;AACE;AACA;AAAiC;;AAGjC;AACE;AAEF;AAKA;AACA;;AAEH;AAEJ;AAED;;;;;;AAMG;;AAOD;AACE;;AAED;AACH;AAEA;;;;;AAKG;AACH;;;AAOA;AAEA;;;;AAIG;AACH;AACE;AACG;;AAEA;AAIL;AAEA;;AAEG;;;AAMC;AACA;AACD;;AAGE;AACA;AAEH;;;;AAIE;;;;;;;;AAQJ;AAEA;;;;;;AAYF;AAEA;;;;;AAKG;AACG;AAeJ;;;;;;;AAWI;;;;AAQG;;;;;;;;AAWH;AACA;AACA;;AAEJ;;AAGE;;;AAGA;;;AAIA;;;AAIA;;;;;AAOJ;;"}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs));\r\n}"],"names":[],"mappings":";;;AAGM,SAAU,EAAE,CAAC,GAAG,MAAoB,EAAA;AACxC,IAAA,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B;;;;"}
|
package/package.json
CHANGED
|
@@ -1,228 +1,230 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@betterinternship/components",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"module": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "rollup -c && tsc-alias",
|
|
9
|
-
"test": "vitest run",
|
|
10
|
-
"test:watch": "vitest",
|
|
11
|
-
"prepare": "npm run build"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
"@radix-ui/react-
|
|
110
|
-
"@radix-ui/react-
|
|
111
|
-
"@radix-ui/react-
|
|
112
|
-
"@radix-ui/react-
|
|
113
|
-
"@radix-ui/react-
|
|
114
|
-
"@radix-ui/react-
|
|
115
|
-
"@radix-ui/react-
|
|
116
|
-
"@radix-ui/react-
|
|
117
|
-
"@radix-ui/react-
|
|
118
|
-
"@radix-ui/react-
|
|
119
|
-
"@radix-ui/react-
|
|
120
|
-
"@radix-ui/react-
|
|
121
|
-
"@radix-ui/react-
|
|
122
|
-
"@radix-ui/react-
|
|
123
|
-
"@radix-ui/react-
|
|
124
|
-
"@radix-ui/react-
|
|
125
|
-
"@radix-ui/react-
|
|
126
|
-
"@radix-ui/react-
|
|
127
|
-
"@radix-ui/react-
|
|
128
|
-
"@radix-ui/react-
|
|
129
|
-
"@radix-ui/react-
|
|
130
|
-
"@radix-ui/react-
|
|
131
|
-
"@radix-ui/react-
|
|
132
|
-
"@radix-ui/react-
|
|
133
|
-
"@radix-ui/react-toggle
|
|
134
|
-
"@radix-ui/react-
|
|
135
|
-
"@
|
|
136
|
-
"
|
|
137
|
-
"react": "
|
|
138
|
-
"react
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"@eslint/
|
|
158
|
-
"@
|
|
159
|
-
"@radix-ui/react-
|
|
160
|
-
"@radix-ui/react-
|
|
161
|
-
"@radix-ui/react-
|
|
162
|
-
"@radix-ui/react-
|
|
163
|
-
"@radix-ui/react-
|
|
164
|
-
"@radix-ui/react-
|
|
165
|
-
"@radix-ui/react-
|
|
166
|
-
"@radix-ui/react-
|
|
167
|
-
"@radix-ui/react-
|
|
168
|
-
"@radix-ui/react-
|
|
169
|
-
"@radix-ui/react-
|
|
170
|
-
"@radix-ui/react-
|
|
171
|
-
"@radix-ui/react-
|
|
172
|
-
"@radix-ui/react-
|
|
173
|
-
"@radix-ui/react-
|
|
174
|
-
"@radix-ui/react-
|
|
175
|
-
"@radix-ui/react-
|
|
176
|
-
"@radix-ui/react-
|
|
177
|
-
"@radix-ui/react-
|
|
178
|
-
"@radix-ui/react-
|
|
179
|
-
"@radix-ui/react-
|
|
180
|
-
"@radix-ui/react-
|
|
181
|
-
"@radix-ui/react-
|
|
182
|
-
"@radix-ui/react-
|
|
183
|
-
"@radix-ui/react-toggle
|
|
184
|
-
"@radix-ui/react-
|
|
185
|
-
"@
|
|
186
|
-
"@rollup/plugin-
|
|
187
|
-
"@rollup/plugin-
|
|
188
|
-
"@
|
|
189
|
-
"@
|
|
190
|
-
"@testing-library/
|
|
191
|
-
"@testing-library/
|
|
192
|
-
"@
|
|
193
|
-
"
|
|
194
|
-
"
|
|
195
|
-
"esbuild-
|
|
196
|
-
"
|
|
197
|
-
"eslint
|
|
198
|
-
"eslint-
|
|
199
|
-
"
|
|
200
|
-
"
|
|
201
|
-
"postcss
|
|
202
|
-
"
|
|
203
|
-
"
|
|
204
|
-
"react
|
|
205
|
-
"
|
|
206
|
-
"rollup
|
|
207
|
-
"rollup-plugin-
|
|
208
|
-
"rollup-plugin-
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
"
|
|
213
|
-
"
|
|
214
|
-
"typescript
|
|
215
|
-
"
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@betterinternship/components",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rollup -c && tsc-alias",
|
|
9
|
+
"test": "vitest run",
|
|
10
|
+
"test:watch": "vitest",
|
|
11
|
+
"prepare": "npm run build",
|
|
12
|
+
"dev:playground": "npm --prefix playground run dev"
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./button": {
|
|
23
|
+
"import": "./dist/components/ui/button.js",
|
|
24
|
+
"types": "./dist/components/ui/button.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./accordion": {
|
|
27
|
+
"import": "./dist/components/ui/accordion.js",
|
|
28
|
+
"types": "./dist/components/ui/accordion.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./calendar": {
|
|
31
|
+
"import": "./dist/components/ui/calendar.js",
|
|
32
|
+
"types": "./dist/components/ui/calendar.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./input": {
|
|
35
|
+
"import": "./dist/components/ui/input.js",
|
|
36
|
+
"types": "./dist/components/ui/input.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./icons": {
|
|
39
|
+
"import": "./dist/components/ui/icons.js",
|
|
40
|
+
"types": "./dist/components/ui/icons.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./avatar": {
|
|
43
|
+
"import": "./dist/components/ui/avatar.js",
|
|
44
|
+
"types": "./dist/components/ui/avatar.d.ts"
|
|
45
|
+
},
|
|
46
|
+
"./badge": {
|
|
47
|
+
"import": "./dist/components/ui/badge.js",
|
|
48
|
+
"types": "./dist/components/ui/badge.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./card": {
|
|
51
|
+
"import": "./dist/components/ui/card.js",
|
|
52
|
+
"types": "./dist/components/ui/card.d.ts"
|
|
53
|
+
},
|
|
54
|
+
"./checkbox": {
|
|
55
|
+
"import": "./dist/components/ui/checkbox.js",
|
|
56
|
+
"types": "./dist/components/ui/checkbox.d.ts"
|
|
57
|
+
},
|
|
58
|
+
"./dialog": {
|
|
59
|
+
"import": "./dist/components/ui/dialog.js",
|
|
60
|
+
"types": "./dist/components/ui/dialog.d.ts"
|
|
61
|
+
},
|
|
62
|
+
"./label": {
|
|
63
|
+
"import": "./dist/components/ui/label.js",
|
|
64
|
+
"types": "./dist/components/ui/label.d.ts"
|
|
65
|
+
},
|
|
66
|
+
"./popover": {
|
|
67
|
+
"import": "./dist/components/ui/popover.js",
|
|
68
|
+
"types": "./dist/components/ui/popover.d.ts"
|
|
69
|
+
},
|
|
70
|
+
"./separator": {
|
|
71
|
+
"import": "./dist/components/ui/separator.js",
|
|
72
|
+
"types": "./dist/components/ui/separator.d.ts"
|
|
73
|
+
},
|
|
74
|
+
"./skeleton": {
|
|
75
|
+
"import": "./dist/components/ui/skeleton.js",
|
|
76
|
+
"types": "./dist/components/ui/skeleton.d.ts"
|
|
77
|
+
},
|
|
78
|
+
"./switch": {
|
|
79
|
+
"import": "./dist/components/ui/switch.js",
|
|
80
|
+
"types": "./dist/components/ui/switch.d.ts"
|
|
81
|
+
},
|
|
82
|
+
"./table": {
|
|
83
|
+
"import": "./dist/components/ui/table.js",
|
|
84
|
+
"types": "./dist/components/ui/table.d.ts"
|
|
85
|
+
},
|
|
86
|
+
"./textarea": {
|
|
87
|
+
"import": "./dist/components/ui/textarea.js",
|
|
88
|
+
"types": "./dist/components/ui/textarea.d.ts"
|
|
89
|
+
},
|
|
90
|
+
"./tooltip": {
|
|
91
|
+
"import": "./dist/components/ui/tooltip.js",
|
|
92
|
+
"types": "./dist/components/ui/tooltip.d.ts"
|
|
93
|
+
},
|
|
94
|
+
"./theme.css": "./theme.css"
|
|
95
|
+
},
|
|
96
|
+
"repository": {
|
|
97
|
+
"type": "git",
|
|
98
|
+
"url": "git+https://github.com/BetterInternship/Components.git"
|
|
99
|
+
},
|
|
100
|
+
"keywords": [],
|
|
101
|
+
"author": "",
|
|
102
|
+
"license": "ISC",
|
|
103
|
+
"bugs": {
|
|
104
|
+
"url": "https://github.com/BetterInternship/Components/issues"
|
|
105
|
+
},
|
|
106
|
+
"homepage": "https://github.com/BetterInternship/Components#readme",
|
|
107
|
+
"description": "",
|
|
108
|
+
"peerDependencies": {
|
|
109
|
+
"@radix-ui/react-accordion": "^1.2.11",
|
|
110
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
111
|
+
"@radix-ui/react-aspect-ratio": "^1.1.1",
|
|
112
|
+
"@radix-ui/react-avatar": "^1.1.10",
|
|
113
|
+
"@radix-ui/react-checkbox": "^1.3.2",
|
|
114
|
+
"@radix-ui/react-collapsible": "^1.1.11",
|
|
115
|
+
"@radix-ui/react-context-menu": "^2.2.4",
|
|
116
|
+
"@radix-ui/react-dialog": "^1.1.14",
|
|
117
|
+
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
118
|
+
"@radix-ui/react-hover-card": "^1.1.4",
|
|
119
|
+
"@radix-ui/react-label": "^2.1.7",
|
|
120
|
+
"@radix-ui/react-menubar": "^1.1.4",
|
|
121
|
+
"@radix-ui/react-navigation-menu": "^1.2.3",
|
|
122
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
123
|
+
"@radix-ui/react-progress": "^1.1.7",
|
|
124
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
125
|
+
"@radix-ui/react-scroll-area": "^1.2.2",
|
|
126
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
127
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
128
|
+
"@radix-ui/react-slider": "^1.2.2",
|
|
129
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
130
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
131
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
132
|
+
"@radix-ui/react-toast": "^1.2.4",
|
|
133
|
+
"@radix-ui/react-toggle": "^1.1.1",
|
|
134
|
+
"@radix-ui/react-toggle-group": "^1.1.1",
|
|
135
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
136
|
+
"@tanstack/react-query": "^5.0.0",
|
|
137
|
+
"lucide-react": ">=0.454.0",
|
|
138
|
+
"react": "^19",
|
|
139
|
+
"react-dom": "^19",
|
|
140
|
+
"sonner": "^2.0.7"
|
|
141
|
+
},
|
|
142
|
+
"peerDependenciesMeta": {
|
|
143
|
+
"react": {
|
|
144
|
+
"optional": false
|
|
145
|
+
},
|
|
146
|
+
"sonner": {
|
|
147
|
+
"optional": false
|
|
148
|
+
},
|
|
149
|
+
"react-dom": {
|
|
150
|
+
"optional": false
|
|
151
|
+
},
|
|
152
|
+
"@tanstack/react-query": {
|
|
153
|
+
"optional": false
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"devDependencies": {
|
|
157
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
158
|
+
"@eslint/js": "^9.18.0",
|
|
159
|
+
"@radix-ui/react-accordion": "^1.2.11",
|
|
160
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
161
|
+
"@radix-ui/react-aspect-ratio": "^1.1.1",
|
|
162
|
+
"@radix-ui/react-avatar": "^1.1.10",
|
|
163
|
+
"@radix-ui/react-checkbox": "^1.3.2",
|
|
164
|
+
"@radix-ui/react-collapsible": "^1.1.11",
|
|
165
|
+
"@radix-ui/react-context-menu": "^2.2.4",
|
|
166
|
+
"@radix-ui/react-dialog": "^1.1.14",
|
|
167
|
+
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
168
|
+
"@radix-ui/react-hover-card": "^1.1.4",
|
|
169
|
+
"@radix-ui/react-label": "^2.1.7",
|
|
170
|
+
"@radix-ui/react-menubar": "^1.1.4",
|
|
171
|
+
"@radix-ui/react-navigation-menu": "^1.2.3",
|
|
172
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
173
|
+
"@radix-ui/react-progress": "^1.1.7",
|
|
174
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
175
|
+
"@radix-ui/react-scroll-area": "^1.2.2",
|
|
176
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
177
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
178
|
+
"@radix-ui/react-slider": "^1.2.2",
|
|
179
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
180
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
181
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
182
|
+
"@radix-ui/react-toast": "^1.2.4",
|
|
183
|
+
"@radix-ui/react-toggle": "^1.1.1",
|
|
184
|
+
"@radix-ui/react-toggle-group": "^1.1.1",
|
|
185
|
+
"@radix-ui/react-tooltip": "^1.2.7",
|
|
186
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
187
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
188
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
189
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
190
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
191
|
+
"@testing-library/react": "^16.3.2",
|
|
192
|
+
"@testing-library/user-event": "^14.6.3",
|
|
193
|
+
"@types/react": "^19.2.7",
|
|
194
|
+
"autoprefixer": "^10.4.22",
|
|
195
|
+
"esbuild-css-modules-plugin": "^3.1.5",
|
|
196
|
+
"esbuild-style-plugin": "^1.6.3",
|
|
197
|
+
"eslint": "^9.18.0",
|
|
198
|
+
"eslint-config-prettier": "^10.0.1",
|
|
199
|
+
"eslint-plugin-prettier": "^5.2.2",
|
|
200
|
+
"jsdom": "^29.1.1",
|
|
201
|
+
"postcss": "^8.5.6",
|
|
202
|
+
"postcss-cli": "^11.0.1",
|
|
203
|
+
"prettier": "^3.4.2",
|
|
204
|
+
"react": "^19",
|
|
205
|
+
"react-dom": "^19",
|
|
206
|
+
"rollup": "^4.53.3",
|
|
207
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
208
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
209
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
210
|
+
"sonner": "^2.0.7",
|
|
211
|
+
"tailwindcss": "^4.1.17",
|
|
212
|
+
"tsc-alias": "^1.8.16",
|
|
213
|
+
"tw-animate-css": "^1.4.0",
|
|
214
|
+
"typescript": "^5.9.3",
|
|
215
|
+
"typescript-eslint": "^8.20.0",
|
|
216
|
+
"vitest": "^4.1.10"
|
|
217
|
+
},
|
|
218
|
+
"files": [
|
|
219
|
+
"dist",
|
|
220
|
+
"theme.css"
|
|
221
|
+
],
|
|
222
|
+
"dependencies": {
|
|
223
|
+
"@daypicker/react": "^10.0.1",
|
|
224
|
+
"@types/react-dom": "^19.2.4",
|
|
225
|
+
"class-variance-authority": "^0.7.1",
|
|
226
|
+
"clsx": "^2.1.1",
|
|
227
|
+
"lucide-react": ">=0.454.0",
|
|
228
|
+
"tailwind-merge": "^3.4.0"
|
|
229
|
+
}
|
|
230
|
+
}
|
package/theme.css
CHANGED
|
@@ -8,19 +8,24 @@
|
|
|
8
8
|
--card-foreground: oklch(0.145 0 0);
|
|
9
9
|
--popover: oklch(1 0 0);
|
|
10
10
|
--popover-foreground: oklch(0.145 0 0);
|
|
11
|
+
|
|
12
|
+
/* primary brand (deep royal blue) */
|
|
11
13
|
--primary: oklch(0.441 0.122 251);
|
|
12
14
|
--primary-foreground: oklch(0.984 0.003 210);
|
|
15
|
+
|
|
16
|
+
/* secondary (soft tinted gray-blue) */
|
|
17
|
+
--secondary: oklch(0.441 0.122 251);
|
|
18
|
+
--secondary-foreground: oklch(0.25 0.08 251);
|
|
19
|
+
|
|
13
20
|
--supportive: oklch(0.663 0.137 137);
|
|
14
21
|
--supportive-foreground: oklch(0.984 0.003 210);
|
|
15
|
-
--secondary: oklch(0.208 0.04 266);
|
|
16
|
-
--secondary-foreground: oklch(0.968 0.007 210);
|
|
17
22
|
--muted: oklch(0.968 0.007 210);
|
|
18
23
|
--muted-foreground: oklch(0.554 0.041 257);
|
|
19
24
|
--warning: oklch(0.731 0.144 64);
|
|
20
25
|
--warning-foreground: oklch(0.968 0.007 210);
|
|
21
26
|
--accent: oklch(0.97 0 0);
|
|
22
27
|
--accent-foreground: oklch(0.205 0 0);
|
|
23
|
-
--destructive: oklch(0.
|
|
28
|
+
--destructive: oklch(0.48 0.218 29);
|
|
24
29
|
--destructive-foreground: oklch(0.984 0.003 210);
|
|
25
30
|
--border: oklch(0.922 0 0);
|
|
26
31
|
--input: oklch(0.922 0 0);
|
|
@@ -45,11 +50,11 @@
|
|
|
45
50
|
--animate-accordion-up: accordion-up 0.2s ease-out;
|
|
46
51
|
|
|
47
52
|
--font-sans:
|
|
48
|
-
Inter, -apple-system, BlinkMacSystemFont,
|
|
49
|
-
|
|
53
|
+
Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
54
|
+
'Helvetica Neue', Arial, sans-serif;
|
|
50
55
|
--font-mono:
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Liberation Mono',
|
|
57
|
+
'Courier New', monospace;
|
|
53
58
|
|
|
54
59
|
--color-background: var(--background);
|
|
55
60
|
--color-foreground: var(--foreground);
|
package/dist/vitest.config.d.ts
DELETED
package/dist/vitest.setup.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@testing-library/jest-dom/vitest";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|