@juspay/svelte-ui-components 2.116.0 → 2.117.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.
@@ -158,6 +158,21 @@
158
158
  --_btn-hover-border: none;
159
159
  }
160
160
 
161
+ /* Transparent chassis for gradient marketing CTAs — deliberately no background
162
+ of its own. Pair with a --button-background gradient (and usually a matching
163
+ --button-hover-color, since --_btn-hover-color sits before --button-background
164
+ in the hover fallback chain and would otherwise flatten the gradient to
165
+ transparent on hover). Geometry (padding/font-size) is intentionally left to
166
+ the size preset, not this variant. */
167
+ .variant-brand {
168
+ --_btn-color: transparent;
169
+ --_btn-text-color: #ffffff;
170
+ --_btn-border: none;
171
+ --_btn-hover-color: transparent;
172
+ --_btn-hover-text-color: #ffffff;
173
+ --_btn-hover-border: none;
174
+ }
175
+
161
176
  /* ---- Size defaults (md reproduces the legacy 16px padding / 14px font) ---- */
162
177
  .size-sm {
163
178
  --_btn-padding: 8px 12px;
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  export type LoaderType = 'Circular' | 'ProgressBar';
3
3
  /** Visual style of the button. Maps to a built-in palette via `--button-*` variables. */
4
- export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';
4
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive' | 'brand';
5
5
  /** Size preset controlling padding/height/font-size. */
6
6
  export type ButtonSize = 'sm' | 'md' | 'lg';
7
7
  export type ButtonProperties = OptionalButtonProperties & ButtonEventProperties;
@@ -9,7 +9,8 @@ export type OptionalButtonProperties = {
9
9
  text?: string;
10
10
  /**
11
11
  * Visual style: `primary` (default, filled), `secondary` (outlined), `ghost`
12
- * (transparent), `destructive` (danger). Each maps to the `--button-*` variables, so an
12
+ * (transparent), `destructive` (danger), `brand` (transparent chassis for gradient CTAs
13
+ * pair with a `--button-background` gradient). Each maps to the `--button-*` variables, so an
13
14
  * explicit `--button-color` / `classes` override always wins over the variant default.
14
15
  */
15
16
  variant?: ButtonVariant;
@@ -88,6 +88,19 @@
88
88
  justify-content: var(--chip-input-justify-content, flex-start);
89
89
  gap: var(--chip-input-gap, 6px);
90
90
  width: var(--chip-input-width, 100%);
91
+
92
+ /* Capture the surrounding cascade's Pill and Input values under distinct names, so the
93
+ per-token mappings below can fall back to them. This has to happen HERE, on the root, where
94
+ --pill-* and --input-* have not yet been re-declared: reading them in the same declaration
95
+ that sets them would be a custom-property cycle and would compute to invalid. Consumers that
96
+ theme Pill/Input app-wide get chips that match the rest of their UI, instead of the library's
97
+ hardcoded light-theme hexes overriding their theme. */
98
+ --chip-input-pill-background-default: var(--pill-background, #e0e0e0);
99
+ --chip-input-pill-color-default: var(--pill-color, #333333);
100
+ --chip-input-pill-dismiss-color-default: var(--pill-dismiss-color, currentColor);
101
+ --chip-input-draft-border-default: var(--input-border, 1px solid transparent);
102
+ --chip-input-draft-focus-border-default: var(--input-focus-border, 1px solid transparent);
103
+ --chip-input-draft-radius-default: var(--input-radius, 4px);
91
104
  }
92
105
 
93
106
  .chip-input-draft-wrap {
@@ -96,8 +109,8 @@
96
109
 
97
110
  .chip-input :global(.chip-input-pill) {
98
111
  --pill-gap: var(--chip-input-pill-gap, 4px);
99
- --pill-background: var(--chip-input-pill-background, #e0e0e0);
100
- --pill-color: var(--chip-input-pill-color, #333333);
112
+ --pill-background: var(--chip-input-pill-background, var(--chip-input-pill-background-default));
113
+ --pill-color: var(--chip-input-pill-color, var(--chip-input-pill-color-default));
101
114
  --pill-font-size: var(--chip-input-pill-font-size, 13px);
102
115
  --pill-font-weight: var(--chip-input-pill-font-weight, 500);
103
116
  --pill-padding: var(--chip-input-pill-padding, 6px 10px);
@@ -105,15 +118,21 @@
105
118
  --pill-border: var(--chip-input-pill-border, none);
106
119
  --pill-max-width: var(--chip-input-pill-max-width);
107
120
  --pill-dismiss-size: var(--chip-input-pill-dismiss-size, 14px);
108
- --pill-dismiss-color: var(--chip-input-pill-dismiss-color, currentColor);
121
+ --pill-dismiss-color: var(
122
+ --chip-input-pill-dismiss-color,
123
+ var(--chip-input-pill-dismiss-color-default)
124
+ );
109
125
  }
110
126
 
111
127
  .chip-input-draft-wrap :global(.chip-input-draft) {
112
128
  --input-width: var(--chip-input-draft-width, 90px);
113
129
  --input-height: var(--chip-input-draft-height, 28px);
114
- --input-border: var(--chip-input-draft-border, 1px solid transparent);
115
- --input-radius: var(--chip-input-draft-radius, 4px);
116
- --input-focus-border: var(--chip-input-draft-focus-border, 1px solid transparent);
130
+ --input-border: var(--chip-input-draft-border, var(--chip-input-draft-border-default));
131
+ --input-radius: var(--chip-input-draft-radius, var(--chip-input-draft-radius-default));
132
+ --input-focus-border: var(
133
+ --chip-input-draft-focus-border,
134
+ var(--chip-input-draft-focus-border-default)
135
+ );
117
136
  --input-padding: var(--chip-input-draft-padding, 0 2px);
118
137
  --input-margin: 0;
119
138
  --input-font-size: var(--chip-input-draft-font-size, 13px);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.116.0",
3
+ "version": "2.117.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",