@nurix/ui-component-library 1.1.4 → 1.1.6

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/dist/index.d.mts CHANGED
@@ -1,5 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React$1 from 'react';
2
3
 
4
+ type Theme = "dark" | "light" | "system";
5
+ type ThemeProviderProps = {
6
+ children: React.ReactNode;
7
+ defaultTheme?: Theme;
8
+ storageKey?: string;
9
+ };
10
+ declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
11
+
3
12
  type ButtonBorderRadius = "none" | "soft" | "rounded" | "pill";
4
13
  type ButtonVariant = "primary" | "destructive" | "outline" | "secondary" | "link";
5
14
  type ButtonSize = "default" | "sm" | "lg" | "icon";
@@ -16,4 +25,4 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
16
25
 
17
26
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
18
27
 
19
- export { Button, type ButtonProps };
28
+ export { Button, type ButtonProps, ThemeProvider };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React$1 from 'react';
2
3
 
4
+ type Theme = "dark" | "light" | "system";
5
+ type ThemeProviderProps = {
6
+ children: React.ReactNode;
7
+ defaultTheme?: Theme;
8
+ storageKey?: string;
9
+ };
10
+ declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
11
+
3
12
  type ButtonBorderRadius = "none" | "soft" | "rounded" | "pill";
4
13
  type ButtonVariant = "primary" | "destructive" | "outline" | "secondary" | "link";
5
14
  type ButtonSize = "default" | "sm" | "lg" | "icon";
@@ -16,4 +25,4 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
16
25
 
17
26
  declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
18
27
 
19
- export { Button, type ButtonProps };
28
+ export { Button, type ButtonProps, ThemeProvider };
package/dist/index.js CHANGED
@@ -30,51 +30,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
- Button: () => Button
33
+ Button: () => Button,
34
+ ThemeProvider: () => ThemeProvider
34
35
  });
35
36
  module.exports = __toCommonJS(index_exports);
36
37
 
37
- // src/button/button.tsx
38
- var React = __toESM(require("react"));
39
- var import_react_slot = require("@radix-ui/react-slot");
40
-
41
- // src/button/ButtonToken.ts
42
- var BUTTON_TOKENS = {
43
- base: "relative inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none [&>svg]:h-4 [&>svg]:w-4",
44
- hoverOverlay: "overflow-hidden after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:bg-black/10 after:opacity-0 after:transition-opacity hover:after:opacity-100",
45
- variant: {
46
- primary: "bg-primary text-primary-foreground disabled:opacity-50",
47
- secondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-background disabled:opacity-100",
48
- destructive: "bg-destructive text-destructive-foreground disabled:opacity-50",
49
- outline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100",
50
- link: "bg-transparent text-foreground hover:text-primary disabled:text-muted-foreground disabled:opacity-100",
51
- // Icon-only variants (pair with size `icon` / `iconSm`)
52
- iconPrimary: "bg-primary text-primary-foreground disabled:opacity-50",
53
- iconSecondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-secondary disabled:opacity-100",
54
- iconOutline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100"
55
- },
56
- size: {
57
- default: "h-10 px-4 py-2",
58
- sm: "h-9 px-3",
59
- lg: "h-10 px-8",
60
- icon: "h-10 w-10",
61
- iconSm: "h-9 w-9"
62
- },
63
- radius: {
64
- none: `4px`,
65
- soft: `4px`,
66
- rounded: `4px`,
67
- pill: `9999px`
68
- }
69
- };
70
-
71
- // src/lib/utils.ts
72
- var import_clsx = require("clsx");
73
- var import_tailwind_merge = require("tailwind-merge");
74
- function cn(...inputs) {
75
- return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
76
- }
77
-
78
38
  // src/theme/theme-provider.tsx
79
39
  var import_react = require("react");
80
40
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -134,6 +94,47 @@ function ThemeProvider({
134
94
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeProviderContext.Provider, { ...props, value, children });
135
95
  }
136
96
 
97
+ // src/button/button.tsx
98
+ var React = __toESM(require("react"));
99
+ var import_react_slot = require("@radix-ui/react-slot");
100
+
101
+ // src/button/ButtonToken.ts
102
+ var BUTTON_TOKENS = {
103
+ base: "relative inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none [&>svg]:h-4 [&>svg]:w-4",
104
+ hoverOverlay: "overflow-hidden after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:bg-black/10 after:opacity-0 after:transition-opacity hover:after:opacity-100",
105
+ variant: {
106
+ primary: "bg-primary text-primary-foreground disabled:opacity-50",
107
+ secondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-background disabled:opacity-100",
108
+ destructive: "bg-destructive text-destructive-foreground disabled:opacity-50",
109
+ outline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100",
110
+ link: "bg-transparent text-foreground hover:text-primary disabled:text-muted-foreground disabled:opacity-100",
111
+ // Icon-only variants (pair with size `icon` / `iconSm`)
112
+ iconPrimary: "bg-primary text-primary-foreground disabled:opacity-50",
113
+ iconSecondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-secondary disabled:opacity-100",
114
+ iconOutline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100"
115
+ },
116
+ size: {
117
+ default: "h-10 px-4 py-2",
118
+ sm: "h-9 px-3",
119
+ lg: "h-10 px-8",
120
+ icon: "h-10 w-10",
121
+ iconSm: "h-9 w-9"
122
+ },
123
+ radius: {
124
+ none: `4px`,
125
+ soft: `4px`,
126
+ rounded: `4px`,
127
+ pill: `9999px`
128
+ }
129
+ };
130
+
131
+ // src/lib/utils.ts
132
+ var import_clsx = require("clsx");
133
+ var import_tailwind_merge = require("tailwind-merge");
134
+ function cn(...inputs) {
135
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
136
+ }
137
+
137
138
  // src/button/button.tsx
