@bertimatteodev/astra-ui 0.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 ADDED
@@ -0,0 +1,32 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
9
+
10
+ ## React Compiler
11
+
12
+ The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+
14
+ ## Expanding the Oxlint configuration
15
+
16
+ If you are developing a production application, we recommend enabling type-aware lint rules by installing `oxlint-tsgolint` and editing `.oxlintrc.json`:
17
+
18
+ ```json
19
+ {
20
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
21
+ "plugins": ["react", "typescript", "oxc"],
22
+ "options": {
23
+ "typeAware": true
24
+ },
25
+ "rules": {
26
+ "react/rules-of-hooks": "error",
27
+ "react/only-export-components": ["warn", { "allowConstantExport": true }]
28
+ }
29
+ }
30
+ ```
31
+
32
+ See the [Oxlint rules documentation](https://oxc.rs/docs/guide/usage/linter/rules) for the full list of rules and categories.
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime");var n={button:`_button_gjxjz_1`,sizeSm:`_sizeSm_gjxjz_31`,sizeMd:`_sizeMd_gjxjz_37`,sizeLg:`_sizeLg_gjxjz_42`,variantPrimary:`_variantPrimary_gjxjz_48`,variantSecondary:`_variantSecondary_gjxjz_57`,variantGhost:`_variantGhost_gjxjz_67`,variantDanger:`_variantDanger_gjxjz_76`,fullWidth:`_fullWidth_gjxjz_85`,loading:`_loading_gjxjz_89`,icon:`_icon_gjxjz_93`,label:`_label_gjxjz_106`,spinner:`_spinner_gjxjz_111`,spin:`_spin_gjxjz_111`},r={primary:n.variantPrimary,secondary:n.variantSecondary,ghost:n.variantGhost,danger:n.variantDanger},i={sm:n.sizeSm,md:n.sizeMd,lg:n.sizeLg};function a(...e){return e.filter(Boolean).join(` `)}var o=(0,e.forwardRef)(function({children:e,className:o,variant:s=`primary`,size:c=`md`,fullWidth:l=!1,isLoading:u=!1,startIcon:d,endIcon:f,disabled:p,type:m=`button`,...h},g){let _=p||u;return(0,t.jsxs)(`button`,{ref:g,type:m,className:a(n.button,r[s],i[c],l&&n.fullWidth,u&&n.loading,o),disabled:_,"aria-busy":u||void 0,...h,children:[u?(0,t.jsx)(`span`,{className:n.spinner,"aria-hidden":`true`}):null,!u&&d?(0,t.jsx)(`span`,{className:n.icon,"aria-hidden":`true`,children:d}):null,(0,t.jsx)(`span`,{className:n.label,children:e}),!u&&f?(0,t.jsx)(`span`,{className:n.icon,"aria-hidden":`true`,children:f}):null]})});o.displayName=`Button`;var s={card:`_card_1ex3y_1`,paddingNone:`_paddingNone_1ex3y_9`,paddingSm:`_paddingSm_1ex3y_13`,paddingMd:`_paddingMd_1ex3y_17`,paddingLg:`_paddingLg_1ex3y_21`,elevationNone:`_elevationNone_1ex3y_26`,elevationSm:`_elevationSm_1ex3y_30`,elevationMd:`_elevationMd_1ex3y_34`},c={none:s.paddingNone,sm:s.paddingSm,md:s.paddingMd,lg:s.paddingLg},l={none:s.elevationNone,sm:s.elevationSm,md:s.elevationMd};function u(...e){return e.filter(Boolean).join(` `)}var d=(0,e.forwardRef)(function({children:e,className:n,padding:r=`md`,elevation:i=`sm`,...a},o){return(0,t.jsx)(`div`,{ref:o,className:u(s.card,c[r],l[i],n),...a,children:e})});d.displayName=`Card`;var f={button:`_button_cnvt9_1`,sizeSm:`_sizeSm_cnvt9_27`,sizeMd:`_sizeMd_cnvt9_32`,sizeLg:`_sizeLg_cnvt9_37`,variantPrimary:`_variantPrimary_cnvt9_42`,variantSecondary:`_variantSecondary_cnvt9_51`,variantGhost:`_variantGhost_cnvt9_61`,variantDanger:`_variantDanger_cnvt9_70`,icon:`_icon_cnvt9_78`,spinner:`_spinner_cnvt9_90`,spin:`_spin_cnvt9_90`,loading:`_loading_cnvt9_99`},p={primary:f.variantPrimary,secondary:f.variantSecondary,ghost:f.variantGhost,danger:f.variantDanger},m={sm:f.sizeSm,md:f.sizeMd,lg:f.sizeLg};function h(...e){return e.filter(Boolean).join(` `)}var g=(0,e.forwardRef)(function({icon:e,label:n,className:r,variant:i=`secondary`,size:a=`md`,isLoading:o=!1,disabled:s,type:c=`button`,...l},u){let d=s||o;return(0,t.jsx)(`button`,{ref:u,type:c,className:h(f.button,p[i],m[a],o&&f.loading,r),disabled:d,"aria-label":n,"aria-busy":o||void 0,...l,children:o?(0,t.jsx)(`span`,{className:f.spinner,"aria-hidden":`true`}):(0,t.jsx)(`span`,{className:f.icon,"aria-hidden":`true`,children:e})})});g.displayName=`IconButton`;var _={field:`_field_1pq0j_1`,label:`_label_1pq0j_7`,required:`_required_1pq0j_14`,control:`_control_1pq0j_18`,input:`_input_1pq0j_37`,adornment:`_adornment_1pq0j_65`,hint:`_hint_1pq0j_79`,error:`_error_1pq0j_80`,hasError:`_hasError_1pq0j_94`,isDisabled:`_isDisabled_1pq0j_102`};function v(...e){return e.filter(Boolean).join(` `)}var y=(0,e.forwardRef)(function({id:n,label:r,hint:i,error:a,startAdornment:o,endAdornment:s,className:c,containerClassName:l,disabled:u,required:d,"aria-describedby":f,...p},m){let h=(0,e.useId)(),g=n??`text-field-${h}`,y=`${g}-hint`,b=`${g}-error`,x=[f,i?y:null,a?b:null].filter(Boolean).join(` `);return(0,t.jsxs)(`div`,{className:v(_.field,l),children:[r?(0,t.jsxs)(`label`,{className:_.label,htmlFor:g,children:[r,d?(0,t.jsxs)(`span`,{className:_.required,"aria-hidden":`true`,children:[` `,`*`]}):null]}):null,(0,t.jsxs)(`div`,{className:v(_.control,a&&_.hasError,u&&_.isDisabled),children:[o?(0,t.jsx)(`span`,{className:_.adornment,"aria-hidden":`true`,children:o}):null,(0,t.jsx)(`input`,{ref:m,id:g,className:v(_.input,c),disabled:u,required:d,"aria-invalid":a?!0:void 0,"aria-describedby":x||void 0,...p}),s?(0,t.jsx)(`span`,{className:_.adornment,"aria-hidden":`true`,children:s}):null]}),a?(0,t.jsx)(`p`,{id:b,className:_.error,role:`alert`,children:a}):null,!a&&i?(0,t.jsx)(`p`,{id:y,className:_.hint,children:i}):null]})});y.displayName=`TextField`,exports.Button=o,exports.Card=d,exports.IconButton=g,exports.TextField=y;
@@ -0,0 +1,2 @@
1
+ :root{--color-blue-300:#82a0ff;--color-blue-400:#6687ff;--color-blue-500:#3d6df2;--color-blue-600:#2858e6;--color-blue-700:#1f46c4;--color-violet-400:#a65af8;--color-violet-500:#9146f7;--color-violet-600:#7530d6;--color-white:#fff;--color-black:#000;--color-slate-50:#f8faff;--color-slate-100:#f1f4fa;--color-slate-200:#e6ebf3;--color-slate-300:#d9e0eb;--color-slate-400:#a6b0c2;--color-slate-500:#7a8498;--color-slate-600:#596276;--color-slate-700:#3e475a;--color-slate-800:#252c3c;--color-slate-900:#141925;--color-slate-950:#080b14;--color-success-300:#6cdaa1;--color-success-500:#36b77d;--color-success-700:#23885a;--color-danger-300:#fa8797;--color-danger-500:#ee6274;--color-danger-700:#c83b50;--color-warning-300:#ffc963;--color-warning-500:#f7af35;--color-warning-700:#c88317;--color-info-500:#4d7cff;--chart-liquidity:#3f72f4;--chart-emergency:#45c6bb;--chart-investments:#a543ed;--chart-pension:#f5a928;--chart-other:#e85071;--gradient-primary:linear-gradient(135deg, #3d78ff 0%, #2858e6 100%);--gradient-primary-hover:linear-gradient(135deg, #4b81ff 0%, #214ed6 100%);--gradient-pro:linear-gradient(135deg, #102348 0%, #44208e 55%, #8327ce 100%);--gradient-chart:linear-gradient(180deg, #3d6df238 0%, #3d6df200 100%);--space-0:0;--space-px:1px;--space-0-5:.125rem;--space-1:.25rem;--space-1-5:.375rem;--space-2:.5rem;--space-2-5:.625rem;--space-3:.75rem;--space-3-5:.875rem;--space-4:1rem;--space-5:1.25rem;--space-6:1.5rem;--space-7:1.75rem;--space-8:2rem;--space-10:2.5rem;--space-12:3rem;--space-16:4rem;--space-20:5rem;--space-24:6rem;--radius-none:0;--radius-xs:.25rem;--radius-sm:.5rem;--radius-md:.75rem;--radius-lg:1rem;--radius-xl:1.25rem;--radius-2xl:1.5rem;--radius-pill:9999px;--radius-circle:50%;--shadow-none:none;--shadow-xs:0 1px 2px #18274b0a;--shadow-sm:0 2px 8px #18274b0f;--shadow-card:0 8px 30px #1c2f540f;--shadow-lg:0 18px 50px #18274b1f;--shadow-floating:0 24px 70px #18274b29;--shadow-brand:0 8px 22px #2858e640;--shadow-focus:0 0 0 3px #3d6df247;--focus-ring:var(--shadow-focus)}[data-theme=dark]{--shadow-xs:0 1px 2px #0000002e;--shadow-sm:0 4px 12px #0000002e;--shadow-card:0 10px 35px #00000038;--shadow-lg:0 20px 60px #00000059;--shadow-floating:0 26px 80px #0000007a}:root{--font-sans:"Inter", "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--font-size-2xs:.625rem;--font-size-xs:.6875rem;--font-size-sm:.75rem;--font-size-base:.875rem;--font-size-md:1rem;--font-size-lg:1.125rem;--font-size-xl:1.25rem;--font-size-2xl:1.5rem;--font-size-3xl:2rem;--font-size-4xl:2.5rem;--line-height-none:1;--line-height-tight:1.2;--line-height-snug:1.35;--line-height-normal:1.5;--line-height-relaxed:1.6;--font-weight-regular:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--letter-spacing-tight:-.025em;--letter-spacing-normal:0;--letter-spacing-wide:.04em}:root,[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg-canvas:#f7f9fd;--bg-page:#f0f2f6;--bg-muted:#f3f6fb;--surface-default:#fff;--surface-raised:#fff;--surface-subtle:#f7f9fd;--surface-hover:#f1f5ff;--surface-active:#edf2ff;--surface-disabled:#f3f5f8;--text-primary:#12192b;--text-secondary:#677085;--text-tertiary:#98a1b2;--text-disabled:#b5bdcb;--text-inverse:#1754e2;--text-link:var(--color-blue-500);--border-subtle:#e9edf5;--border-default:#dde4f0;--border-strong:#cbd4e3;--border-focus:var(--color-blue-500);--action-primary-bg:var(--gradient-primary);--action-primary-bg-hover:var(--gradient-primary-hover);--action-primary-text:#fff;--action-secondary-bg:#fff;--action-secondary-bg-hover:#f5f7fb;--action-secondary-text:#2c3548;--state-success-bg:#edf9f2;--state-success-text:var(--color-success-700);--state-danger-bg:#fff0f2;--state-danger-text:var(--color-danger-700);--state-warning-bg:#fff7e9;--state-warning-text:var(--color-warning-700);--state-info-bg:#eef3ff;--state-info-text:var(--color-blue-600)}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg-canvas:#080b14;--bg-page:#0b0f1a;--bg-muted:#0e121d;--surface-default:#101521;--surface-raised:#141a28;--surface-subtle:#0e121d;--surface-hover:#171f31;--surface-active:#3d6df229;--surface-disabled:#131824;--text-primary:#f5f7ff;--text-secondary:#a5aec1;--text-tertiary:#737d91;--text-disabled:#4d5769;--text-inverse:#527cdf;--text-link:#7695ff;--border-subtle:#a6b8e11a;--border-default:#a6b8e129;--border-strong:#a6b8e147;--border-focus:var(--color-blue-400);--action-primary-bg:var(--gradient-primary);--action-primary-bg-hover:var(--gradient-primary-hover);--action-primary-text:#fff;--action-secondary-bg:#121827;--action-secondary-bg-hover:#192235;--action-secondary-text:#edf1fb;--state-success-bg:#36b77d21;--state-success-text:#63d89a;--state-danger-bg:#ee627421;--state-danger-text:#fa8595;--state-warning-bg:#f7af3521;--state-warning-text:#ffc45d;--state-info-bg:#4d7cff26;--state-info-text:#8ca5ff}._button_gjxjz_1{justify-content:center;align-items:center;gap:var(--space-2);border-radius:var(--radius-md);font-family:var(--font-sans);font-size:var(--font-size-base);font-weight:var(--font-weight-semibold);white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;border:1px solid #0000;flex-shrink:0;line-height:1;transition:background .16s,background-color .16s,border-color .16s,box-shadow .16s,color .16s,opacity .16s,transform .16s;display:inline-flex}._button_gjxjz_1:focus-visible{outline:2px solid var(--focus-ring,currentcolor);outline-offset:2px}._button_gjxjz_1:disabled{cursor:not-allowed;opacity:.5}._button_gjxjz_1:not(:disabled):active{transform:translateY(1px)}._sizeSm_gjxjz_31{min-height:2rem;padding-inline:var(--space-3);font-size:var(--font-size-sm)}._sizeMd_gjxjz_37{min-height:2.5rem;padding-inline:var(--space-4)}._sizeLg_gjxjz_42{min-height:3rem;padding-inline:var(--space-5);font-size:var(--font-size-md)}._variantPrimary_gjxjz_48{color:var(--action-primary-text);background:var(--action-primary-bg);box-shadow:var(--shadow-brand)}._variantPrimary_gjxjz_48:not(:disabled):hover{background:var(--action-primary-bg-hover)}._variantSecondary_gjxjz_57{color:var(--action-secondary-text);background:var(--action-secondary-bg);border-color:var(--border-default)}._variantSecondary_gjxjz_57:not(:disabled):hover{background:var(--action-secondary-bg-hover);border-color:var(--border-strong)}._variantGhost_gjxjz_67{color:var(--text-secondary);background:0 0}._variantGhost_gjxjz_67:not(:disabled):hover{color:var(--text-primary);background:var(--surface-hover)}._variantDanger_gjxjz_76{color:var(--state-danger-text);background:var(--state-danger-bg);border-color:#0000}._variantDanger_gjxjz_76:not(:disabled):hover{border-color:var(--color-danger-500)}._fullWidth_gjxjz_85{width:100%}._loading_gjxjz_89{pointer-events:none}._icon_gjxjz_93{flex:none;place-items:center;width:1.125rem;height:1.125rem;display:grid}._icon_gjxjz_93 svg{stroke-width:2px;width:100%;height:100%}._label_gjxjz_106{text-overflow:ellipsis;overflow:hidden}._spinner_gjxjz_111{border-radius:var(--radius-circle);border:2px solid;border-right-color:#0000;flex:none;width:1rem;height:1rem;animation:.7s linear infinite _spin_gjxjz_111}@keyframes _spin_gjxjz_111{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){._button_gjxjz_1{transition:none}._spinner_gjxjz_111{animation-duration:1.5s}}._card_1ex3y_1{min-width:0;color:var(--text-primary);background:var(--surface-default);border-radius:var(--radius-lg)}._paddingNone_1ex3y_9{padding:0}._paddingSm_1ex3y_13{padding:var(--space-4)}._paddingMd_1ex3y_17{padding:var(--space-5)}._paddingLg_1ex3y_21{padding:var(--space-6)}._elevationNone_1ex3y_26{box-shadow:var(--shadow-none)}._elevationSm_1ex3y_30{box-shadow:var(--shadow-card)}._elevationMd_1ex3y_34{box-shadow:var(--shadow-lg)}._button_cnvt9_1{border-radius:var(--radius-md);color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;background:0 0;border:1px solid #0000;flex:none;place-items:center;padding:0;transition:background-color .16s,border-color .16s,box-shadow .16s,color .16s,opacity .16s,transform .16s;display:inline-grid}._button_cnvt9_1:focus-visible{outline:2px solid var(--focus-ring,currentcolor);outline-offset:2px}._button_cnvt9_1:disabled{cursor:not-allowed;opacity:.5}._button_cnvt9_1:not(:disabled):active{transform:translateY(1px)}._sizeSm_cnvt9_27{width:2rem;height:2rem}._sizeMd_cnvt9_32{width:2.5rem;height:2.5rem}._sizeLg_cnvt9_37{width:3rem;height:3rem}._variantPrimary_cnvt9_42{color:var(--action-primary-text);background:var(--action-primary-bg);box-shadow:var(--shadow-brand)}._variantPrimary_cnvt9_42:not(:disabled):hover{background:var(--action-primary-bg-hover)}._variantSecondary_cnvt9_51{color:var(--action-secondary-text);background:var(--action-secondary-bg);border-color:var(--border-default)}._variantSecondary_cnvt9_51:not(:disabled):hover{background:var(--action-secondary-bg-hover);border-color:var(--border-strong)}._variantGhost_cnvt9_61{color:var(--text-secondary);background:0 0}._variantGhost_cnvt9_61:not(:disabled):hover{color:var(--text-primary);background:var(--surface-hover)}._variantDanger_cnvt9_70{color:var(--state-danger-text);background:var(--state-danger-bg)}._variantDanger_cnvt9_70:not(:disabled):hover{border-color:var(--color-danger-500)}._icon_cnvt9_78{place-items:center;width:1.25rem;height:1.25rem;display:grid}._icon_cnvt9_78 svg{stroke-width:1.8px;width:100%;height:100%}._spinner_cnvt9_90{border-radius:var(--radius-circle);border:2px solid;border-right-color:#0000;width:1rem;height:1rem;animation:.7s linear infinite _spin_cnvt9_90}._loading_cnvt9_99{pointer-events:none}@keyframes _spin_cnvt9_90{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){._button_cnvt9_1{transition:none}._spinner_cnvt9_90{animation-duration:1.5s}}._field_1pq0j_1{gap:var(--space-2);width:100%;display:grid}._label_1pq0j_7{color:var(--text-primary);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);line-height:var(--line-height-normal)}._required_1pq0j_14{color:var(--state-danger-text)}._control_1pq0j_18{align-items:center;gap:var(--space-2);width:100%;min-height:3rem;padding-inline:var(--space-3);color:var(--text-primary);background:var(--surface-default);border:1px solid var(--border-default);border-radius:var(--radius-md);transition:border-color .16s,box-shadow .16s,background-color .16s;display:flex}._control_1pq0j_18:focus-within{border-color:var(--border-focus);outline:2px solid var(--focus-ring,currentcolor);outline-offset:2px}._input_1pq0j_37{width:100%;min-width:0;box-shadow:none;color:inherit;font-family:var(--font-sans);font-size:var(--font-size-base);font-weight:var(--font-weight-regular);line-height:var(--line-height-normal);background:0 0;border:0;outline:none;padding:0}._input_1pq0j_37:focus,._input_1pq0j_37:focus-visible{box-shadow:none;outline:none}._input_1pq0j_37::placeholder{color:var(--text-tertiary);opacity:1}:-webkit-any(._input_1pq0j_37:autofill,._input_1pq0j_37:-webkit-autofill){-webkit-text-fill-color:var(--text-primary);box-shadow:0 0 0 1000px var(--surface-default) inset;transition:background-color 9999s ease-out}:is(._input_1pq0j_37:autofill,._input_1pq0j_37:autofill){-webkit-text-fill-color:var(--text-primary);box-shadow:0 0 0 1000px var(--surface-default) inset;transition:background-color 9999s ease-out}._adornment_1pq0j_65{width:1.125rem;height:1.125rem;color:var(--text-tertiary);flex:none;place-items:center;display:grid}._adornment_1pq0j_65 svg{stroke-width:1.8px;width:100%;height:100%}._hint_1pq0j_79,._error_1pq0j_80{font-size:var(--font-size-sm);line-height:var(--line-height-normal);margin:0}._hint_1pq0j_79{color:var(--text-secondary)}._error_1pq0j_80{color:var(--state-danger-text)}._hasError_1pq0j_94{border-color:var(--color-danger-500)}._hasError_1pq0j_94:focus-within{border-color:var(--color-danger-500);box-shadow:0 0 0 3px #ee627438}._isDisabled_1pq0j_102{color:var(--text-disabled);background:var(--surface-disabled);border-color:var(--border-subtle);cursor:not-allowed}._isDisabled_1pq0j_102 ._input_1pq0j_37{cursor:not-allowed}@media (prefers-reduced-motion:reduce){._control_1pq0j_18{transition:none}}
2
+ /*$vite$:1*/
@@ -0,0 +1,217 @@
1
+ import { forwardRef as e, useId as t } from "react";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ var i = {
4
+ button: "_button_gjxjz_1",
5
+ sizeSm: "_sizeSm_gjxjz_31",
6
+ sizeMd: "_sizeMd_gjxjz_37",
7
+ sizeLg: "_sizeLg_gjxjz_42",
8
+ variantPrimary: "_variantPrimary_gjxjz_48",
9
+ variantSecondary: "_variantSecondary_gjxjz_57",
10
+ variantGhost: "_variantGhost_gjxjz_67",
11
+ variantDanger: "_variantDanger_gjxjz_76",
12
+ fullWidth: "_fullWidth_gjxjz_85",
13
+ loading: "_loading_gjxjz_89",
14
+ icon: "_icon_gjxjz_93",
15
+ label: "_label_gjxjz_106",
16
+ spinner: "_spinner_gjxjz_111",
17
+ spin: "_spin_gjxjz_111"
18
+ }, a = {
19
+ primary: i.variantPrimary,
20
+ secondary: i.variantSecondary,
21
+ ghost: i.variantGhost,
22
+ danger: i.variantDanger
23
+ }, o = {
24
+ sm: i.sizeSm,
25
+ md: i.sizeMd,
26
+ lg: i.sizeLg
27
+ };
28
+ function s(...e) {
29
+ return e.filter(Boolean).join(" ");
30
+ }
31
+ var c = e(function({ children: e, className: t, variant: c = "primary", size: l = "md", fullWidth: u = !1, isLoading: d = !1, startIcon: f, endIcon: p, disabled: m, type: h = "button", ...g }, _) {
32
+ let v = m || d;
33
+ return /* @__PURE__ */ r("button", {
34
+ ref: _,
35
+ type: h,
36
+ className: s(i.button, a[c], o[l], u && i.fullWidth, d && i.loading, t),
37
+ disabled: v,
38
+ "aria-busy": d || void 0,
39
+ ...g,
40
+ children: [
41
+ d ? /* @__PURE__ */ n("span", {
42
+ className: i.spinner,
43
+ "aria-hidden": "true"
44
+ }) : null,
45
+ !d && f ? /* @__PURE__ */ n("span", {
46
+ className: i.icon,
47
+ "aria-hidden": "true",
48
+ children: f
49
+ }) : null,
50
+ /* @__PURE__ */ n("span", {
51
+ className: i.label,
52
+ children: e
53
+ }),
54
+ !d && p ? /* @__PURE__ */ n("span", {
55
+ className: i.icon,
56
+ "aria-hidden": "true",
57
+ children: p
58
+ }) : null
59
+ ]
60
+ });
61
+ });
62
+ c.displayName = "Button";
63
+ var l = {
64
+ card: "_card_1ex3y_1",
65
+ paddingNone: "_paddingNone_1ex3y_9",
66
+ paddingSm: "_paddingSm_1ex3y_13",
67
+ paddingMd: "_paddingMd_1ex3y_17",
68
+ paddingLg: "_paddingLg_1ex3y_21",
69
+ elevationNone: "_elevationNone_1ex3y_26",
70
+ elevationSm: "_elevationSm_1ex3y_30",
71
+ elevationMd: "_elevationMd_1ex3y_34"
72
+ }, u = {
73
+ none: l.paddingNone,
74
+ sm: l.paddingSm,
75
+ md: l.paddingMd,
76
+ lg: l.paddingLg
77
+ }, d = {
78
+ none: l.elevationNone,
79
+ sm: l.elevationSm,
80
+ md: l.elevationMd
81
+ };
82
+ function f(...e) {
83
+ return e.filter(Boolean).join(" ");
84
+ }
85
+ var p = e(function({ children: e, className: t, padding: r = "md", elevation: i = "sm", ...a }, o) {
86
+ return /* @__PURE__ */ n("div", {
87
+ ref: o,
88
+ className: f(l.card, u[r], d[i], t),
89
+ ...a,
90
+ children: e
91
+ });
92
+ });
93
+ p.displayName = "Card";
94
+ var m = {
95
+ button: "_button_cnvt9_1",
96
+ sizeSm: "_sizeSm_cnvt9_27",
97
+ sizeMd: "_sizeMd_cnvt9_32",
98
+ sizeLg: "_sizeLg_cnvt9_37",
99
+ variantPrimary: "_variantPrimary_cnvt9_42",
100
+ variantSecondary: "_variantSecondary_cnvt9_51",
101
+ variantGhost: "_variantGhost_cnvt9_61",
102
+ variantDanger: "_variantDanger_cnvt9_70",
103
+ icon: "_icon_cnvt9_78",
104
+ spinner: "_spinner_cnvt9_90",
105
+ spin: "_spin_cnvt9_90",
106
+ loading: "_loading_cnvt9_99"
107
+ }, h = {
108
+ primary: m.variantPrimary,
109
+ secondary: m.variantSecondary,
110
+ ghost: m.variantGhost,
111
+ danger: m.variantDanger
112
+ }, g = {
113
+ sm: m.sizeSm,
114
+ md: m.sizeMd,
115
+ lg: m.sizeLg
116
+ };
117
+ function _(...e) {
118
+ return e.filter(Boolean).join(" ");
119
+ }
120
+ var v = e(function({ icon: e, label: t, className: r, variant: i = "secondary", size: a = "md", isLoading: o = !1, disabled: s, type: c = "button", ...l }, u) {
121
+ let d = s || o;
122
+ return /* @__PURE__ */ n("button", {
123
+ ref: u,
124
+ type: c,
125
+ className: _(m.button, h[i], g[a], o && m.loading, r),
126
+ disabled: d,
127
+ "aria-label": t,
128
+ "aria-busy": o || void 0,
129
+ ...l,
130
+ children: o ? /* @__PURE__ */ n("span", {
131
+ className: m.spinner,
132
+ "aria-hidden": "true"
133
+ }) : /* @__PURE__ */ n("span", {
134
+ className: m.icon,
135
+ "aria-hidden": "true",
136
+ children: e
137
+ })
138
+ });
139
+ });
140
+ v.displayName = "IconButton";
141
+ var y = {
142
+ field: "_field_1pq0j_1",
143
+ label: "_label_1pq0j_7",
144
+ required: "_required_1pq0j_14",
145
+ control: "_control_1pq0j_18",
146
+ input: "_input_1pq0j_37",
147
+ adornment: "_adornment_1pq0j_65",
148
+ hint: "_hint_1pq0j_79",
149
+ error: "_error_1pq0j_80",
150
+ hasError: "_hasError_1pq0j_94",
151
+ isDisabled: "_isDisabled_1pq0j_102"
152
+ };
153
+ //#endregion
154
+ //#region src/components/TextField/TextField.tsx
155
+ function b(...e) {
156
+ return e.filter(Boolean).join(" ");
157
+ }
158
+ var x = e(function({ id: e, label: i, hint: a, error: o, startAdornment: s, endAdornment: c, className: l, containerClassName: u, disabled: d, required: f, "aria-describedby": p, ...m }, h) {
159
+ let g = t(), _ = e ?? `text-field-${g}`, v = `${_}-hint`, x = `${_}-error`, S = [
160
+ p,
161
+ a ? v : null,
162
+ o ? x : null
163
+ ].filter(Boolean).join(" ");
164
+ return /* @__PURE__ */ r("div", {
165
+ className: b(y.field, u),
166
+ children: [
167
+ i ? /* @__PURE__ */ r("label", {
168
+ className: y.label,
169
+ htmlFor: _,
170
+ children: [i, f ? /* @__PURE__ */ r("span", {
171
+ className: y.required,
172
+ "aria-hidden": "true",
173
+ children: [" ", "*"]
174
+ }) : null]
175
+ }) : null,
176
+ /* @__PURE__ */ r("div", {
177
+ className: b(y.control, o && y.hasError, d && y.isDisabled),
178
+ children: [
179
+ s ? /* @__PURE__ */ n("span", {
180
+ className: y.adornment,
181
+ "aria-hidden": "true",
182
+ children: s
183
+ }) : null,
184
+ /* @__PURE__ */ n("input", {
185
+ ref: h,
186
+ id: _,
187
+ className: b(y.input, l),
188
+ disabled: d,
189
+ required: f,
190
+ "aria-invalid": o ? !0 : void 0,
191
+ "aria-describedby": S || void 0,
192
+ ...m
193
+ }),
194
+ c ? /* @__PURE__ */ n("span", {
195
+ className: y.adornment,
196
+ "aria-hidden": "true",
197
+ children: c
198
+ }) : null
199
+ ]
200
+ }),
201
+ o ? /* @__PURE__ */ n("p", {
202
+ id: x,
203
+ className: y.error,
204
+ role: "alert",
205
+ children: o
206
+ }) : null,
207
+ !o && a ? /* @__PURE__ */ n("p", {
208
+ id: v,
209
+ className: y.hint,
210
+ children: a
211
+ }) : null
212
+ ]
213
+ });
214
+ });
215
+ x.displayName = "TextField";
216
+ //#endregion
217
+ export { c as Button, p as Card, v as IconButton, x as TextField };
@@ -0,0 +1,15 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
+ type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
3
+ type ButtonSize = "sm" | "md" | "lg";
4
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ children: ReactNode;
6
+ variant?: ButtonVariant;
7
+ size?: ButtonSize;
8
+ fullWidth?: boolean;
9
+ isLoading?: boolean;
10
+ startIcon?: ReactNode;
11
+ endIcon?: ReactNode;
12
+ }
13
+ export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
14
+ export {};
15
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,KAAK,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAClE,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,WAAW,WACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAqBD,eAAO,MAAM,MAAM,2GAuDlB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Button } from "./Button";
2
+ export type { ButtonProps } from "./Button";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ type CardPadding = "none" | "sm" | "md" | "lg";
3
+ type CardElevation = "none" | "sm" | "md";
4
+ export interface CardProps extends HTMLAttributes<HTMLDivElement> {
5
+ children: ReactNode;
6
+ padding?: CardPadding;
7
+ elevation?: CardElevation;
8
+ }
9
+ export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ export {};
11
+ //# sourceMappingURL=Card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,KAAK,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,KAAK,aAAa,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAqBD,eAAO,MAAM,IAAI,sGA0BhB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Card } from "./Card";
2
+ export type { CardProps } from "./Card";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from "react";
2
+ type IconButtonVariant = "secondary" | "ghost" | "primary" | "danger";
3
+ type IconButtonSize = "sm" | "md" | "lg";
4
+ export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
5
+ icon: ReactNode;
6
+ label: string;
7
+ variant?: IconButtonVariant;
8
+ size?: IconButtonSize;
9
+ isLoading?: boolean;
10
+ }
11
+ export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
12
+ export {};
13
+ //# sourceMappingURL=IconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,KAAK,iBAAiB,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AACtE,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzC,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACjE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAqBD,eAAO,MAAM,UAAU,+GA2CtB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { IconButton } from "./IconButton";
2
+ export type { IconButtonProps } from "./IconButton";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/IconButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from "react";
2
+ export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
3
+ label?: string;
4
+ hint?: string;
5
+ error?: string;
6
+ startAdornment?: ReactNode;
7
+ endAdornment?: ReactNode;
8
+ containerClassName?: string;
9
+ }
10
+ export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
11
+ //# sourceMappingURL=TextField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAQD,eAAO,MAAM,SAAS,6GA2FrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { TextField } from "./TextField";
2
+ export type { TextFieldProps } from "./TextField";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/TextField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,10 @@
1
+ import "./style/library.scss";
2
+ export { Button } from "./components/Button";
3
+ export type { ButtonProps } from "./components/Button";
4
+ export { Card } from "./components/Card";
5
+ export type { CardProps } from "./components/Card";
6
+ export { IconButton } from "./components/IconButton";
7
+ export type { IconButtonProps } from "./components/IconButton";
8
+ export { TextField } from "./components/TextField";
9
+ export type { TextFieldProps } from "./components/TextField";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@bertimatteodev/astra-ui",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./dist/astra-ui.cjs",
7
+ "module": "./dist/astra-ui.js",
8
+ "types": "./dist/types/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/types/index.d.ts",
15
+ "import": "./dist/astra-ui.js",
16
+ "require": "./dist/astra-ui.cjs"
17
+ },
18
+ "./style.css": "./dist/astra-ui.css"
19
+ },
20
+ "sideEffects": [
21
+ "**/*.css"
22
+ ],
23
+ "scripts": {
24
+ "dev": "vite",
25
+ "build": "vite build && tsc -p tsconfig.lib.json",
26
+ "lint": "oxlint",
27
+ "preview": "vite preview"
28
+ },
29
+ "peerDependencies": {
30
+ "react": ">=18 <20",
31
+ "react-dom": ">=18 <20"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^24.13.3",
35
+ "@types/react": "^19.2.17",
36
+ "@types/react-dom": "^19.2.3",
37
+ "@vitejs/plugin-react": "^6.0.4",
38
+ "oxlint": "^1.75.0",
39
+ "react": "^19.2.8",
40
+ "react-dom": "^19.2.8",
41
+ "sass": "^1.102.0",
42
+ "typescript": "~6.0.2",
43
+ "vite": "^8.2.0"
44
+ }
45
+ }