@spark-ui/button 1.0.0-beta.0 → 1.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.
- package/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/dist/Button.d.ts +8 -0
- package/dist/Button.styles.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +6 -0
- package/dist/variants/contrast.d.ts +29 -0
- package/dist/variants/default.d.ts +7 -0
- package/dist/variants/filled.d.ts +29 -0
- package/dist/variants/ghost.d.ts +29 -0
- package/dist/variants/index.d.ts +6 -0
- package/dist/variants/outlined.d.ts +29 -0
- package/dist/variants/tinted.d.ts +29 -0
- package/package.json +10 -3
- package/tsconfig.json +2 -10
- package/vite.config.ts +2 -3
package/CHANGELOG.md
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
|
+
|
6
|
+
## [1.2.1](https://github.com/adevinta/spark/compare/@spark-ui/button@1.2.0...@spark-ui/button@1.2.1) (2023-03-22)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @spark-ui/button
|
9
|
+
|
10
|
+
# [1.2.0](https://github.com/adevinta/spark/compare/@spark-ui/button@1.1.0...@spark-ui/button@1.2.0) (2023-03-21)
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
- **button:** get rid of TS errors ([ccd31d6](https://github.com/adevinta/spark/commit/ccd31d656beb5da72217099de50b5e139fa1515e))
|
15
|
+
- **button:** ring styles ([afc280f](https://github.com/adevinta/spark/commit/afc280f95027c2e9b0ebdfdf0f1c1c967c3f6471)), closes [#388](https://github.com/adevinta/spark/issues/388)
|
16
|
+
|
17
|
+
### Features
|
18
|
+
|
19
|
+
- **button:** add contrast design, surface intent and remove reverse button ([1a59450](https://github.com/adevinta/spark/commit/1a594508040a35c6cca1d09231c06320e6b25893))
|
20
|
+
- **button:** add first main combinations ([8e243de](https://github.com/adevinta/spark/commit/8e243de27ea0deee46db6117a103551c9a7b5628))
|
21
|
+
- **button:** bump ([f444e99](https://github.com/adevinta/spark/commit/f444e99df05dc2c5a8a30487ed0fcaa1daf4c7c2))
|
22
|
+
- **button:** fix button hover-focus states ([696ddab](https://github.com/adevinta/spark/commit/696ddabda874501983d17abbd703794df14064c9))
|
23
|
+
- **button:** implement every button variants ([febdcb2](https://github.com/adevinta/spark/commit/febdcb2e5f0b7cb8ab9d986c2249c84026dc1361))
|
24
|
+
- **button:** setup button component ([99077a9](https://github.com/adevinta/spark/commit/99077a92f675c7c4135961c7e279e59bd542454a))
|
25
|
+
- remove button component for now ([36d1475](https://github.com/adevinta/spark/commit/36d1475c112b242bd6afc4142d972a5c5cbfc47a))
|
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/dist/Button.d.ts
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { type ButtonStylesProps } from './Button.styles';
|
3
|
+
/** Review: Prop VS ButtonProps */
|
4
|
+
export interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'size' | 'disabled'>, ButtonStylesProps {
|
5
|
+
}
|
6
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & {
|
7
|
+
children?: React.ReactNode;
|
8
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
2
|
+
export declare const buttonStyles: (props?: ({
|
3
|
+
design?: "filled" | "outlined" | "tinted" | "ghost" | "contrast" | null | undefined;
|
4
|
+
intent?: "primary" | "secondary" | "success" | "alert" | "danger" | "neutral" | "surface" | null | undefined;
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
6
|
+
disabled?: boolean | null | undefined;
|
7
|
+
shape?: "rounded" | "square" | "pill" | null | undefined;
|
8
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
9
|
+
export type ButtonStylesProps = VariantProps<typeof buttonStyles>;
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Button';
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),i=[{intent:"primary",design:"filled",class:["bg-primary","text-on-primary","enabled:hover:bg-primary-hovered","enabled:active:bg-primary-hovered","focus-visible:bg-primary-focused"]},{intent:"secondary",design:"filled",class:["bg-secondary","text-on-secondary","enabled:hover:bg-secondary-hovered","enabled:active:bg-secondary-hovered","focus-visible:bg-secondary-focused"]},{intent:"success",design:"filled",class:["bg-success","text-on-success","enabled:hover:bg-success-hovered","enabled:active:bg-success-hovered","focus-visible:bg-success-focused"]},{intent:"alert",design:"filled",class:["bg-alert","text-on-alert","enabled:hover:bg-alert-hovered","enabled:active:bg-alert-hovered","focus-visible:bg-alert-focused"]},{intent:"danger",design:"filled",class:["bg-error","text-on-error","enabled:hover:bg-error-hovered","enabled:active:bg-error-hovered","focus-visible:bg-error-focused"]},{intent:"neutral",design:"filled",class:["bg-neutral","text-on-neutral","enabled:hover:bg-neutral-hovered","enabled:active:bg-neutral-hovered","focus-visible:bg-neutral-focused"]},{intent:"surface",design:"filled",class:["bg-surface","text-on-surface","enabled:hover:bg-surface-hovered","enabled:active:bg-surface-hovered","focus-visible:bg-surface-focused"]}],d=[{intent:"primary",design:"ghost",class:["text-primary","enabled:hover:bg-primary-container-hovered","enabled:active:bg-primary-container-hovered","focus-visible:bg-primary-container-focused"]},{intent:"secondary",design:"ghost",class:["text-secondary","enabled:hover:bg-secondary-container-hovered","enabled:active:bg-secondary-container-hovered","focus-visible:bg-secondary-container-focused"]},{intent:"success",design:"ghost",class:["text-success","enabled:hover:bg-success-container-hovered","enabled:active:bg-success-container-hovered","focus-visible:bg-success-container-focused"]},{intent:"alert",design:"ghost",class:["text-alert","enabled:hover:bg-alert-container-hovered","enabled:active:bg-alert-container-hovered","focus-visible:bg-alert-container-focused"]},{intent:"danger",design:"ghost",class:["text-error","enabled:hover:bg-error-container-hovered","enabled:active:bg-error-container-hovered","focus-visible:bg-error-container-focused"]},{intent:"neutral",design:"ghost",class:["text-neutral","enabled:hover:bg-neutral-container-hovered","enabled:active:bg-neutral-container-hovered","focus-visible:bg-neutral-container-focused"]},{intent:"surface",design:"ghost",class:["text-on-surface","enabled:hover:bg-surface-container-hovered","enabled:active:bg-surface-container-hovered","focus-visible:bg-surface-container-focused"]}],l=[{intent:"primary",design:"outlined",class:["enabled:hover:bg-primary-container-hovered","enabled:active:bg-primary-container-hovered","focus-visible:bg-primary-container-focused","text-primary"]},{intent:"secondary",design:"outlined",class:["enabled:hover:bg-secondary-container-hovered","enabled:active:bg-secondary-container-hovered","focus-visible:bg-secondary-container-focused","text-secondary"]},{intent:"success",design:"outlined",class:["enabled:hover:bg-success-container-hovered","enabled:active:bg-success-container-hovered","focus-visible:bg-success-container-focused","text-success"]},{intent:"alert",design:"outlined",class:["enabled:hover:bg-alert-container-hovered","enabled:active:bg-alert-container-hovered","focus-visible:bg-alert-container-focused","text-alert"]},{intent:"danger",design:"outlined",class:["enabled:hover:bg-error-container-hovered","enabled:active:bg-error-container-hovered","focus-visible:bg-error-container-focused","text-error"]},{intent:"neutral",design:"outlined",class:["enabled:hover:bg-neutral-container-hovered","enabled:active:bg-neutral-container-hovered","focus-visible:bg-neutral-container-focused","text-neutral"]},{intent:"surface",design:"outlined",class:["enabled:hover:bg-surface-container-hovered","enabled:active:bg-surface-container-hovered","focus-visible:bg-surface-container-focused","text-surface"]}],b=[{intent:"primary",design:"tinted",class:["bg-primary-container","text-on-primary-container","enabled:hover:bg-primary-container-hovered","enabled:active:bg-primary-container-hovered","focus-visible:bg-primary-container-focused"]},{intent:"secondary",design:"tinted",class:["bg-secondary-container","text-on-secondary-container","enabled:hover:bg-secondary-container-hovered","enabled:active:bg-secondary-container-hovered","focus-visible:bg-secondary-container-focused"]},{intent:"success",design:"tinted",class:["bg-success-container","text-on-success-container","enabled:hover:bg-success-container-hovered","enabled:active:bg-success-container-hovered","focus-visible:bg-success-container-focused"]},{intent:"alert",design:"tinted",class:["bg-alert-container","text-on-alert-container","enabled:hover:bg-alert-container-hovered","enabled:active:bg-alert-container-hovered","focus-visible:bg-alert-container-focused"]},{intent:"danger",design:"tinted",class:["bg-error-container","text-on-error-container","enabled:hover:bg-error-container-hovered","enabled:active:bg-error-container-hovered","focus-visible:bg-error-container-focused"]},{intent:"neutral",design:"tinted",class:["bg-neutral-container","text-on-neutral-container","enabled:hover:bg-neutral-container-hovered","enabled:active:bg-neutral-container-hovered","focus-visible:bg-neutral-container-focused"]},{intent:"surface",design:"tinted",class:["bg-surface-container","text-on-surface-container","enabled:hover:bg-surface-container-hovered","enabled:active:bg-surface-container-hovered","focus-visible:bg-surface-container-focused"]}],u=[{intent:"primary",design:"contrast",class:["text-primary","enabled:hover:bg-primary-container-hovered","enabled:active:bg-primary-container-hovered","focus-visible:bg-primary-container-focused"]},{intent:"secondary",design:"contrast",class:["text-secondary","enabled:hover:bg-secondary-container-hovered","enabled:active:bg-secondary-container-hovered","focus-visible:bg-secondary-container-focused"]},{intent:"success",design:"contrast",class:["text-success","enabled:hover:bg-success-container-hovered","enabled:active:bg-success-container-hovered","focus-visible:bg-success-container-focused"]},{intent:"alert",design:"contrast",class:["text-alert","enabled:hover:bg-alert-container-hovered","enabled:active:bg-alert-container-hovered","focus-visible:bg-alert-container-focused"]},{intent:"danger",design:"contrast",class:["text-error","enabled:hover:bg-error-container-hovered","enabled:active:bg-error-container-hovered","focus-visible:bg-error-container-focused"]},{intent:"neutral",design:"contrast",class:["text-neutral","enabled:hover:bg-neutral-container-hovered","enabled:active:bg-neutral-container-hovered","focus-visible:bg-neutral-container-focused"]},{intent:"surface",design:"contrast",class:["text-surface","enabled:hover:bg-surface-container-hovered","enabled:active:bg-surface-container-hovered","focus-visible:bg-surface-container-focused"]}],g=require("class-variance-authority").cva(["flex items-center gap-md justify-center box-border whitespace-nowrap","text-body-1 font-bold","ring-inset focus-visible:ring-2 focus-visible:ring-outline-high focus-visible:outline-none"],{variants:{design:{filled:[],outlined:["bg-transparent","ring-2","ring-current"],tinted:[],ghost:[],contrast:["bg-surface"]},intent:{primary:[],secondary:[],success:[],alert:[],danger:[],neutral:[],surface:[]},size:{sm:["py-sm px-lg"],md:["py-md px-lg"],lg:["p-lg"]},disabled:{true:["cursor-not-allowed","opacity-dim-3"]},shape:{rounded:["rounded-lg"],square:["rounded-none"],pill:["rounded-full"]}},compoundVariants:[...i,...l,...b,...d,...u],defaultVariants:{design:"filled",intent:"primary",size:"md",shape:"rounded"}}),v=n.forwardRef(({design:r="filled",disabled:e=!1,intent:a="primary",shape:t="rounded",size:s="md",...o},c)=>n.createElement("button",{ref:c,className:g({design:r,disabled:e,intent:a,shape:t,size:s}),disabled:!!e,...o}));exports.Button=v;
|
package/dist/index.mjs
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
import n from "react";
|
2
|
+
import { cva as i } from "class-variance-authority";
|
3
|
+
const d = i(["flex items-center gap-md justify-center box-border whitespace-nowrap", "text-body-1 font-bold", "ring-inset focus-visible:ring-2 focus-visible:ring-outline-high focus-visible:outline-none"], { variants: { design: { filled: [], outlined: ["bg-transparent", "ring-2", "ring-current"], tinted: [], ghost: [], contrast: ["bg-surface"] }, intent: { primary: [], secondary: [], success: [], alert: [], danger: [], neutral: [], surface: [] }, size: { sm: ["py-sm px-lg"], md: ["py-md px-lg"], lg: ["p-lg"] }, disabled: { true: ["cursor-not-allowed", "opacity-dim-3"] }, shape: { rounded: ["rounded-lg"], square: ["rounded-none"], pill: ["rounded-full"] } }, compoundVariants: [{ intent: "primary", design: "filled", class: ["bg-primary", "text-on-primary", "enabled:hover:bg-primary-hovered", "enabled:active:bg-primary-hovered", "focus-visible:bg-primary-focused"] }, { intent: "secondary", design: "filled", class: ["bg-secondary", "text-on-secondary", "enabled:hover:bg-secondary-hovered", "enabled:active:bg-secondary-hovered", "focus-visible:bg-secondary-focused"] }, { intent: "success", design: "filled", class: ["bg-success", "text-on-success", "enabled:hover:bg-success-hovered", "enabled:active:bg-success-hovered", "focus-visible:bg-success-focused"] }, { intent: "alert", design: "filled", class: ["bg-alert", "text-on-alert", "enabled:hover:bg-alert-hovered", "enabled:active:bg-alert-hovered", "focus-visible:bg-alert-focused"] }, { intent: "danger", design: "filled", class: ["bg-error", "text-on-error", "enabled:hover:bg-error-hovered", "enabled:active:bg-error-hovered", "focus-visible:bg-error-focused"] }, { intent: "neutral", design: "filled", class: ["bg-neutral", "text-on-neutral", "enabled:hover:bg-neutral-hovered", "enabled:active:bg-neutral-hovered", "focus-visible:bg-neutral-focused"] }, { intent: "surface", design: "filled", class: ["bg-surface", "text-on-surface", "enabled:hover:bg-surface-hovered", "enabled:active:bg-surface-hovered", "focus-visible:bg-surface-focused"] }, { intent: "primary", design: "outlined", class: ["enabled:hover:bg-primary-container-hovered", "enabled:active:bg-primary-container-hovered", "focus-visible:bg-primary-container-focused", "text-primary"] }, { intent: "secondary", design: "outlined", class: ["enabled:hover:bg-secondary-container-hovered", "enabled:active:bg-secondary-container-hovered", "focus-visible:bg-secondary-container-focused", "text-secondary"] }, { intent: "success", design: "outlined", class: ["enabled:hover:bg-success-container-hovered", "enabled:active:bg-success-container-hovered", "focus-visible:bg-success-container-focused", "text-success"] }, { intent: "alert", design: "outlined", class: ["enabled:hover:bg-alert-container-hovered", "enabled:active:bg-alert-container-hovered", "focus-visible:bg-alert-container-focused", "text-alert"] }, { intent: "danger", design: "outlined", class: ["enabled:hover:bg-error-container-hovered", "enabled:active:bg-error-container-hovered", "focus-visible:bg-error-container-focused", "text-error"] }, { intent: "neutral", design: "outlined", class: ["enabled:hover:bg-neutral-container-hovered", "enabled:active:bg-neutral-container-hovered", "focus-visible:bg-neutral-container-focused", "text-neutral"] }, { intent: "surface", design: "outlined", class: ["enabled:hover:bg-surface-container-hovered", "enabled:active:bg-surface-container-hovered", "focus-visible:bg-surface-container-focused", "text-surface"] }, { intent: "primary", design: "tinted", class: ["bg-primary-container", "text-on-primary-container", "enabled:hover:bg-primary-container-hovered", "enabled:active:bg-primary-container-hovered", "focus-visible:bg-primary-container-focused"] }, { intent: "secondary", design: "tinted", class: ["bg-secondary-container", "text-on-secondary-container", "enabled:hover:bg-secondary-container-hovered", "enabled:active:bg-secondary-container-hovered", "focus-visible:bg-secondary-container-focused"] }, { intent: "success", design: "tinted", class: ["bg-success-container", "text-on-success-container", "enabled:hover:bg-success-container-hovered", "enabled:active:bg-success-container-hovered", "focus-visible:bg-success-container-focused"] }, { intent: "alert", design: "tinted", class: ["bg-alert-container", "text-on-alert-container", "enabled:hover:bg-alert-container-hovered", "enabled:active:bg-alert-container-hovered", "focus-visible:bg-alert-container-focused"] }, { intent: "danger", design: "tinted", class: ["bg-error-container", "text-on-error-container", "enabled:hover:bg-error-container-hovered", "enabled:active:bg-error-container-hovered", "focus-visible:bg-error-container-focused"] }, { intent: "neutral", design: "tinted", class: ["bg-neutral-container", "text-on-neutral-container", "enabled:hover:bg-neutral-container-hovered", "enabled:active:bg-neutral-container-hovered", "focus-visible:bg-neutral-container-focused"] }, { intent: "surface", design: "tinted", class: ["bg-surface-container", "text-on-surface-container", "enabled:hover:bg-surface-container-hovered", "enabled:active:bg-surface-container-hovered", "focus-visible:bg-surface-container-focused"] }, { intent: "primary", design: "ghost", class: ["text-primary", "enabled:hover:bg-primary-container-hovered", "enabled:active:bg-primary-container-hovered", "focus-visible:bg-primary-container-focused"] }, { intent: "secondary", design: "ghost", class: ["text-secondary", "enabled:hover:bg-secondary-container-hovered", "enabled:active:bg-secondary-container-hovered", "focus-visible:bg-secondary-container-focused"] }, { intent: "success", design: "ghost", class: ["text-success", "enabled:hover:bg-success-container-hovered", "enabled:active:bg-success-container-hovered", "focus-visible:bg-success-container-focused"] }, { intent: "alert", design: "ghost", class: ["text-alert", "enabled:hover:bg-alert-container-hovered", "enabled:active:bg-alert-container-hovered", "focus-visible:bg-alert-container-focused"] }, { intent: "danger", design: "ghost", class: ["text-error", "enabled:hover:bg-error-container-hovered", "enabled:active:bg-error-container-hovered", "focus-visible:bg-error-container-focused"] }, { intent: "neutral", design: "ghost", class: ["text-neutral", "enabled:hover:bg-neutral-container-hovered", "enabled:active:bg-neutral-container-hovered", "focus-visible:bg-neutral-container-focused"] }, { intent: "surface", design: "ghost", class: ["text-on-surface", "enabled:hover:bg-surface-container-hovered", "enabled:active:bg-surface-container-hovered", "focus-visible:bg-surface-container-focused"] }, { intent: "primary", design: "contrast", class: ["text-primary", "enabled:hover:bg-primary-container-hovered", "enabled:active:bg-primary-container-hovered", "focus-visible:bg-primary-container-focused"] }, { intent: "secondary", design: "contrast", class: ["text-secondary", "enabled:hover:bg-secondary-container-hovered", "enabled:active:bg-secondary-container-hovered", "focus-visible:bg-secondary-container-focused"] }, { intent: "success", design: "contrast", class: ["text-success", "enabled:hover:bg-success-container-hovered", "enabled:active:bg-success-container-hovered", "focus-visible:bg-success-container-focused"] }, { intent: "alert", design: "contrast", class: ["text-alert", "enabled:hover:bg-alert-container-hovered", "enabled:active:bg-alert-container-hovered", "focus-visible:bg-alert-container-focused"] }, { intent: "danger", design: "contrast", class: ["text-error", "enabled:hover:bg-error-container-hovered", "enabled:active:bg-error-container-hovered", "focus-visible:bg-error-container-focused"] }, { intent: "neutral", design: "contrast", class: ["text-neutral", "enabled:hover:bg-neutral-container-hovered", "enabled:active:bg-neutral-container-hovered", "focus-visible:bg-neutral-container-focused"] }, { intent: "surface", design: "contrast", class: ["text-surface", "enabled:hover:bg-surface-container-hovered", "enabled:active:bg-surface-container-hovered", "focus-visible:bg-surface-container-focused"] }], defaultVariants: { design: "filled", intent: "primary", size: "md", shape: "rounded" } }), g = n.forwardRef(({ design: r = "filled", disabled: e = !1, intent: a = "primary", shape: t = "rounded", size: s = "md", ...o }, c) => n.createElement("button", { ref: c, className: d({ design: r, disabled: e, intent: a, shape: t, size: s }), disabled: !!e, ...o }));
|
4
|
+
export {
|
5
|
+
g as Button
|
6
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare const contrastVariants: ({
|
2
|
+
intent: "primary";
|
3
|
+
design: "contrast";
|
4
|
+
class: string[];
|
5
|
+
} | {
|
6
|
+
intent: "secondary";
|
7
|
+
design: "contrast";
|
8
|
+
class: string[];
|
9
|
+
} | {
|
10
|
+
intent: "success";
|
11
|
+
design: "contrast";
|
12
|
+
class: string[];
|
13
|
+
} | {
|
14
|
+
intent: "alert";
|
15
|
+
design: "contrast";
|
16
|
+
class: string[];
|
17
|
+
} | {
|
18
|
+
intent: "danger";
|
19
|
+
design: "contrast";
|
20
|
+
class: string[];
|
21
|
+
} | {
|
22
|
+
intent: "neutral";
|
23
|
+
design: "contrast";
|
24
|
+
class: string[];
|
25
|
+
} | {
|
26
|
+
intent: "surface";
|
27
|
+
design: "contrast";
|
28
|
+
class: string[];
|
29
|
+
})[];
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare const filledVariants: ({
|
2
|
+
intent: "primary";
|
3
|
+
design: "filled";
|
4
|
+
class: string[];
|
5
|
+
} | {
|
6
|
+
intent: "secondary";
|
7
|
+
design: "filled";
|
8
|
+
class: string[];
|
9
|
+
} | {
|
10
|
+
intent: "success";
|
11
|
+
design: "filled";
|
12
|
+
class: string[];
|
13
|
+
} | {
|
14
|
+
intent: "alert";
|
15
|
+
design: "filled";
|
16
|
+
class: string[];
|
17
|
+
} | {
|
18
|
+
intent: "danger";
|
19
|
+
design: "filled";
|
20
|
+
class: string[];
|
21
|
+
} | {
|
22
|
+
intent: "neutral";
|
23
|
+
design: "filled";
|
24
|
+
class: string[];
|
25
|
+
} | {
|
26
|
+
intent: "surface";
|
27
|
+
design: "filled";
|
28
|
+
class: string[];
|
29
|
+
})[];
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare const ghostVariants: ({
|
2
|
+
intent: "primary";
|
3
|
+
design: "ghost";
|
4
|
+
class: string[];
|
5
|
+
} | {
|
6
|
+
intent: "secondary";
|
7
|
+
design: "ghost";
|
8
|
+
class: string[];
|
9
|
+
} | {
|
10
|
+
intent: "success";
|
11
|
+
design: "ghost";
|
12
|
+
class: string[];
|
13
|
+
} | {
|
14
|
+
intent: "alert";
|
15
|
+
design: "ghost";
|
16
|
+
class: string[];
|
17
|
+
} | {
|
18
|
+
intent: "danger";
|
19
|
+
design: "ghost";
|
20
|
+
class: string[];
|
21
|
+
} | {
|
22
|
+
intent: "neutral";
|
23
|
+
design: "ghost";
|
24
|
+
class: string[];
|
25
|
+
} | {
|
26
|
+
intent: "surface";
|
27
|
+
design: "ghost";
|
28
|
+
class: string[];
|
29
|
+
})[];
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export { defaultVariants } from './default';
|
2
|
+
export { filledVariants } from './filled';
|
3
|
+
export { ghostVariants } from './ghost';
|
4
|
+
export { outlinedVariants } from './outlined';
|
5
|
+
export { tintedVariants } from './tinted';
|
6
|
+
export { contrastVariants } from './contrast';
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare const outlinedVariants: ({
|
2
|
+
intent: "primary";
|
3
|
+
design: "outlined";
|
4
|
+
class: string[];
|
5
|
+
} | {
|
6
|
+
intent: "secondary";
|
7
|
+
design: "outlined";
|
8
|
+
class: string[];
|
9
|
+
} | {
|
10
|
+
intent: "success";
|
11
|
+
design: "outlined";
|
12
|
+
class: string[];
|
13
|
+
} | {
|
14
|
+
intent: "alert";
|
15
|
+
design: "outlined";
|
16
|
+
class: string[];
|
17
|
+
} | {
|
18
|
+
intent: "danger";
|
19
|
+
design: "outlined";
|
20
|
+
class: string[];
|
21
|
+
} | {
|
22
|
+
intent: "neutral";
|
23
|
+
design: "outlined";
|
24
|
+
class: string[];
|
25
|
+
} | {
|
26
|
+
intent: "surface";
|
27
|
+
design: "outlined";
|
28
|
+
class: string[];
|
29
|
+
})[];
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare const tintedVariants: ({
|
2
|
+
intent: "primary";
|
3
|
+
design: "tinted";
|
4
|
+
class: string[];
|
5
|
+
} | {
|
6
|
+
intent: "secondary";
|
7
|
+
design: "tinted";
|
8
|
+
class: string[];
|
9
|
+
} | {
|
10
|
+
intent: "success";
|
11
|
+
design: "tinted";
|
12
|
+
class: string[];
|
13
|
+
} | {
|
14
|
+
intent: "alert";
|
15
|
+
design: "tinted";
|
16
|
+
class: string[];
|
17
|
+
} | {
|
18
|
+
intent: "danger";
|
19
|
+
design: "tinted";
|
20
|
+
class: string[];
|
21
|
+
} | {
|
22
|
+
intent: "neutral";
|
23
|
+
design: "tinted";
|
24
|
+
class: string[];
|
25
|
+
} | {
|
26
|
+
intent: "surface";
|
27
|
+
design: "tinted";
|
28
|
+
class: string[];
|
29
|
+
})[];
|
package/package.json
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spark-ui/button",
|
3
|
-
"version": "1.
|
4
|
-
"description": "
|
3
|
+
"version": "1.2.1",
|
4
|
+
"description": "Button component is used to trigger an action or event, such as submitting a form, opening a Dialog, canceling an action, or performing a delete operation.",
|
5
|
+
"publishConfig": {
|
6
|
+
"access": "public"
|
7
|
+
},
|
5
8
|
"main": "./dist/index.js",
|
6
9
|
"module": "./dist/index.mjs",
|
7
10
|
"types": "./dist/index.d.ts",
|
8
11
|
"scripts": {
|
9
12
|
"build": "vite build"
|
10
|
-
}
|
13
|
+
},
|
14
|
+
"dependencies": {
|
15
|
+
"class-variance-authority": "0.4.0"
|
16
|
+
},
|
17
|
+
"gitHead": "8d5929fd944837fe356de0a553b2db7577fa83d2"
|
11
18
|
}
|
package/tsconfig.json
CHANGED
@@ -1,12 +1,4 @@
|
|
1
1
|
{
|
2
2
|
"extends": "../../../tsconfig.json",
|
3
|
-
"
|
4
|
-
|
5
|
-
"declarationDir": "./dist",
|
6
|
-
"rootDir": "./src"
|
7
|
-
},
|
8
|
-
"include": [
|
9
|
-
"src/**/*",
|
10
|
-
"../../../global.d.ts"
|
11
|
-
]
|
12
|
-
}
|
3
|
+
"include": ["src/**/*", "../../../global.d.ts"]
|
4
|
+
}
|
package/vite.config.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import path from 'path'
|
2
|
-
|
3
2
|
import { getComponentConfiguration } from '../../../config/index'
|
4
3
|
|
5
|
-
const {name} = require(path.resolve(__dirname, 'package.json'))
|
4
|
+
const { name } = require(path.resolve(__dirname, 'package.json'))
|
6
5
|
|
7
|
-
export default getComponentConfiguration(name)
|
6
|
+
export default getComponentConfiguration(name)
|