138
139
  var import_jsx_runtime2 = require("react/jsx-runtime");
139
140
  var Button = React.forwardRef(
@@ -169,5 +170,6 @@ var Button = React.forwardRef(
169
170
  Button.displayName = "Button";
170
171
  // Annotate the CommonJS export names for ESM import in node:
171
172
  0 && (module.exports = {
172
- Button
173
+ Button,
174
+ ThemeProvider
173
175
  });
package/dist/index.mjs CHANGED
@@ -1,44 +1,3 @@
1
- // src/button/button.tsx
2
- import * as React from "react";
3
- import { Slot } from "@radix-ui/react-slot";
4
-
5
- // src/button/ButtonToken.ts
6
- var BUTTON_TOKENS = {
7
- base: "relative inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none [&>svg]:h-4 [&>svg]:w-4",
8
- hoverOverlay: "overflow-hidden after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:bg-black/10 after:opacity-0 after:transition-opacity hover:after:opacity-100",
9
- variant: {
10
- primary: "bg-primary text-primary-foreground disabled:opacity-50",
11
- secondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-background disabled:opacity-100",
12
- destructive: "bg-destructive text-destructive-foreground disabled:opacity-50",
13
- outline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100",
14
- link: "bg-transparent text-foreground hover:text-primary disabled:text-muted-foreground disabled:opacity-100",
15
- // Icon-only variants (pair with size `icon` / `iconSm`)
16
- iconPrimary: "bg-primary text-primary-foreground disabled:opacity-50",
17
- iconSecondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-secondary disabled:opacity-100",
18
- iconOutline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100"
19
- },
20
- size: {
21
- default: "h-10 px-4 py-2",
22
- sm: "h-9 px-3",
23
- lg: "h-10 px-8",
24
- icon: "h-10 w-10",
25
- iconSm: "h-9 w-9"
26
- },
27
- radius: {
28
- none: `4px`,
29
- soft: `4px`,
30
- rounded: `4px`,
31
- pill: `9999px`
32
- }
33
- };
34
-
35
- // src/lib/utils.ts
36
- import { clsx } from "clsx";
37
- import { twMerge } from "tailwind-merge";
38
- function cn(...inputs) {
39
- return twMerge(clsx(inputs));
40
- }
41
-
42
1
  // src/theme/theme-provider.tsx
43
2
  import { createContext, useContext, useEffect, useState } from "react";
44
3
  import { jsx } from "react/jsx-runtime";
@@ -98,6 +57,47 @@ function ThemeProvider({
98
57
  return /* @__PURE__ */ jsx(ThemeProviderContext.Provider, { ...props, value, children });
99
58
  }
100
59
 
60
+ // src/button/button.tsx
61
+ import * as React from "react";
62
+ import { Slot } from "@radix-ui/react-slot";
63
+
64
+ // src/button/ButtonToken.ts
65
+ var BUTTON_TOKENS = {
66
+ base: "relative inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none [&>svg]:h-4 [&>svg]:w-4",
67
+ hoverOverlay: "overflow-hidden after:content-[''] after:absolute after:inset-0 after:pointer-events-none after:rounded-[inherit] after:bg-black/10 after:opacity-0 after:transition-opacity hover:after:opacity-100",
68
+ variant: {
69
+ primary: "bg-primary text-primary-foreground disabled:opacity-50",
70
+ secondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-background disabled:opacity-100",
71
+ destructive: "bg-destructive text-destructive-foreground disabled:opacity-50",
72
+ outline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100",
73
+ link: "bg-transparent text-foreground hover:text-primary disabled:text-muted-foreground disabled:opacity-100",
74
+ // Icon-only variants (pair with size `icon` / `iconSm`)
75
+ iconPrimary: "bg-primary text-primary-foreground disabled:opacity-50",
76
+ iconSecondary: "bg-secondary text-secondary-foreground disabled:bg-muted-foreground disabled:text-secondary disabled:opacity-100",
77
+ iconOutline: "border border-border bg-transparent text-foreground hover:bg-foreground/5 disabled:border-[#b2b2b2] disabled:text-[#b2b2b2] disabled:opacity-100"
78
+ },
79
+ size: {
80
+ default: "h-10 px-4 py-2",
81
+ sm: "h-9 px-3",
82
+ lg: "h-10 px-8",
83
+ icon: "h-10 w-10",
84
+ iconSm: "h-9 w-9"
85
+ },
86
+ radius: {
87
+ none: `4px`,
88
+ soft: `4px`,
89
+ rounded: `4px`,
90
+ pill: `9999px`
91
+ }
92
+ };
93
+
94
+ // src/lib/utils.ts
95
+ import { clsx } from "clsx";
96
+ import { twMerge } from "tailwind-merge";
97
+ function cn(...inputs) {
98
+ return twMerge(clsx(inputs));
99
+ }
100
+
101
101
  // src/button/button.tsx
102
102
  import { jsx as jsx2 } from "react/jsx-runtime";
103
103
  var Button = React.forwardRef(
@@ -132,5 +132,6 @@ var Button = React.forwardRef(
132
132
  );
133
133
  Button.displayName = "Button";
134
134
  export {
135
- Button
135
+ Button,
136
+ ThemeProvider
136
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nurix/ui-component-library",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [