@hachej/boring-ui-kit 0.1.82 → 0.1.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -175,7 +175,7 @@ type StatusBadgeProps = BadgeProps & {
175
175
  declare function StatusBadge({ className, tone, variant, ...props }: StatusBadgeProps): React.JSX.Element;
176
176
 
177
177
  type MeterTone = 'default' | 'warning' | 'danger';
178
- interface MeterProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'role'> {
178
+ interface MeterProps extends Omit<React.ComponentProps<'progress'>, 'role' | 'value' | 'max'> {
179
179
  /** Filled fraction as a percentage in the range 0..100. */
180
180
  value: number;
181
181
  /** Accessible label for the progressbar (screen readers). */
@@ -183,9 +183,9 @@ interface MeterProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'role'>
183
183
  tone?: MeterTone;
184
184
  }
185
185
  /**
186
- * Accessible horizontal usage/progress bar. Renders a subtle track with a
187
- * proportional fill and exposes `role="progressbar"` with aria value props so
188
- * consumers get an accessible meter out of the box.
186
+ * Accessible horizontal usage/progress bar. A native `<progress>` element
187
+ * gives the browser the dynamic fill without inline styles, which keeps it
188
+ * compatible with applications that enforce nonce-only style CSPs.
189
189
  */
190
190
  declare function Meter({ value, label, tone, className, ...props }: MeterProps): React.JSX.Element;
191
191
 
package/dist/index.js CHANGED
@@ -1047,31 +1047,29 @@ function StatusBadge({ className, tone = "neutral", variant = "ghost", ...props
1047
1047
  // src/meter.tsx
1048
1048
  import { jsx as jsx20 } from "react/jsx-runtime";
1049
1049
  var toneFill = {
1050
- default: "bg-primary",
1051
- warning: "bg-[color:var(--boring-warning,var(--accent-foreground))]",
1052
- danger: "bg-destructive"
1050
+ default: "[&::-webkit-progress-value]:bg-primary [&::-moz-progress-bar]:bg-primary",
1051
+ warning: "[&::-webkit-progress-value]:bg-[color:var(--boring-warning,var(--accent-foreground))] [&::-moz-progress-bar]:bg-[color:var(--boring-warning,var(--accent-foreground))]",
1052
+ danger: "[&::-webkit-progress-value]:bg-destructive [&::-moz-progress-bar]:bg-destructive"
1053
1053
  };
1054
1054
  function Meter({ value, label, tone = "default", className, ...props }) {
1055
1055
  const clamped = Number.isFinite(value) ? Math.max(0, Math.min(100, value)) : 0;
1056
1056
  return /* @__PURE__ */ jsx20(
1057
- "div",
1057
+ "progress",
1058
1058
  {
1059
1059
  role: "progressbar",
1060
+ value: clamped,
1061
+ max: 100,
1060
1062
  "aria-valuenow": Math.round(clamped),
1061
1063
  "aria-valuemin": 0,
1062
1064
  "aria-valuemax": 100,
1063
1065
  "aria-label": label,
1064
1066
  "data-slot": "meter",
1065
- className: cn("relative h-2 w-full overflow-hidden rounded-full bg-muted", className),
1066
- ...props,
1067
- children: /* @__PURE__ */ jsx20(
1068
- "div",
1069
- {
1070
- "data-slot": "meter-fill",
1071
- className: cn("h-full rounded-full transition-[width] duration-300 ease-out", toneFill[tone]),
1072
- style: { width: `${clamped}%` }
1073
- }
1074
- )
1067
+ className: cn(
1068
+ "h-2 w-full overflow-hidden rounded-full border-0 bg-muted [&::-webkit-progress-bar]:bg-muted [&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:transition-all [&::-webkit-progress-value]:duration-300 [&::-moz-progress-bar]:rounded-full",
1069
+ toneFill[tone],
1070
+ className
1071
+ ),
1072
+ ...props
1075
1073
  }
1076
1074
  );
1077
1075
  }
package/dist/styles.css CHANGED
@@ -27,7 +27,6 @@
27
27
  --tracking-widest: 0.1em;
28
28
  --leading-snug: 1.375;
29
29
  --radius-xs: 0.125rem;
30
- --ease-out: cubic-bezier(0, 0, 0.2, 1);
31
30
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
32
31
  --animate-spin: spin 1s linear infinite;
33
32
  --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
@@ -171,6 +170,9 @@
171
170
  .grid {
172
171
  display: grid;
173
172
  }
173
+ .inline {
174
+ display: inline;
175
+ }
174
176
  .inline-block {
175
177
  display: inline-block;
176
178
  }
@@ -713,9 +715,6 @@
713
715
  .bg-\[color\:var\(--boring-success-soft\,var\(--secondary\)\)\] {
714
716
  background-color: var(--boring-success-soft,var(--secondary));
715
717
  }
716
- .bg-\[color\:var\(--boring-warning\,var\(--accent-foreground\)\)\] {
717
- background-color: var(--boring-warning,var(--accent-foreground));
718
- }
719
718
  .bg-\[color\:var\(--boring-warning-soft\,var\(--accent\)\)\] {
720
719
  background-color: var(--boring-warning-soft,var(--accent));
721
720
  }
@@ -1133,11 +1132,6 @@
1133
1132
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1134
1133
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1135
1134
  }
1136
- .transition-\[width\] {
1137
- transition-property: width;
1138
- transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1139
- transition-duration: var(--tw-duration, var(--default-transition-duration));
1140
- }
1141
1135
  .transition-all {
1142
1136
  transition-property: all;
1143
1137
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -1174,18 +1168,10 @@
1174
1168
  --tw-duration: 200ms;
1175
1169
  transition-duration: 200ms;
1176
1170
  }
1177
- .duration-300 {
1178
- --tw-duration: 300ms;
1179
- transition-duration: 300ms;
1180
- }
1181
1171
  .ease-in-out {
1182
1172
  --tw-ease: var(--ease-in-out);
1183
1173
  transition-timing-function: var(--ease-in-out);
1184
1174
  }
1185
- .ease-out {
1186
- --tw-ease: var(--ease-out);
1187
- transition-timing-function: var(--ease-out);
1188
- }
1189
1175
  .outline-none {
1190
1176
  --tw-outline-style: none;
1191
1177
  outline-style: none;
@@ -2443,6 +2429,64 @@
2443
2429
  height: calc(var(--spacing) * 4);
2444
2430
  }
2445
2431
  }
2432
+ .\[\&\:\:-moz-progress-bar\]\:rounded-full {
2433
+ &::-moz-progress-bar {
2434
+ border-radius: calc(infinity * 1px);
2435
+ }
2436
+ }
2437
+ .\[\&\:\:-moz-progress-bar\]\:bg-\[color\:var\(--boring-warning\,var\(--accent-foreground\)\)\] {
2438
+ &::-moz-progress-bar {
2439
+ background-color: var(--boring-warning,var(--accent-foreground));
2440
+ }
2441
+ }
2442
+ .\[\&\:\:-moz-progress-bar\]\:bg-destructive {
2443
+ &::-moz-progress-bar {
2444
+ background-color: var(--boring-destructive);
2445
+ }
2446
+ }
2447
+ .\[\&\:\:-moz-progress-bar\]\:bg-primary {
2448
+ &::-moz-progress-bar {
2449
+ background-color: var(--boring-primary);
2450
+ }
2451
+ }
2452
+ .\[\&\:\:-webkit-progress-bar\]\:bg-muted {
2453
+ &::-webkit-progress-bar {
2454
+ background-color: var(--boring-muted);
2455
+ }
2456
+ }
2457
+ .\[\&\:\:-webkit-progress-value\]\:rounded-full {
2458
+ &::-webkit-progress-value {
2459
+ border-radius: calc(infinity * 1px);
2460
+ }
2461
+ }
2462
+ .\[\&\:\:-webkit-progress-value\]\:bg-\[color\:var\(--boring-warning\,var\(--accent-foreground\)\)\] {
2463
+ &::-webkit-progress-value {
2464
+ background-color: var(--boring-warning,var(--accent-foreground));
2465
+ }
2466
+ }
2467
+ .\[\&\:\:-webkit-progress-value\]\:bg-destructive {
2468
+ &::-webkit-progress-value {
2469
+ background-color: var(--boring-destructive);
2470
+ }
2471
+ }
2472
+ .\[\&\:\:-webkit-progress-value\]\:bg-primary {
2473
+ &::-webkit-progress-value {
2474
+ background-color: var(--boring-primary);
2475
+ }
2476
+ }
2477
+ .\[\&\:\:-webkit-progress-value\]\:transition-all {
2478
+ &::-webkit-progress-value {
2479
+ transition-property: all;
2480
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
2481
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
2482
+ }
2483
+ }
2484
+ .\[\&\:\:-webkit-progress-value\]\:duration-300 {
2485
+ &::-webkit-progress-value {
2486
+ --tw-duration: 300ms;
2487
+ transition-duration: 300ms;
2488
+ }
2489
+ }
2446
2490
  .\[\&\:\:-webkit-scrollbar\]\:hidden {
2447
2491
  &::-webkit-scrollbar {
2448
2492
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-ui-kit",
3
- "version": "0.1.82",
3
+ "version": "0.1.84",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Shared shadcn-style UI primitives for Boring packages and app-generated panes.",