luna-components-library 1.1.7 → 1.1.10
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 +121 -1
- package/dist/luna-components-library.js +68 -2
- package/dist/luna-components-library.js.map +1 -1
- package/dist/src/components/Accordion.d.ts +13 -0
- package/dist/src/components/DropDown.d.ts +9 -0
- package/dist/src/components/ProgressBar.d.ts +8 -0
- package/dist/src/components/Spinner.d.ts +5 -0
- package/dist/src/components/index.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ module.exports = {
|
|
|
44
44
|
## 🚀 Quick Start
|
|
45
45
|
|
|
46
46
|
```jsx
|
|
47
|
-
import { Button, Card } from 'luna-components-library';
|
|
47
|
+
import { Button, Card, Anchor, Accordion, Spinner, DropDown, ProgressBar } from 'luna-components-library';
|
|
48
48
|
|
|
49
49
|
function App() {
|
|
50
50
|
return (
|
|
@@ -68,6 +68,34 @@ function App() {
|
|
|
68
68
|
Learn More
|
|
69
69
|
</Button>
|
|
70
70
|
</Card>
|
|
71
|
+
|
|
72
|
+
<Anchor href="https://example.com" variant="secondary">
|
|
73
|
+
Visit Example
|
|
74
|
+
</Anchor>
|
|
75
|
+
|
|
76
|
+
<Accordion
|
|
77
|
+
key="demo"
|
|
78
|
+
active={false}
|
|
79
|
+
onClick={() => console.log('Toggle')}
|
|
80
|
+
header={<h3>Click to expand</h3>}
|
|
81
|
+
content={<p>This is the accordion content!</p>}
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
<Spinner />
|
|
85
|
+
|
|
86
|
+
<DropDown
|
|
87
|
+
toggle={<button>Select Option</button>}
|
|
88
|
+
options={['Option 1', 'Option 2', 'Option 3']}
|
|
89
|
+
selected="Option 1"
|
|
90
|
+
onChange={(value) => console.log('Selected:', value)}
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<ProgressBar
|
|
94
|
+
progress={60}
|
|
95
|
+
max={100}
|
|
96
|
+
min={0}
|
|
97
|
+
aria-label="Upload progress"
|
|
98
|
+
/>
|
|
71
99
|
</div>
|
|
72
100
|
);
|
|
73
101
|
}
|
|
@@ -124,6 +152,93 @@ A flexible card component for displaying content with various padding and shadow
|
|
|
124
152
|
- `padding?: 'none' | 'sm' | 'md' | 'lg'` - Internal padding (default: 'md')
|
|
125
153
|
- `shadow?: 'none' | 'sm' | 'md' | 'lg'` - Shadow depth (default: 'md')
|
|
126
154
|
|
|
155
|
+
### Anchor
|
|
156
|
+
A styled link component that opens in a new tab with customizable variants and sizes.
|
|
157
|
+
|
|
158
|
+
```jsx
|
|
159
|
+
<Anchor
|
|
160
|
+
href="https://example.com"
|
|
161
|
+
variant="primary"
|
|
162
|
+
size="sm"
|
|
163
|
+
className="custom-anchor"
|
|
164
|
+
>
|
|
165
|
+
Link Text
|
|
166
|
+
</Anchor>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Props:**
|
|
170
|
+
- `children?: React.ReactNode` - Link content (default: "Pablo Andrey Chacon Luna")
|
|
171
|
+
- `variant?: 'primary' | 'secondary' | 'outline'` - Link style (default: 'primary')
|
|
172
|
+
- `size?: 'sm' | 'md' | 'lg'` - Link size (default: 'sm')
|
|
173
|
+
- `href?: string` - URL to link to (default: 'https://andreychaconresumereact.netlify.app/')
|
|
174
|
+
- `className?: string` - Additional CSS classes
|
|
175
|
+
|
|
176
|
+
### Accordion
|
|
177
|
+
A collapsible content component with customizable header and content sections.
|
|
178
|
+
|
|
179
|
+
```jsx
|
|
180
|
+
<Accordion
|
|
181
|
+
key="accordion-1"
|
|
182
|
+
active={isActive}
|
|
183
|
+
onClick={() => setIsActive(!isActive)}
|
|
184
|
+
header={<h3>Accordion Title</h3>}
|
|
185
|
+
content={<p>Accordion content goes here</p>}
|
|
186
|
+
/>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Props:**
|
|
190
|
+
- `key: string` - Unique identifier for the accordion
|
|
191
|
+
- `active: boolean` - Whether the accordion is expanded
|
|
192
|
+
- `onClick: () => void` - Toggle function
|
|
193
|
+
- `header: React.ReactNode` - Header content
|
|
194
|
+
- `content: React.ReactNode` - Content to show when expanded
|
|
195
|
+
|
|
196
|
+
### Spinner
|
|
197
|
+
A loading spinner component with customizable styling.
|
|
198
|
+
|
|
199
|
+
```jsx
|
|
200
|
+
<Spinner className="custom-spinner" />
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Props:**
|
|
204
|
+
- `className?: string` - Additional CSS classes (default: "spinner-border")
|
|
205
|
+
|
|
206
|
+
### DropDown
|
|
207
|
+
A dropdown menu component with customizable toggle and options.
|
|
208
|
+
|
|
209
|
+
```jsx
|
|
210
|
+
<DropDown
|
|
211
|
+
toggle={<button>Menu</button>}
|
|
212
|
+
options={['Option 1', 'Option 2', 'Option 3']}
|
|
213
|
+
selected="Option 1"
|
|
214
|
+
onChange={(value) => console.log('Selected:', value)}
|
|
215
|
+
/>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Props:**
|
|
219
|
+
- `toggle: React.ReactNode` - Toggle button/element
|
|
220
|
+
- `options: React.ReactNode[]` - Array of options
|
|
221
|
+
- `selected: React.ReactNode` - Currently selected option
|
|
222
|
+
- `onChange: (value: React.ReactNode) => void` - Selection change handler
|
|
223
|
+
|
|
224
|
+
### ProgressBar
|
|
225
|
+
A progress bar component with customizable progress values and accessibility.
|
|
226
|
+
|
|
227
|
+
```jsx
|
|
228
|
+
<ProgressBar
|
|
229
|
+
progress={75}
|
|
230
|
+
max={100}
|
|
231
|
+
min={0}
|
|
232
|
+
aria-label="Loading progress"
|
|
233
|
+
/>
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Props:**
|
|
237
|
+
- `progress: number` - Current progress value
|
|
238
|
+
- `max: number` - Maximum progress value
|
|
239
|
+
- `min: number` - Minimum progress value
|
|
240
|
+
- `aria-label: string` - Accessibility label
|
|
241
|
+
|
|
127
242
|
## 🛠️ Development
|
|
128
243
|
|
|
129
244
|
### Prerequisites
|
|
@@ -158,6 +273,11 @@ luna-library/
|
|
|
158
273
|
│ ├── components/
|
|
159
274
|
│ │ ├── Button.tsx
|
|
160
275
|
│ │ ├── Card.tsx
|
|
276
|
+
│ │ ├── Anchor.tsx
|
|
277
|
+
│ │ ├── Accordion.tsx
|
|
278
|
+
│ │ ├── Spinner.tsx
|
|
279
|
+
│ │ ├── DropDown.tsx
|
|
280
|
+
│ │ ├── ProgressBar.tsx
|
|
161
281
|
│ │ └── index.ts
|
|
162
282
|
│ └── index.ts
|
|
163
283
|
├── dist/ # Build output
|
|
@@ -92,7 +92,7 @@ var Card = ({ children, title, className = "", padding = "md", shadow = "md" })
|
|
|
92
92
|
};
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/components/Anchor.tsx
|
|
95
|
-
var Anchor = ({ children = "Pablo Andrey Chacon Luna", variant = "primary", size = "sm", href, className }) => {
|
|
95
|
+
var Anchor = ({ children = "Pablo Andrey Chacon Luna", variant = "primary", size = "sm", href = "https://andreychaconresumereact.netlify.app/", className }) => {
|
|
96
96
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
97
97
|
href,
|
|
98
98
|
target: "_blank",
|
|
@@ -115,6 +115,72 @@ var Anchor = ({ children = "Pablo Andrey Chacon Luna", variant = "primary", size
|
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
//#endregion
|
|
118
|
-
|
|
118
|
+
//#region src/components/Accordion.tsx
|
|
119
|
+
var Accordion = ({ key, active, onClick, header, content }) => {
|
|
120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: header }), content] });
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/Spinner.tsx
|
|
124
|
+
var Spinner = ({ className }) => {
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
126
|
+
role: "status",
|
|
127
|
+
className: className || "spinner-border",
|
|
128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
129
|
+
className: "visually-hidden",
|
|
130
|
+
children: "Loading..."
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/components/DropDown.tsx
|
|
136
|
+
var DropDown = ({ toggle, options, selected, onChange }) => {
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
138
|
+
className: "show dropdown",
|
|
139
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
140
|
+
type: "button",
|
|
141
|
+
id: "dropdown-basic",
|
|
142
|
+
"aria-expanded": "true",
|
|
143
|
+
className: "dropdown-toggle show btn btn-success",
|
|
144
|
+
children: selected
|
|
145
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
146
|
+
"x-placement": "bottom-start",
|
|
147
|
+
"aria-labelledby": "dropdown-basic",
|
|
148
|
+
className: "dropdown-menu show",
|
|
149
|
+
"data-popper-reference-hidden": "false",
|
|
150
|
+
"data-popper-escaped": "false",
|
|
151
|
+
"data-popper-placement": "bottom-start",
|
|
152
|
+
style: {
|
|
153
|
+
position: "absolute",
|
|
154
|
+
inset: "0px auto auto 0px",
|
|
155
|
+
transform: "translate3d(0px, 39.3333px, 0px)"
|
|
156
|
+
},
|
|
157
|
+
children: options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
158
|
+
href: "#/action-1",
|
|
159
|
+
"data-rr-ui-dropdown-item": "",
|
|
160
|
+
className: "dropdown-item",
|
|
161
|
+
onClick: () => onChange(option),
|
|
162
|
+
children: option
|
|
163
|
+
}, index))
|
|
164
|
+
})]
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/components/ProgressBar.tsx
|
|
169
|
+
var ProgressBar = ({ progress, max, min, "aria-label": ariaLabel }) => {
|
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
171
|
+
className: "progress",
|
|
172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
173
|
+
role: "progressbar",
|
|
174
|
+
className: "progress-bar",
|
|
175
|
+
"aria-valuenow": progress,
|
|
176
|
+
"aria-valuemin": min,
|
|
177
|
+
"aria-valuemax": max,
|
|
178
|
+
style: { width: `${progress}%` },
|
|
179
|
+
children: [progress, "%"]
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
//#endregion
|
|
184
|
+
export { Accordion, Anchor, Button, Card, DropDown, ProgressBar, Spinner };
|
|
119
185
|
|
|
120
186
|
//# sourceMappingURL=luna-components-library.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"luna-components-library.js","names":[],"sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/jsx-runtime.js","../src/components/Button.tsx","../src/components/Card.tsx","../src/components/Anchor.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import React from 'react';\n\nexport interface ButtonProps {\n children: React.ReactNode;\n variant?: 'primary' | 'secondary' | 'outline';\n size?: 'sm' | 'md' | 'lg';\n onClick?: () => void;\n disabled?: boolean;\n className?: string;\n}\n\n{/* onCLick default should open window.open('https://andreychaconresumereact.netlify.app/', '_blank') */ }\n\nconst Button = ({\n children,\n variant = 'primary',\n size = 'sm',\n onClick = () =>\n void 0,\n disabled = false,\n className = '',\n}: ButtonProps) => {\n const baseClasses = 'font-medium rounded-lg transition-colors focus:outline-none focus:ring-2';\n\n const variantClasses = {\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\n outline: 'border border-gray-300 text-gray-700 hover:bg-gray-50 focus:ring-gray-500',\n };\n\n const sizeClasses = {\n sm: 'px-3 py-1.5 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg',\n };\n\n const classes = `\n ${baseClasses}\n ${variantClasses[variant]}\n ${sizeClasses[size]}\n ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\n ${className}\n `.trim();\n\n return (\n <button\n className={classes}\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n","import React from 'react';\n\nexport interface CardProps {\n children: React.ReactNode;\n title?: string;\n className?: string;\n padding?: 'none' | 'sm' | 'md' | 'lg';\n shadow?: 'none' | 'sm' | 'md' | 'lg';\n}\n\nconst Card = ({\n children,\n title,\n className = '',\n padding = 'md',\n shadow = 'md',\n}: CardProps) => {\n const baseClasses = 'bg-white rounded-lg border border-gray-200';\n\n const paddingClasses = {\n none: '',\n sm: 'p-3',\n md: 'p-4',\n lg: 'p-6',\n };\n\n const shadowClasses = {\n none: '',\n sm: 'shadow-sm',\n md: 'shadow-md',\n lg: 'shadow-lg',\n };\n\n const classes = `\n ${baseClasses}\n ${paddingClasses[padding]}\n ${shadowClasses[shadow]}\n ${className}\n `.trim();\n\n return (\n <div className={classes}>\n {title && (\n <div className=\"mb-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">{title}</h3>\n </div>\n )}\n {children}\n </div>\n );\n};\n\nexport default Card;\n","type AnchorProps = {\r\n children?: React.ReactNode;\r\n variant?: 'primary' | 'secondary' | 'outline';\r\n size?: 'sm' | 'md' | 'lg';\r\n href?: string;\r\n className?: string;\r\n}\r\n\r\nconst Anchor = ({\r\n children = \"Pablo Andrey Chacon Luna\",\r\n variant = 'primary',\r\n size = 'sm',\r\n href,\r\n className,\r\n}: AnchorProps) => {\r\n\r\n const baseClasses = 'font-medium rounded-lg transition-colors focus:outline-none focus:ring-2';\r\n\r\n const variantClasses = {\r\n primary: 'bg-blue-600 text-white hover:bg-blue-700',\r\n secondary: 'bg-gray-600 text-white hover:bg-gray-700',\r\n outline: 'border border-gray-300 text-gray-700 hover:bg-gray-50',\r\n };\r\n\r\n const sizeClasses = {\r\n sm: 'px-3 py-1.5 text-sm',\r\n md: 'px-4 py-2 text-base',\r\n lg: 'px-6 py-3 text-lg',\r\n };\r\n\r\n const classes = `\r\n ${baseClasses}\r\n ${variantClasses[variant]}\r\n ${sizeClasses[size]}\r\n ${className}\r\n `.trim();\r\n\r\n return (\r\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\" className={classes}>\r\n {children}\r\n </a>\r\n );\r\n};\r\n\r\nexport default Anchor;"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;CAWA,IAAI,qBAAqB,OAAO,IAAI,6BAA6B;CAEjE,SAAS,QAAQ,MAAM,QAAQ,UAAU;EACvC,IAAI,MAAM;EACV,KAAK,MAAM,aAAa,MAAM,KAAK;EACnC,KAAK,MAAM,OAAO,QAAQ,MAAM,KAAK,OAAO;EAC5C,IAAI,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C;;MAEZ;GAbF,SAAS;GACT,WAAW;GACX,SAAS;GAWP,CAAe,SAAS;MACxB;GARF,IAAI;GACJ,IAAI;GACJ,IAAI;GAMF,CAAY,MAAM;MAClB,UAAU;IACZ,MAGoE;EACjE;EACC,CAAA"}
|
|
1
|
+
{"version":3,"file":"luna-components-library.js","names":[],"sources":["../node_modules/react/cjs/react-jsx-runtime.production.js","../node_modules/react/jsx-runtime.js","../src/components/Button.tsx","../src/components/Card.tsx","../src/components/Anchor.tsx","../src/components/Accordion.tsx","../src/components/Spinner.tsx","../src/components/DropDown.tsx","../src/components/ProgressBar.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import React from 'react';\n\nexport interface ButtonProps {\n children: React.ReactNode;\n variant?: 'primary' | 'secondary' | 'outline';\n size?: 'sm' | 'md' | 'lg';\n onClick?: () => void;\n disabled?: boolean;\n className?: string;\n}\n\n{/* onCLick default should open window.open('https://andreychaconresumereact.netlify.app/', '_blank') */ }\n\nconst Button = ({\n children,\n variant = 'primary',\n size = 'sm',\n onClick = () =>\n void 0,\n disabled = false,\n className = '',\n}: ButtonProps) => {\n const baseClasses = 'font-medium rounded-lg transition-colors focus:outline-none focus:ring-2';\n\n const variantClasses = {\n primary: 'bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500',\n secondary: 'bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500',\n outline: 'border border-gray-300 text-gray-700 hover:bg-gray-50 focus:ring-gray-500',\n };\n\n const sizeClasses = {\n sm: 'px-3 py-1.5 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg',\n };\n\n const classes = `\n ${baseClasses}\n ${variantClasses[variant]}\n ${sizeClasses[size]}\n ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\n ${className}\n `.trim();\n\n return (\n <button\n className={classes}\n onClick={onClick}\n disabled={disabled}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n","import React from 'react';\n\nexport interface CardProps {\n children: React.ReactNode;\n title?: string;\n className?: string;\n padding?: 'none' | 'sm' | 'md' | 'lg';\n shadow?: 'none' | 'sm' | 'md' | 'lg';\n}\n\nconst Card = ({\n children,\n title,\n className = '',\n padding = 'md',\n shadow = 'md',\n}: CardProps) => {\n const baseClasses = 'bg-white rounded-lg border border-gray-200';\n\n const paddingClasses = {\n none: '',\n sm: 'p-3',\n md: 'p-4',\n lg: 'p-6',\n };\n\n const shadowClasses = {\n none: '',\n sm: 'shadow-sm',\n md: 'shadow-md',\n lg: 'shadow-lg',\n };\n\n const classes = `\n ${baseClasses}\n ${paddingClasses[padding]}\n ${shadowClasses[shadow]}\n ${className}\n `.trim();\n\n return (\n <div className={classes}>\n {title && (\n <div className=\"mb-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">{title}</h3>\n </div>\n )}\n {children}\n </div>\n );\n};\n\nexport default Card;\n","type AnchorProps = {\r\n children?: React.ReactNode;\r\n variant?: 'primary' | 'secondary' | 'outline';\r\n size?: 'sm' | 'md' | 'lg';\r\n href?: string;\r\n className?: string;\r\n}\r\n\r\nconst Anchor = ({\r\n children = \"Pablo Andrey Chacon Luna\",\r\n variant = 'primary',\r\n size = 'sm',\r\n href = 'https://andreychaconresumereact.netlify.app/',\r\n className,\r\n}: AnchorProps) => {\r\n\r\n const baseClasses = 'font-medium rounded-lg transition-colors focus:outline-none focus:ring-2';\r\n\r\n const variantClasses = {\r\n primary: 'bg-blue-600 text-white hover:bg-blue-700',\r\n secondary: 'bg-gray-600 text-white hover:bg-gray-700',\r\n outline: 'border border-gray-300 text-gray-700 hover:bg-gray-50',\r\n };\r\n\r\n const sizeClasses = {\r\n sm: 'px-3 py-1.5 text-sm',\r\n md: 'px-4 py-2 text-base',\r\n lg: 'px-6 py-3 text-lg',\r\n };\r\n\r\n const classes = `\r\n ${baseClasses}\r\n ${variantClasses[variant]}\r\n ${sizeClasses[size]}\r\n ${className}\r\n `.trim();\r\n\r\n return (\r\n <a href={href} target=\"_blank\" rel=\"noopener noreferrer\" className={classes}>\r\n {children}\r\n </a>\r\n );\r\n};\r\n\r\nexport default Anchor;","\r\nimport React from 'react';\r\n\r\n/**\r\n * must have key, active, onClick, header, content body\r\n */\r\ninterface AccordionProps {\r\n key: string;\r\n active: boolean;\r\n onClick: () => void;\r\n header: React.ReactNode;\r\n content: React.ReactNode;\r\n}\r\n\r\nconst Accordion = ({ key, active, onClick, header, content }: AccordionProps) => {\r\n return (\r\n <div>\r\n <h2>{header}</h2>\r\n {content}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Accordion;","import React from 'react';\r\n\r\n{/* must have animation,role, className */ }\r\ntype SpinnerProps = {\r\n className?: string;\r\n};\r\n\r\nconst Spinner = ({ className }: SpinnerProps) => {\r\n const spinnerClass = className || \"spinner-border\";\r\n return (\r\n <div role=\"status\" className={spinnerClass}>\r\n <span className=\"visually-hidden\">Loading...</span>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Spinner;","{/* must have toggle, options, selected, onChange */ }\r\nimport React from 'react';\r\n\r\ntype DropDownProps = {\r\n toggle: React.ReactNode;\r\n options: React.ReactNode[];\r\n selected: React.ReactNode;\r\n onChange: (value: React.ReactNode) => void;\r\n};\r\n\r\nconst DropDown = ({ toggle, options, selected, onChange }: DropDownProps) => {\r\n return (\r\n <div className=\"show dropdown\">\r\n <button type=\"button\" id=\"dropdown-basic\" aria-expanded=\"true\" className=\"dropdown-toggle show btn btn-success\">\r\n {selected}\r\n </button>\r\n <div\r\n x-placement=\"bottom-start\"\r\n aria-labelledby=\"dropdown-basic\"\r\n className=\"dropdown-menu show\"\r\n data-popper-reference-hidden=\"false\"\r\n data-popper-escaped=\"false\"\r\n data-popper-placement=\"bottom-start\"\r\n style={{ position: 'absolute', inset: '0px auto auto 0px', transform: 'translate3d(0px, 39.3333px, 0px)' }}\r\n >\r\n {options.map((option, index) => (\r\n <a key={index} href=\"#/action-1\" data-rr-ui-dropdown-item=\"\" className=\"dropdown-item\" onClick={() => onChange(option)}>\r\n {option}\r\n </a>\r\n ))}\r\n\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default DropDown;","{/* must have progress, max, min, aria-label */ }\r\nimport React from 'react';\r\n\r\ntype ProgressBarProps = {\r\n progress: number;\r\n max: number;\r\n min: number;\r\n 'aria-label': string;\r\n};\r\n\r\nconst ProgressBar = ({ progress, max, min, 'aria-label': ariaLabel }: ProgressBarProps) => {\r\n return <div className=\"progress\">\r\n <div role=\"progressbar\" className=\"progress-bar\" aria-valuenow={progress} aria-valuemin={min} aria-valuemax={max} style={{ width: `${progress}%` }}>{progress}%</div>\r\n </div>;\r\n};\r\n\r\nexport default ProgressBar;"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;CAWA,IAAI,qBAAqB,OAAO,IAAI,6BAA6B;CAEjE,SAAS,QAAQ,MAAM,QAAQ,UAAU;EACvC,IAAI,MAAM;EACV,KAAK,MAAM,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tBV,IAAM,eAAe,EAAE,UAAU,KAAK,KAAK,cAAc,gBAAkC;CACzF,OAAO,iBAAA,GAAA,mBAAA,KAAC,OAAD;EAAK,WAAU;YACpB,iBAAA,GAAA,mBAAA,MAAC,OAAD;GAAK,MAAK;GAAc,WAAU;GAAe,iBAAe;GAAU,iBAAe;GAAK,iBAAe;GAAK,OAAO,EAAE,OAAO,GAAG,SAAS,IAAI;aAAlJ,CAAqJ,UAAS,IAAO;;EACjK,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* must have key, active, onClick, header, content body
|
|
4
|
+
*/
|
|
5
|
+
interface AccordionProps {
|
|
6
|
+
key: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
header: React.ReactNode;
|
|
10
|
+
content: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const Accordion: ({ key, active, onClick, header, content }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default Accordion;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type DropDownProps = {
|
|
3
|
+
toggle: React.ReactNode;
|
|
4
|
+
options: React.ReactNode[];
|
|
5
|
+
selected: React.ReactNode;
|
|
6
|
+
onChange: (value: React.ReactNode) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const DropDown: ({ toggle, options, selected, onChange }: DropDownProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default DropDown;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type ProgressBarProps = {
|
|
2
|
+
progress: number;
|
|
3
|
+
max: number;
|
|
4
|
+
min: number;
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
};
|
|
7
|
+
declare const ProgressBar: ({ progress, max, min, "aria-label": ariaLabel }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default ProgressBar;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { default as Button } from './Button';
|
|
2
2
|
export { default as Card } from './Card';
|
|
3
3
|
export { default as Anchor } from './Anchor';
|
|
4
|
+
export { default as Accordion } from './Accordion';
|
|
5
|
+
export { default as Spinner } from './Spinner';
|
|
6
|
+
export { default as DropDown } from './DropDown';
|
|
7
|
+
export { default as ProgressBar } from './ProgressBar';
|
package/package.json
CHANGED