@scouterna/ui-react 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +21 -52
  3. package/README.md +0 -3
  4. package/assets/divider-long.svg +0 -94
  5. package/assets/divider-short.svg +0 -37
  6. package/assets/icons/aboutUs.svg +0 -44
  7. package/assets/icons/activityBank.svg +0 -26
  8. package/assets/icons/becomeAScout.svg +0 -28
  9. package/assets/icons/becomeMonthlyDonor.svg +0 -28
  10. package/assets/icons/communicateScouts.svg +0 -105
  11. package/assets/icons/companies.svg +0 -74
  12. package/assets/icons/digitalMeetingPlaces.svg +0 -29
  13. package/assets/icons/event.svg +0 -38
  14. package/assets/icons/eventCalendar.svg +0 -20
  15. package/assets/icons/eventsAndCamps.svg +0 -76
  16. package/assets/icons/eventsInSweden.svg +0 -32
  17. package/assets/icons/findScoutGroup.svg +0 -60
  18. package/assets/icons/forLeaders.svg +0 -84
  19. package/assets/icons/forParents.svg +0 -22
  20. package/assets/icons/forScoutLeadersAndTroops.svg +0 -32
  21. package/assets/icons/frequentlyAskedQuestions.svg +0 -32
  22. package/assets/icons/getInvolvedAsAdult.svg +0 -20
  23. package/assets/icons/giveAGift.svg +0 -45
  24. package/assets/icons/howYourMoneyHelps.svg +0 -27
  25. package/assets/icons/iAmAScout.svg +0 -21
  26. package/assets/icons/internationalEvents.svg +0 -41
  27. package/assets/icons/internationalScouting.svg +0 -32
  28. package/assets/icons/jamboree.svg +0 -45
  29. package/assets/icons/languages.svg +0 -34
  30. package/assets/icons/leadScoutGroup.svg +0 -45
  31. package/assets/icons/leadScouting.svg +0 -11
  32. package/assets/icons/newsUpdates.svg +0 -14
  33. package/assets/icons/ourFacilitiesAndCampsites.svg +0 -35
  34. package/assets/icons/packingList.svg +0 -36
  35. package/assets/icons/planActivities.svg +0 -29
  36. package/assets/icons/scoutBadges.svg +0 -48
  37. package/assets/icons/scoutCabinWebsite.svg +0 -11
  38. package/assets/icons/scoutsFolkHighSchool.svg +0 -43
  39. package/assets/icons/scoutsSupportFund.svg +0 -25
  40. package/assets/icons/shop.svg +0 -34
  41. package/assets/icons/societalImpact.svg +0 -37
  42. package/assets/icons/supportUs.svg +0 -12
  43. package/assets/icons/testament.svg +0 -17
  44. package/assets/icons/toolsAndResources.svg +0 -14
  45. package/assets/icons/whatAreTheScouts.svg +0 -57
  46. package/assets/icons/whatDoesItCost.svg +0 -13
  47. package/assets/icons/whatIsScouting.svg +0 -24
  48. package/assets/icons/whatWeDoAtScouts.svg +0 -24
  49. package/assets/icons/whyScouts.svg +0 -18
  50. package/assets/icons/workWithUs.svg +0 -48
  51. package/assets/logo/scouterna.svg +0 -1
  52. package/assets/logo/scouterna_tagline.svg +0 -1
  53. package/assets/logo/scoutsymbolen.svg +0 -116
  54. package/assets/logo/tab-horizontal.png +0 -0
  55. package/assets/logo/tab-vertical.png +0 -0
  56. package/assets/topograph.svg +0 -108
  57. package/dist/components/button/button.d.ts +0 -10
  58. package/dist/components/button/button.js +0 -171
  59. package/dist/components/button/button.js.map +0 -1
  60. package/dist/components/callout/callout.d.ts +0 -10
  61. package/dist/components/callout/callout.js +0 -54
  62. package/dist/components/callout/callout.js.map +0 -1
  63. package/dist/components/card/card.d.ts +0 -8
  64. package/dist/components/card/card.js +0 -32
  65. package/dist/components/card/card.js.map +0 -1
  66. package/dist/components/checkbox/checkbox.d.ts +0 -4
  67. package/dist/components/checkbox/checkbox.js +0 -22
  68. package/dist/components/checkbox/checkbox.js.map +0 -1
  69. package/dist/components/field/field.d.ts +0 -13
  70. package/dist/components/field/field.js +0 -17
  71. package/dist/components/field/field.js.map +0 -1
  72. package/dist/components/input/input.d.ts +0 -4
  73. package/dist/components/input/input.js +0 -23
  74. package/dist/components/input/input.js.map +0 -1
  75. package/dist/components/menu/menu.d.ts +0 -13
  76. package/dist/components/menu/menu.js +0 -80
  77. package/dist/components/menu/menu.js.map +0 -1
  78. package/dist/components/select/select.d.ts +0 -7
  79. package/dist/components/select/select.js +0 -32
  80. package/dist/components/select/select.js.map +0 -1
  81. package/dist/components/table/table-test.d.ts +0 -2
  82. package/dist/components/table/table-test.js +0 -46
  83. package/dist/components/table/table-test.js.map +0 -1
  84. package/dist/components/table/table.d.ts +0 -11
  85. package/dist/components/table/table.js +0 -75
  86. package/dist/components/table/table.js.map +0 -1
  87. package/dist/components/toast/toast.d.ts +0 -11
  88. package/dist/components/toast/toast.js +0 -15
  89. package/dist/components/toast/toast.js.map +0 -1
  90. package/dist/index.d.ts +0 -10
  91. package/dist/index.js +0 -11
  92. package/dist/index.js.map +0 -1
  93. package/dist/lib/utils.d.ts +0 -2
  94. package/dist/lib/utils.js +0 -6
  95. package/dist/lib/utils.js.map +0 -1
  96. package/dist/style.css +0 -1187
  97. package/dist/theme.css +0 -177
@@ -1,54 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cva } from "class-variance-authority";
3
- import { CheckIcon, CircleAlertIcon, InfoIcon, TriangleAlertIcon, } from "lucide-react";
4
- import { cn } from "../../lib/utils.js";
5
- const calloutVariants = cva(`
6
- flex gap-2
7
- p-4
8
- border
9
- rounded-lg
10
- `, {
11
- variants: {
12
- variant: {
13
- default: `
14
- [--callout-icon-color:var(--color-gray-dark)]
15
- bg-gray-light text-gray-dark
16
- border-gray-300
17
- `,
18
- info: `
19
- [--callout-icon-color:var(--color-blue-00)]
20
- bg-blue-100 text-blue-800
21
- border-blue-200
22
- `,
23
- warning: `
24
- [--callout-icon-color:var(--color-orange-800)]
25
- bg-orange-100 text-orange-800
26
- border-orange-200
27
- `,
28
- error: `
29
- [--callout-icon-color:var(--color-red-800)]
30
- bg-red-100 text-red-800
31
- border-red-200
32
- `,
33
- success: `
34
- [--callout-icon-color:var(--color-trackergreen-800)]
35
- bg-trackergreen-100 text-trackergreen-800
36
- border-trackergreen-200
37
- `,
38
- },
39
- },
40
- });
41
- const variantIcons = {
42
- default: InfoIcon,
43
- info: InfoIcon,
44
- warning: CircleAlertIcon,
45
- error: TriangleAlertIcon,
46
- success: CheckIcon,
47
- };
48
- const Callout = ({ className, variant, children, ...props }) => {
49
- variant = variant || "default";
50
- const Icon = props.icon || variantIcons[variant];
51
- return (_jsxs("div", { className: cn(calloutVariants({ variant, className })), ...props, children: [_jsx("div", { children: _jsx(Icon, { className: "h-6 w-6 text-(--callout-icon-color)" }) }), children] }));
52
- };
53
- export { Callout };
54
- //# sourceMappingURL=callout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"callout.js","sourceRoot":"","sources":["../../../src/components/callout/callout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,SAAS,EACT,eAAe,EACf,QAAQ,EAER,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,eAAe,GAAG,GAAG,CACzB;;;;;GAKC,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;;;;SAIR;YACD,IAAI,EAAE;;;;SAIL;YACD,OAAO,EAAE;;;;SAIR;YACD,KAAK,EAAE;;;;SAIN;YACD,OAAO,EAAE;;;;SAIR;SACF;KACF;CACF,CACF,CAAC;AAGF,MAAM,YAAY,GAAiC;IACjD,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,SAAS;CACnB,CAAC;AAOF,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC3E,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC;IAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,KAAM,KAAK,aACpE,wBACE,KAAC,IAAI,IAAC,SAAS,EAAC,qCAAqC,GAAG,GACpD,EACL,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- import { useRender } from "@base-ui-components/react";
2
- import { type VariantProps } from "class-variance-authority";
3
- declare const cardVariants: (props?: ({
4
- variant?: "medium" | "light" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- export type Props = useRender.ComponentProps<"div"> & VariantProps<typeof cardVariants>;
7
- declare function Card(props: Props): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
8
- export { Card };
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { mergeProps, useRender } from "@base-ui-components/react";
3
- import { cva } from "class-variance-authority";
4
- import { cn } from "../../lib/utils.js";
5
- const cardVariants = cva(`
6
- p-4
7
- border
8
- rounded-lg
9
- text-gray-dark
10
- `, {
11
- variants: {
12
- variant: {
13
- light: "bg-gray-100 border-gray-300",
14
- medium: "bg-gray-200 border-gray-300",
15
- },
16
- },
17
- defaultVariants: {
18
- variant: "light",
19
- },
20
- });
21
- function Card(props) {
22
- const { render = _jsx("div", {}), className, variant, ...otherProps } = props;
23
- const defaultProps = {
24
- className: cn(cardVariants({ variant }), className),
25
- };
26
- return useRender({
27
- render,
28
- props: mergeProps(defaultProps, otherProps),
29
- });
30
- }
31
- export { Card };
32
- //# sourceMappingURL=card.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.js","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,YAAY,GAAG,GAAG,CACtB;;;;;GAKC,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,KAAK,EAAE,6BAA6B;YACpC,MAAM,EAAE,6BAA6B;SACtC;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,OAAO;KACjB;CACF,CACF,CAAC;AAKF,SAAS,IAAI,CAAC,KAAY;IACxB,MAAM,EAAE,MAAM,GAAG,eAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAEtE,MAAM,YAAY,GAAkC;QAClD,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC;KACpD,CAAC;IAEF,OAAO,SAAS,CAAC;QACf,MAAM;QACN,KAAK,EAAE,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC;KAC5C,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { Checkbox as CheckboxPrimitive } from "@base-ui-components/react/checkbox";
2
- export type CheckboxProps = CheckboxPrimitive.Root.Props;
3
- declare const Checkbox: ({ className, children, ...props }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
4
- export { Checkbox };
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Checkbox as CheckboxPrimitive } from "@base-ui-components/react/checkbox";
3
- import { CheckIcon } from "lucide-react";
4
- import { cn } from "../../lib/utils.js";
5
- const Checkbox = ({ className, children, ...props }) => {
6
- return (
7
- // biome-ignore lint/a11y/noLabelWithoutControl: The CheckboxPrimitive.Root is the control
8
- _jsxs("label", { className: "flex items-center text-gray-dark", children: [_jsx(CheckboxPrimitive.Root, { className: cn(`
9
- flex items-center justify-center
10
- size-6
11
- rounded-md appearance-none
12
- bg-gray-100 border-gray-400
13
- hover:bg-gray-200 border
14
- focus-visible:outline-none
15
- focus-visible:border-gray-500
16
- focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2
17
- disabled:cursor-not-allowed
18
- disabled:opacity-50
19
- `, className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { children: _jsx(CheckIcon, { className: "size-5" }) }) }), _jsx("span", { className: "pl-2 text-sm leading-none", children: children })] }));
20
- };
21
- export { Checkbox };
22
- //# sourceMappingURL=checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAIxC,MAAM,QAAQ,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiB,EAAE,EAAE;IACpE,OAAO;IACL,0FAA0F;IAC1F,iBAAO,SAAS,EAAC,kCAAkC,aACjD,KAAC,iBAAiB,CAAC,IAAI,IACrB,SAAS,EAAE,EAAE,CACX;;;;;;;;;;;WAWC,EACD,SAAS,CACV,KACG,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,cAC1B,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,GAAG,GACJ,GACP,EACzB,eAAM,SAAS,EAAC,2BAA2B,YAAE,QAAQ,GAAQ,IACvD,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Field } from "@base-ui-components/react/field";
2
- export type FieldProps = React.HTMLAttributes<HTMLDivElement> & {
3
- asChild?: boolean;
4
- label: string;
5
- labelFor: string;
6
- };
7
- declare const Root: import("react").ForwardRefExoticComponent<Field.Root.Props & import("react").RefAttributes<HTMLDivElement>>;
8
- declare const Control: import("react").ForwardRefExoticComponent<Field.Control.Props & import("react").RefAttributes<HTMLInputElement>>;
9
- declare const Validity: import("react").FC<Field.Validity.Props>;
10
- declare const FieldError: ({ className, ...props }: Field.Error.Props) => import("react/jsx-runtime").JSX.Element;
11
- declare const Description: ({ className, ...props }: Field.Description.Props) => import("react/jsx-runtime").JSX.Element;
12
- declare const Label: ({ className, ...props }: Field.Label.Props) => import("react/jsx-runtime").JSX.Element;
13
- export { Root as Field, Control, Validity, FieldError as Error, Description, Label, };
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Field } from "@base-ui-components/react/field";
3
- import { cn } from "../../lib/utils.js";
4
- const Root = Field.Root;
5
- const Control = Field.Control;
6
- const Validity = Field.Validity;
7
- const FieldError = ({ className, ...props }) => {
8
- return (_jsx(Field.Error, { className: cn("text-sm text-red", className), ...props }));
9
- };
10
- const Description = ({ className, ...props }) => {
11
- return (_jsx(Field.Description, { className: cn("text-sm text-gray-800", className), ...props }));
12
- };
13
- const Label = ({ className, ...props }) => {
14
- return (_jsx(Field.Label, { className: cn("font-bold text-sm text-gray-dark", className), ...props }));
15
- };
16
- export { Root as Field, Control, Validity, FieldError as Error, Description, Label, };
17
- //# sourceMappingURL=field.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field.js","sourceRoot":"","sources":["../../../src/components/field/field.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAQxC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;AAEhC,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAqB,EAAE,EAAE;IAChE,OAAO,CACL,KAAC,KAAK,CAAC,KAAK,IAAC,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACzE,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA2B,EAAE,EAAE;IACvE,OAAO,CACL,KAAC,KAAK,CAAC,WAAW,IAChB,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAC7C,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAqB,EAAE,EAAE;IAC3D,OAAO,CACL,KAAC,KAAK,CAAC,KAAK,IACV,SAAS,EAAE,EAAE,CAAC,kCAAkC,EAAE,SAAS,CAAC,KACxD,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EACL,IAAI,IAAI,KAAK,EACb,OAAO,EACP,QAAQ,EACR,UAAU,IAAI,KAAK,EACnB,WAAW,EACX,KAAK,GACN,CAAC"}
@@ -1,4 +0,0 @@
1
- import { Input as InputPrimitive } from "@base-ui-components/react/input";
2
- export type InputProps = Omit<InputPrimitive.Props, "placeholder">;
3
- declare const Input: ({ className, type, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element;
4
- export { Input };
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Input as InputPrimitive } from "@base-ui-components/react/input";
3
- import { cn } from "../../lib/utils.js";
4
- const Input = ({ className, type = "text", ...props }) => {
5
- return (_jsx(InputPrimitive, { type: type, className: cn(`
6
- flex
7
- h-10 w-full px-3 py-2
8
- rounded-lg
9
- border border-gray-300
10
- bg-gray-100 text-gray-dark
11
- text-base
12
- file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground
13
- focus-visible:outline-none
14
- focus-visible:border-gray-500
15
- disabled:cursor-not-allowed
16
- disabled:opacity-50
17
- `, className), ...props,
18
- // Explicitly set placeholder to empty string to prevent users from
19
- // ignoring the types and passing placeholder anyways.
20
- placeholder: "" }));
21
- };
22
- export { Input };
23
- //# sourceMappingURL=input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAIxC,MAAM,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,KAAK,EAAc,EAAE,EAAE;IACnE,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX;;;;;;;;;;;;SAYC,EACD,SAAS,CACV,KACG,KAAK;QACT,mEAAmE;QACnE,sDAAsD;QACtD,WAAW,EAAC,EAAE,GACd,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- import { Menu as MenuPrimitive } from "@base-ui-components/react/menu";
2
- declare const Root: import("react").FC<MenuPrimitive.Root.Props>;
3
- declare const Trigger: import("react").ForwardRefExoticComponent<MenuPrimitive.Trigger.Props & import("react").RefAttributes<HTMLElement>>;
4
- declare const Group: import("react").ForwardRefExoticComponent<MenuPrimitive.Group.Props & import("react").RefAttributes<Element>>;
5
- declare const SubmenuRoot: typeof MenuPrimitive.SubmenuRoot;
6
- declare const SubmenuTrigger: import("react").ForwardRefExoticComponent<MenuPrimitive.SubmenuTrigger.Props & import("react").RefAttributes<Element>>;
7
- declare const Positioner: ({ className, children, ...props }: MenuPrimitive.Positioner.Props) => import("react/jsx-runtime").JSX.Element;
8
- declare const GroupLabel: ({ className, ...props }: MenuPrimitive.GroupLabel.Props) => import("react/jsx-runtime").JSX.Element;
9
- declare const Item: ({ className, children, ...props }: MenuPrimitive.Item.Props & {
10
- icon?: React.ReactNode;
11
- }) => import("react/jsx-runtime").JSX.Element;
12
- declare const Separator: ({ className, ...props }: MenuPrimitive.Separator.Props) => import("react/jsx-runtime").JSX.Element;
13
- export { Group, GroupLabel, Item, Root, Trigger, SubmenuRoot, SubmenuTrigger, Positioner, Separator, };
@@ -1,80 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Menu as MenuPrimitive } from "@base-ui-components/react/menu";
4
- import { ChevronRightIcon } from "lucide-react";
5
- import { createContext, useContext } from "react";
6
- import { cn } from "../../lib/utils.js";
7
- const Root = MenuPrimitive.Root;
8
- const Trigger = MenuPrimitive.Trigger;
9
- const Group = MenuPrimitive.Group;
10
- const SubmenuRoot = MenuPrimitive.SubmenuRoot;
11
- const SubmenuTrigger = MenuPrimitive.SubmenuTrigger;
12
- function ArrowSvg(props) {
13
- return (
14
- // biome-ignore lint/a11y/noSvgWithoutTitle: This is only for display
15
- _jsxs("svg", { "aria-hidden": true, width: "20", height: "10", viewBox: "0 0 20 10", fill: "none", ...props, children: [_jsx("path", { d: "M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z", className: "fill-gray-100" }), _jsx("path", { d: "M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z", className: "fill-gray-300" }), _jsx("path", { d: "M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z", className: "fill-gray-100" })] }));
16
- }
17
- function Arrow() {
18
- return (_jsx(MenuPrimitive.Arrow, { className: `
19
- group-data-[nested]/popup:hidden
20
- data-[side=top]:-bottom-[8px]
21
- data-[side=top]:rotate-180
22
- data-[side=bottom]:-top-[8px]
23
- data-[side=bottom]:rotate-0
24
- data-[side=left]:-right-[13px]
25
- data-[side=left]:rotate-90
26
- data-[side=right]:-left-[13px]
27
- data-[side=right]:-rotate-90
28
- `, children: _jsx(ArrowSvg, {}) }));
29
- }
30
- const SubmenuContext = createContext({
31
- isNested: false,
32
- });
33
- const Positioner = ({ className, children, ...props }) => {
34
- const submenuContext = useContext(SubmenuContext);
35
- return (_jsx(SubmenuContext.Provider, { value: {
36
- isNested: true,
37
- }, children: _jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { alignOffset: submenuContext.isNested ? -6 : 0, sideOffset: submenuContext.isNested ? -6 : 8, className: cn(`
38
-
39
- `, className), ...props, children: _jsxs(MenuPrimitive.Popup, { className: `
40
- group/popup
41
- relative z-50 py-1.5
42
-
43
- min-w-[calc(var(--anchor-width)+25px-var(--spacing)*1.5)]
44
- rounded-lg border bg-gray-100 text-popover-foreground shadow-md
45
- border-gray-300 text-gray-dark
46
-
47
- origin-[var(--transform-origin)]
48
- transition-[transform,scale,opacity]
49
- data-[ending-style]:scale-90 data-[ending-style]:opacity-0
50
- data-[starting-style]:scale-90 data-[starting-style]:opacity-0
51
- `, children: [_jsx(Arrow, {}), children] }) }) }) }));
52
- };
53
- const GroupLabel = ({ className, ...props }) => (_jsx(MenuPrimitive.GroupLabel, { className: cn("px-[25px] text-sm leading-[25px] font-semibold select-none", className), ...props }));
54
- const Item = ({ className, children, ...props }) => {
55
- const { icon, ...otherProps } = props;
56
- return (_jsxs(MenuPrimitive.Item, { className: cn(`
57
- relative h-8 select-none items-center rounded-sm
58
- px-4 leading-none
59
-
60
- grid grid-cols-[1rem_auto_1rem] gap-2
61
-
62
- after:absolute
63
- after:inset-y-0
64
- after:inset-x-1.5
65
- after:z-[-1]
66
- data-[highlighted]:after:bg-blue-100
67
- data-[highlighted]:after:rounded-sm
68
-
69
- data-[highlighted]:text-blue
70
- data-[highlighted]:outline-none
71
-
72
- data-[disabled]:pointer-events-none
73
- data-[disabled]:opacity-50
74
-
75
- group/item
76
- `, className), ...otherProps, children: [icon && _jsx("span", { className: "flex items-center justify-center", children: icon }), _jsx("span", { className: "col-start-2", children: children }), _jsx(ChevronRightIcon, { className: "size-4 hidden group-aria-[haspopup]/item:block" })] }));
77
- };
78
- const Separator = ({ className, ...props }) => (_jsx(MenuPrimitive.Separator, { className: cn("m-[5px] h-px bg-gray-300", className), ...props }));
79
- export { Group, GroupLabel, Item, Root, Trigger, SubmenuRoot, SubmenuTrigger, Positioner, Separator, };
80
- //# sourceMappingURL=menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["../../../src/components/menu/menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAExC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AAChC,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;AACtC,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;AAClC,MAAM,WAAW,GAAG,aAAa,CAAC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AAK,IAClB,SAAS,EAAE;;;;;;;;;;;;aAYV,aAED,KAAC,KAAK,KAAG,EACR,QAAQ,IACW,GACG,GACN,GACC,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACuB,EAAE,EAAE,CAAC,CACpC,KAAC,aAAa,CAAC,UAAU,IACvB,SAAS,EAAE,EAAE,CACX,4DAA4D,EAC5D,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAGT,EAAE,EAAE;IACH,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAEtC,OAAO,CACL,MAAC,aAAa,CAAC,IAAI,IACjB,SAAS,EAAE,EAAE,CACX;;;;;;;;;;;;;;;;;;;;SAoBC,EACD,SAAS,CACV,KACG,UAAU,aAEb,IAAI,IAAI,eAAM,SAAS,EAAC,kCAAkC,YAAE,IAAI,GAAQ,EAEzE,eAAM,SAAS,EAAC,aAAa,YAAE,QAAQ,GAAQ,EAE/C,KAAC,gBAAgB,IAAC,SAAS,EAAC,gDAAgD,GAAG,IAC5D,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiC,EAAE,EAAE,CAAC,CAC5E,KAAC,aAAa,CAAC,SAAS,IACtB,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAC;AAEF,OAAO,EACL,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,GACV,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Select as SelectPrimitive } from "@base-ui-components/react/select";
2
- declare const Root: <TValue>({ children, ...props }: SelectPrimitive.Root.Props<TValue>) => import("react/jsx-runtime").JSX.Element;
3
- declare const Group: import("react").ForwardRefExoticComponent<SelectPrimitive.Group.Props & import("react").RefAttributes<HTMLDivElement>>;
4
- declare const GroupLabel: ({ className, ...props }: SelectPrimitive.GroupLabel.Props) => import("react/jsx-runtime").JSX.Element;
5
- declare const Item: ({ className, children, ...props }: SelectPrimitive.Item.Props) => import("react/jsx-runtime").JSX.Element;
6
- declare const Separator: ({ className, ...props }: SelectPrimitive.Separator.Props) => import("react/jsx-runtime").JSX.Element;
7
- export { Root, Group, GroupLabel, Item, Separator };
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Select as SelectPrimitive } from "@base-ui-components/react/select";
3
- import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4
- import { cn } from "../../lib/utils.js";
5
- const Root = ({ children, ...props }) => (_jsxs(SelectPrimitive.Root, { ...props, children: [_jsx(Trigger, { children: _jsx(SelectPrimitive.Value, {}) }), _jsx(Positioner, { className: "text-gray-dark", children: children })] }));
6
- const Group = SelectPrimitive.Group;
7
- const Trigger = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Trigger, { className: cn(`
8
- flex
9
- items-center
10
- justify-between
11
- h-10 w-full px-3 py-2
12
- rounded-lg
13
- border border-gray-300
14
- bg-gray-100 text-gray-dark
15
- text-base
16
- file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground
17
- focus-visible:outline-none
18
- focus-visible:border-gray-500
19
- disabled:cursor-not-allowed
20
- disabled:opacity-50
21
- data-[placeholder]:text-gray-600
22
- data-[placeholder]:italic
23
- [&>span]:whitespace-nowrap
24
- `, className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
25
- const ScrollUpArrow = ({ className, ...props }) => (_jsx(SelectPrimitive.ScrollUpArrow, { className: cn("absolute top-0 inset-x-0 flex cursor-default items-center justify-center py-1 z-10", className), ...props, children: _jsx(ChevronUpIcon, { className: "size-4" }) }));
26
- const ScrollDownArrow = ({ className, ...props }) => (_jsx(SelectPrimitive.ScrollDownArrow, { className: cn("absolute bottom-0 inset-x-0 flex cursor-default items-center justify-center py-1", className), ...props, children: _jsx(ChevronDownIcon, { className: "size-4" }) }));
27
- const Positioner = ({ className, children, ...props }) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Positioner, { className: cn("relative z-50 min-w-[calc(var(--anchor-width)+25px-var(--spacing)*1.5)] overflow-y-auto overflow-x-hidden rounded-lg border bg-gray-100 text-popover-foreground shadow-md border-gray-300", className), ...props, children: [_jsx(ScrollUpArrow, {}), _jsx(SelectPrimitive.Popup, { className: cn("p-1.5"), children: children }), _jsx(ScrollDownArrow, {})] }) }));
28
- const GroupLabel = ({ className, ...props }) => (_jsx(SelectPrimitive.GroupLabel, { className: cn("px-[25px] text-sm leading-[25px] font-semibold select-none", className), ...props }));
29
- const Item = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Item, { className: cn("relative flex h-7 select-none items-center rounded-sm pl-[25px] pr-[35px] leading-none data-[disabled]:pointer-events-none data-[highlighted]:bg-blue-100 data-[disabled]:opacity-50 data-[highlighted]:text-blue data-[highlighted]:outline-none", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { className: "absolute left-1.5 inline-flex w-4 items-center justify-center", children: _jsx(CheckIcon, {}) })] }));
30
- const Separator = ({ className, ...props }) => (_jsx(SelectPrimitive.Separator, { className: cn("m-[5px] h-px bg-gray-300", className), ...props }));
31
- export { Root, Group, GroupLabel, Item, Separator };
32
- //# sourceMappingURL=select.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,SAAS,E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function TableTest(): import("react/jsx-runtime").JSX.Element;
2
- export { TableTest };
@@ -1,46 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createColumnHelper, getCoreRowModel, getFilteredRowModel, getSortedRowModel, useReactTable, } from "@tanstack/react-table";
3
- import { useState } from "react";
4
- import { Table } from "./table.js";
5
- const defaultData = [
6
- { firstName: "Alice", lastName: "Smith", role: "scout" },
7
- { firstName: "Bob", lastName: "Abraham", role: "leader" },
8
- { firstName: "Charlie", lastName: "Brown", role: "volunteer" },
9
- ];
10
- const columnHelper = createColumnHelper();
11
- const columns = [
12
- columnHelper.accessor("firstName", {
13
- header: () => "Förnamn",
14
- size: 200,
15
- }),
16
- columnHelper.accessor("lastName", {
17
- header: () => "Efternamn",
18
- size: 200,
19
- }),
20
- columnHelper.accessor("role", {
21
- header: () => "Roll",
22
- enableSorting: false,
23
- cell: (info) => {
24
- const role = info.getValue();
25
- return role.charAt(0).toUpperCase() + role.slice(1);
26
- },
27
- }),
28
- ];
29
- function TableTest() {
30
- const [data, _setData] = useState(() => [...defaultData]);
31
- const table = useReactTable({
32
- data,
33
- columns,
34
- columnResizeMode: "onChange",
35
- getCoreRowModel: getCoreRowModel(),
36
- getFilteredRowModel: getFilteredRowModel(),
37
- getSortedRowModel: getSortedRowModel(),
38
- });
39
- return (_jsxs(_Fragment, { children: [_jsx("pre", { className: "mb-4 min-h-48", children: JSON.stringify({
40
- // columnSizing: table.getState().columnSizing,
41
- // columnSizeVars,
42
- sort: table.getState().sorting,
43
- }, null, 2) }), _jsx(Table, { table: table, className: "w-full" })] }));
44
- }
45
- export { TableTest };
46
- //# sourceMappingURL=table-test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"table-test.js","sourceRoot":"","sources":["../../../src/components/table/table-test.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GACd,MA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AAG,aAAa,CAAC;QAC1B,IAAI;QACJ,OAAO;QACP,gBAAgB,EAAE,UAAU;QAC5B,eAAe,EAAE,eAAe,EAAE;QAClC,mBAAmB,EAAE,mBAAmB,EAAE;QAC1C,iBAAiB,EAAE,iBAAiB,EAAE;KACvC,CAAC,CAAC;IAEH,OAAO,CACL,8BACE,cAAK,SAAS,EAAC,eAAe,YAC3B,IAAI,CAAC,SAAS,CACb;oBACE,+CAA+C;oBAC/C,kBAAkB;oBAClB,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO;iBAC/B,EACD,IAAI,EACJ,CAAC,CACF,GACG,EACN,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,QAAQ,GAAG,IACzC,CACJ,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- import { type Table as TanstackTable } from "@tanstack/react-table";
2
- import { Card } from "../card/card.js";
3
- export type Props<TData> = Parameters<typeof Card>[0] & {
4
- table: TanstackTable<TData>;
5
- };
6
- declare function Table<TData>(props: Props<TData>): import("react/jsx-runtime").JSX.Element;
7
- declare function TableBody<TData>({ table }: {
8
- table: TanstackTable<TData>;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- export declare const MemoizedTableBody: typeof TableBody;
11
- export { Table };
@@ -1,75 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { flexRender, } from "@tanstack/react-table";
3
- import { ArrowDownIcon, ArrowUpIcon, ChevronsUpDownIcon, EllipsisVerticalIcon, ListFilterIcon, } from "lucide-react";
4
- import { memo, useId, useMemo } from "react";
5
- import { Fragment } from "react/jsx-runtime";
6
- import { cn } from "../../lib/utils.js";
7
- import { Button } from "../button/button.js";
8
- import { Card } from "../card/card.js";
9
- import * as Menu from "../menu/menu.js";
10
- function Table(props) {
11
- const { table, className, ...otherProps } = props;
12
- /**
13
- * Instead of calling `column.getSize()` on every render for every header
14
- * and especially every data cell (very expensive),
15
- * we will calculate all column sizes at once at the root table level in a useMemo
16
- * and pass the column sizes down as CSS variables to the <table> element.
17
- */
18
- // biome-ignore lint/correctness/useExhaustiveDependencies: This is carefully optimized to avoid unnecessary recalculations
19
- const columnSizeVars = useMemo(() => {
20
- const headers = table.getFlatHeaders();
21
- const colSizes = {};
22
- for (const header of headers) {
23
- colSizes[`--header-${header.id}-size`] = header.getSize();
24
- colSizes[`--col-${header.column.id}-size`] = header.column.getSize();
25
- }
26
- return colSizes;
27
- }, [table.getState().columnSizingInfo, table.getState().columnSizing]);
28
- return (_jsx(Card, { className: cn("p-0 inline-block overflow-auto", className), ...otherProps, variant: "light", children: _jsxs("table", { style: {
29
- ...columnSizeVars,
30
- width: (table.options.enableColumnResizing ?? true)
31
- ? table.getTotalSize()
32
- : "100%",
33
- }, children: [_jsx("thead", { className: "border-b border-gray-300", children: table.getHeaderGroups().map((headerGroup) => (_jsx("tr", { children: headerGroup.headers.map((header) => (_jsxs("th", { className: "relative p-2 select-none", style: {
34
- width: `calc(var(--header-${header?.id}-size) * 1px)`,
35
- }, children: [_jsxs("div", { className: "flex justify-between pr-1", children: [_jsx(HeaderTitle, { header: header }), _jsxs("div", { className: "flex gap-0.5", children: [_jsx(Button, { size: "tiny-icon", variant: "text", color: "gray", children: _jsx(ListFilterIcon, {}) }), _jsx(HeaderMenu, { header: header })] })] }), header.column.getCanResize() && (_jsx(ResizeHandle, { table: table, header: header }))] }, header.id))) }, headerGroup.id))) }), table.getState().columnSizingInfo.isResizingColumn ? (_jsx(MemoizedTableBody, { table: table })) : (_jsx(TableBody, { table: table })), _jsx("tfoot", { children: table.getFooterGroups().map((footerGroup) => (_jsx("tr", { children: footerGroup.headers.map((header) => (_jsx("th", { children: header.isPlaceholder
36
- ? null
37
- : flexRender(header.column.columnDef.footer, header.getContext()) }, header.id))) }, footerGroup.id))) })] }) }));
38
- }
39
- function TableBody({ table }) {
40
- return (_jsx("tbody", { children: table.getRowModel().rows.map((row) => (_jsx("tr", { className: "not-last:border-b border-gray-300", children: row.getVisibleCells().map((cell) => (_jsx("td", { className: "text-left px-2 py-1", children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id))) }));
41
- }
42
- function ResizeHandle({ table, header, }) {
43
- return (_jsx("div", { "aria-hidden": true, onDoubleClick: () => header.column.resetSize(), onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: cn("absolute flex justify-center items-center py-2 top-0 right-0 h-full w-2 cursor-col-resize touch-none select-none", "after:w-0.5 after:h-full after:bg-gray-300", header.column.getIsResizing() && "bg-blue-100 after:invisible"), style: {
44
- transform: table.options.columnResizeMode === "onEnd" &&
45
- header.column.getIsResizing()
46
- ? `translateX(${table.getState().columnSizingInfo.deltaOffset}px)`
47
- : "",
48
- } }));
49
- }
50
- // biome-ignore lint/suspicious/noExplicitAny: We don't care about the type here
51
- function HeaderTitle({ header }) {
52
- const sortDescriptionId = useId();
53
- if (header.isPlaceholder) {
54
- return null;
55
- }
56
- const rendered = flexRender(header.column.columnDef.header, header.getContext());
57
- if (!header.column.getCanSort()) {
58
- return rendered;
59
- }
60
- return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: cn("flex-1 flex items-center gap-1 cursor-pointer"), onClick: header.column.getToggleSortingHandler(), "aria-describedby": sortDescriptionId, children: [rendered, header.column.getIsSorted() === "asc" && (_jsx(ArrowUpIcon, { className: "size-4" })), header.column.getIsSorted() === "desc" && (_jsx(ArrowDownIcon, { className: "size-4" }))] }), _jsx("p", { id: sortDescriptionId, hidden: true, children: "Toggle column sorting" })] }));
61
- }
62
- // biome-ignore lint/suspicious/noExplicitAny: We don't care about the type here
63
- function HeaderMenu({ header }) {
64
- const menuSections = [
65
- header.column.getCanSort() && (_jsxs(Fragment, { children: [header.column.getIsSorted() !== "asc" && (_jsx(Menu.Item, { icon: _jsx(ArrowUpIcon, {}), onClick: () => header.column.toggleSorting(false), children: "Sort Ascending" })), header.column.getIsSorted() !== "desc" && (_jsx(Menu.Item, { icon: _jsx(ArrowDownIcon, {}), onClick: () => header.column.toggleSorting(true), children: "Sort Descending" })), header.column.getIsSorted() && (_jsx(Menu.Item, { icon: _jsx(ChevronsUpDownIcon, {}), onClick: () => header.column.clearSorting(), children: "Clear Sorting" }))] }, "sortMenu")),
66
- ].filter((section) => section !== false);
67
- if (menuSections.length === 0) {
68
- return null;
69
- }
70
- return (_jsxs(Menu.Root, { children: [_jsx(Menu.Trigger, { render: _jsx(Button, { size: "tiny-icon", variant: "text", color: "gray", children: _jsx(EllipsisVerticalIcon, {}) }) }), _jsx(Menu.Positioner, { align: "start", children: menuSections.map((section, index) => (_jsxs(_Fragment, { children: [section, index < menuSections.length - 1 && _jsx(Menu.Separator, {})] }))) })] }));
71
- }
72
- // Special memoized wrapper for our table body that we will use during column resizing
73
- export const MemoizedTableBody = memo(TableBody, (prev, next) => prev.table.options.data === next.table.options.data);
74
- export { Table };
75
- //# sourceMappingURL=table.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/components/table/table.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,GAGX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAMxC,SAAS,KAAK,CAAQ,KAAmB;IACvC,MAAM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AE,KAAK,EAAE,CAAC"}
@@ -1,11 +0,0 @@
1
- declare const dismiss: (id?: number | string) => string | number;
2
- declare function toast(toastProps: ToastProps): string | number;
3
- interface ToastProps {
4
- title: string;
5
- description?: string;
6
- action?: {
7
- label: string;
8
- onClick: () => void;
9
- };
10
- }
11
- export { toast, dismiss };
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { toast as sonnerToast } from "sonner";
3
- import { Button } from "../button/button.js";
4
- const dismiss = sonnerToast.dismiss;
5
- function toast(toastProps) {
6
- return sonnerToast.custom(() => _jsx(Toast, { ...toastProps }));
7
- }
8
- function Toast(props) {
9
- const { title, description, action } = props;
10
- return (_jsxs("div", { className: "flex rounded-lg bg-gray-100 text-gray-dark shadow-lg border border-gray-200 w-full md:max-w-[364px] items-center py-3 px-4", children: [_jsx("div", { className: "flex flex-1 items-center", children: _jsxs("div", { className: "w-full", children: [_jsx("p", { className: "text-sm font-medium text-gray-900", children: title }), _jsx("p", { className: "mt-1 text-sm text-gray-600", children: description })] }) }), _jsx("div", { className: "ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden", children: action && (_jsx(Button, { variant: "text", size: "small", onClick: () => {
11
- action.onClick();
12
- }, children: action.label })) })] }));
13
- }
14
- export { toast, dismiss };
15
- //# sourceMappingURL=toast.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/components/toast/toast.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;AAEpC,SAAS,KAAK,CAAC,UAAsB;IACnC,OAAO,WAAW,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAC,KAAK,OAAK,UAAU,GAAI,CAAC,CAAC;AAC7D,CAAC;AAWD,SAAS,KAAK,CAAC,KAAiB;IAC9B,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE7C,OAAO,CACL,eAAK,SAAS,EAAC,4HAA4H,aACzI,cAAK,SAAS,EAAC,0BAA0B,YACvC,eAAK,SAAS,EAAC,QAAQ,aACrB,YAAG,SAAS,EAAC,mCAAmC,YAAE,KAAK,GAAK,EAC5D,YAAG,SAAS,EAAC,4BAA4B,YAAE,WAAW,GAAK,IACvD,GACF,EACN,cAAK,SAAS,EAAC,gKAAgK,YAC5K,MAAM,IAAI,CACT,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;wBACZ,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,CAAC,YAEA,MAAM,CAAC,KAAK,GACN,CACV,GACG,IACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export * as Button from "./components/button/button.js";
2
- export * as Callout from "./components/callout/callout.js";
3
- export * as Card from "./components/card/card.js";
4
- export * as Checkbox from "./components/checkbox/checkbox.js";
5
- export * as Field from "./components/field/field.js";
6
- export * as Input from "./components/input/input.js";
7
- export * as Menu from "./components/menu/menu.js";
8
- export * as Select from "./components/select/select.js";
9
- export * as Table from "./components/table/table.js";
10
- export * as Toast from "./components/toast/toast.js";
package/dist/index.js DELETED
@@ -1,11 +0,0 @@
1
- export * as Button from "./components/button/button.js";
2
- export * as Callout from "./components/callout/callout.js";
3
- export * as Card from "./components/card/card.js";
4
- export * as Checkbox from "./components/checkbox/checkbox.js";
5
- export * as Field from "./components/field/field.js";
6
- export * as Input from "./components/input/input.js";
7
- export * as Menu from "./components/menu/menu.js";
8
- export * as Select from "./components/select/select.js";
9
- export * as Table from "./components/table/table.js";
10
- export * as Toast from "./components/toast/toast.js";
11
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AACxD,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type ClassValue } from "clsx";
2
- export declare function cn(...inputs: ClassValue[]): string;
package/dist/lib/utils.js DELETED
@@ -1,6 +0,0 @@
1
- import { clsx } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
- export function cn(...inputs) {
4
- return twMerge(clsx(inputs));
5
- }
6
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,IAAI,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,UAAU,EAAE,CAAC,GAAG,MAAoB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/B,CAAC"}