@epilot/spark-ui 0.18.2 → 0.20.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/dist/components/attachment.d.cts +1 -1
- package/dist/components/attachment.d.ts +1 -1
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.cjs.map +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +2 -1
- package/dist/components/badge.d.ts +2 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/{energy-bar-chart.cjs → bar-chart-with-total.cjs} +4 -4
- package/dist/components/bar-chart-with-total.cjs.map +1 -0
- package/dist/components/bar-chart-with-total.d.cts +19 -0
- package/dist/components/bar-chart-with-total.d.ts +19 -0
- package/dist/components/{energy-bar-chart.js → bar-chart-with-total.js} +4 -4
- package/dist/components/bar-chart-with-total.js.map +1 -0
- package/dist/components/bar-chart.cjs +1 -1
- package/dist/components/bar-chart.js +2 -2
- package/dist/components/bubble.d.cts +1 -1
- package/dist/components/bubble.d.ts +1 -1
- package/dist/components/button-group.cjs +2 -2
- package/dist/components/button-group.cjs.map +1 -1
- package/dist/components/button-group.d.cts +1 -1
- package/dist/components/button-group.d.ts +1 -1
- package/dist/components/button-group.js +2 -2
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.cjs +6 -4
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +6 -5
- package/dist/components/button.d.ts +6 -5
- package/dist/components/button.js +6 -4
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.cjs +3 -3
- package/dist/components/calendar.cjs.map +1 -1
- package/dist/components/calendar.js +3 -3
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/callout.cjs +10 -10
- package/dist/components/callout.cjs.map +1 -1
- package/dist/components/callout.d.cts +1 -1
- package/dist/components/callout.d.ts +1 -1
- package/dist/components/callout.js +10 -10
- package/dist/components/callout.js.map +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/circular-gauge.cjs +7 -7
- package/dist/components/circular-gauge.cjs.map +1 -1
- package/dist/components/circular-gauge.js +7 -7
- package/dist/components/circular-gauge.js.map +1 -1
- package/dist/components/day-of-week-picker.cjs +21 -41
- package/dist/components/day-of-week-picker.cjs.map +1 -1
- package/dist/components/day-of-week-picker.d.cts +19 -23
- package/dist/components/day-of-week-picker.d.ts +19 -23
- package/dist/components/day-of-week-picker.js +21 -41
- package/dist/components/day-of-week-picker.js.map +1 -1
- package/dist/components/{device-card.cjs → entity-card.cjs} +31 -31
- package/dist/components/entity-card.cjs.map +1 -0
- package/dist/components/{device-card.d.cts → entity-card.d.cts} +15 -15
- package/dist/components/{device-card.d.ts → entity-card.d.ts} +15 -15
- package/dist/components/{device-card.js → entity-card.js} +20 -20
- package/dist/components/entity-card.js.map +1 -0
- package/dist/components/field.cjs +1 -1
- package/dist/components/field.cjs.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/{feed-in-hero.cjs → hero-metric.cjs} +10 -15
- package/dist/components/hero-metric.cjs.map +1 -0
- package/dist/components/hero-metric.d.cts +27 -0
- package/dist/components/hero-metric.d.ts +27 -0
- package/dist/components/{feed-in-hero.js → hero-metric.js} +7 -12
- package/dist/components/hero-metric.js.map +1 -0
- package/dist/components/info-block.d.cts +1 -1
- package/dist/components/info-block.d.ts +1 -1
- package/dist/components/input-date.cjs +6 -6
- package/dist/components/input-date.cjs.map +1 -1
- package/dist/components/input-date.d.cts +2 -1
- package/dist/components/input-date.d.ts +2 -1
- package/dist/components/input-date.js +6 -6
- package/dist/components/input-date.js.map +1 -1
- package/dist/components/input-group.d.cts +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-otp.cjs +1 -1
- package/dist/components/input-otp.cjs.map +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.cjs.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.cjs.map +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/label.js.map +1 -1
- package/dist/components/line-chart.cjs +2 -2
- package/dist/components/line-chart.js +3 -3
- package/dist/components/number-flow.d.cts +12 -2
- package/dist/components/number-flow.d.ts +12 -2
- package/dist/components/page-header.d.cts +1 -1
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/period-tabs.cjs +2 -22
- package/dist/components/period-tabs.cjs.map +1 -1
- package/dist/components/period-tabs.d.cts +5 -22
- package/dist/components/period-tabs.d.ts +5 -22
- package/dist/components/period-tabs.js +2 -22
- package/dist/components/period-tabs.js.map +1 -1
- package/dist/components/pill.cjs +2 -2
- package/dist/components/pill.cjs.map +1 -1
- package/dist/components/pill.js +2 -2
- package/dist/components/pill.js.map +1 -1
- package/dist/components/progress.cjs +1 -1
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.cjs.map +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/radio.js.map +1 -1
- package/dist/components/sankey-chart.cjs +1 -11
- package/dist/components/sankey-chart.cjs.map +1 -1
- package/dist/components/sankey-chart.d.cts +2 -3
- package/dist/components/sankey-chart.d.ts +2 -3
- package/dist/components/sankey-chart.js +2 -11
- package/dist/components/sankey-chart.js.map +1 -1
- package/dist/components/segmented-control.cjs +2 -2
- package/dist/components/segmented-control.cjs.map +1 -1
- package/dist/components/segmented-control.js +2 -2
- package/dist/components/segmented-control.js.map +1 -1
- package/dist/components/select.cjs +32 -2
- package/dist/components/select.cjs.map +1 -1
- package/dist/components/select.d.cts +11 -1
- package/dist/components/select.d.ts +11 -1
- package/dist/components/select.js +32 -4
- package/dist/components/select.js.map +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.d.cts +4 -4
- package/dist/components/stepper.d.ts +4 -4
- package/dist/components/stepper.js +1 -1
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/table.cjs +147 -0
- package/dist/components/table.cjs.map +1 -0
- package/dist/components/table.d.cts +75 -0
- package/dist/components/table.d.ts +75 -0
- package/dist/components/table.js +138 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.cjs.map +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/typography.cjs +1 -1
- package/dist/components/typography.cjs.map +1 -1
- package/dist/components/typography.d.cts +4 -1
- package/dist/components/typography.d.ts +4 -1
- package/dist/components/typography.js +1 -1
- package/dist/components/typography.js.map +1 -1
- package/dist/components/wizard-layout.cjs +57 -0
- package/dist/components/wizard-layout.cjs.map +1 -0
- package/dist/components/wizard-layout.d.cts +34 -0
- package/dist/components/wizard-layout.d.ts +34 -0
- package/dist/components/wizard-layout.js +50 -0
- package/dist/components/wizard-layout.js.map +1 -0
- package/dist/lib/accent-colors.cjs +4 -1
- package/dist/lib/accent-colors.cjs.map +1 -1
- package/dist/lib/accent-colors.d.cts +1 -1
- package/dist/lib/accent-colors.d.ts +1 -1
- package/dist/lib/accent-colors.js +4 -1
- package/dist/lib/accent-colors.js.map +1 -1
- package/dist/lib/accent-theme.cjs +144 -9
- package/dist/lib/accent-theme.cjs.map +1 -1
- package/dist/lib/accent-theme.d.cts +37 -1
- package/dist/lib/accent-theme.d.ts +37 -1
- package/dist/lib/accent-theme.js +140 -10
- package/dist/lib/accent-theme.js.map +1 -1
- package/dist/styles/index.css +10 -1
- package/dist/styles/spark-default.css +75 -321
- package/dist/styles/theme.css +54 -8
- package/dist/utils/format.cjs +0 -13
- package/dist/utils/format.cjs.map +1 -1
- package/dist/utils/format.d.cts +1 -7
- package/dist/utils/format.d.ts +1 -7
- package/dist/utils/format.js +1 -12
- package/dist/utils/format.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/battery-progress-row.cjs +0 -135
- package/dist/components/battery-progress-row.cjs.map +0 -1
- package/dist/components/battery-progress-row.d.cts +0 -69
- package/dist/components/battery-progress-row.d.ts +0 -69
- package/dist/components/battery-progress-row.js +0 -125
- package/dist/components/battery-progress-row.js.map +0 -1
- package/dist/components/device-card.cjs.map +0 -1
- package/dist/components/device-card.js.map +0 -1
- package/dist/components/energy-bar-chart.cjs.map +0 -1
- package/dist/components/energy-bar-chart.d.cts +0 -43
- package/dist/components/energy-bar-chart.d.ts +0 -43
- package/dist/components/energy-bar-chart.js.map +0 -1
- package/dist/components/energy-breakdown.cjs +0 -80
- package/dist/components/energy-breakdown.cjs.map +0 -1
- package/dist/components/energy-breakdown.d.cts +0 -24
- package/dist/components/energy-breakdown.d.ts +0 -24
- package/dist/components/energy-breakdown.js +0 -79
- package/dist/components/energy-breakdown.js.map +0 -1
- package/dist/components/energy-history-chart.cjs +0 -63
- package/dist/components/energy-history-chart.cjs.map +0 -1
- package/dist/components/energy-history-chart.d.cts +0 -64
- package/dist/components/energy-history-chart.d.ts +0 -64
- package/dist/components/energy-history-chart.js +0 -62
- package/dist/components/energy-history-chart.js.map +0 -1
- package/dist/components/feed-in-hero.cjs.map +0 -1
- package/dist/components/feed-in-hero.d.cts +0 -32
- package/dist/components/feed-in-hero.d.ts +0 -32
- package/dist/components/feed-in-hero.js.map +0 -1
- package/dist/components/metering-row.cjs +0 -59
- package/dist/components/metering-row.cjs.map +0 -1
- package/dist/components/metering-row.d.cts +0 -31
- package/dist/components/metering-row.d.ts +0 -31
- package/dist/components/metering-row.js +0 -55
- package/dist/components/metering-row.js.map +0 -1
- package/dist/components/money-saved-block.cjs +0 -83
- package/dist/components/money-saved-block.cjs.map +0 -1
- package/dist/components/money-saved-block.d.cts +0 -55
- package/dist/components/money-saved-block.d.ts +0 -55
- package/dist/components/money-saved-block.js +0 -76
- package/dist/components/money-saved-block.js.map +0 -1
- package/dist/components/on-off-button.cjs +0 -32
- package/dist/components/on-off-button.cjs.map +0 -1
- package/dist/components/on-off-button.d.cts +0 -18
- package/dist/components/on-off-button.d.ts +0 -18
- package/dist/components/on-off-button.js +0 -31
- package/dist/components/on-off-button.js.map +0 -1
- package/dist/components/onboarding-layout.cjs +0 -67
- package/dist/components/onboarding-layout.cjs.map +0 -1
- package/dist/components/onboarding-layout.d.cts +0 -44
- package/dist/components/onboarding-layout.d.ts +0 -44
- package/dist/components/onboarding-layout.js +0 -60
- package/dist/components/onboarding-layout.js.map +0 -1
- package/dist/components/power-history-chart.cjs +0 -498
- package/dist/components/power-history-chart.cjs.map +0 -1
- package/dist/components/power-history-chart.d.cts +0 -71
- package/dist/components/power-history-chart.d.ts +0 -71
- package/dist/components/power-history-chart.js +0 -496
- package/dist/components/power-history-chart.js.map +0 -1
- package/dist/components/power-history.cjs +0 -114
- package/dist/components/power-history.cjs.map +0 -1
- package/dist/components/power-history.d.cts +0 -40
- package/dist/components/power-history.d.ts +0 -41
- package/dist/components/power-history.js +0 -114
- package/dist/components/power-history.js.map +0 -1
- package/dist/components/power-network.cjs +0 -559
- package/dist/components/power-network.cjs.map +0 -1
- package/dist/components/power-network.d.cts +0 -80
- package/dist/components/power-network.d.ts +0 -80
- package/dist/components/power-network.js +0 -553
- package/dist/components/power-network.js.map +0 -1
- package/dist/components/smart-toggle-button.cjs +0 -24
- package/dist/components/smart-toggle-button.cjs.map +0 -1
- package/dist/components/smart-toggle-button.d.cts +0 -16
- package/dist/components/smart-toggle-button.d.ts +0 -16
- package/dist/components/smart-toggle-button.js +0 -23
- package/dist/components/smart-toggle-button.js.map +0 -1
- package/dist/components/solar-forecast-chart.cjs +0 -108
- package/dist/components/solar-forecast-chart.cjs.map +0 -1
- package/dist/components/solar-forecast-chart.d.cts +0 -77
- package/dist/components/solar-forecast-chart.d.ts +0 -77
- package/dist/components/solar-forecast-chart.js +0 -103
- package/dist/components/solar-forecast-chart.js.map +0 -1
- package/dist/number-flow-Bch81ixZ.d.cts +0 -14
- package/dist/number-flow-Bch81ixZ.d.ts +0 -14
- package/dist/utils/build-sankey-nodes.cjs +0 -72
- package/dist/utils/build-sankey-nodes.cjs.map +0 -1
- package/dist/utils/build-sankey-nodes.d.cts +0 -27
- package/dist/utils/build-sankey-nodes.d.ts +0 -27
- package/dist/utils/build-sankey-nodes.js +0 -71
- package/dist/utils/build-sankey-nodes.js.map +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tone } from "../lib/tones.js";
|
|
4
|
-
|
|
5
|
-
//#region src/components/feed-in-hero.d.ts
|
|
6
|
-
declare const FeedInHero: ({
|
|
7
|
-
className,
|
|
8
|
-
...rest
|
|
9
|
-
}: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
/**
|
|
11
|
-
* Label row above the value. Lays out children in a flex row with a small
|
|
12
|
-
* gap so a tooltip / icon can sit alongside the label text.
|
|
13
|
-
*/
|
|
14
|
-
declare const FeedInHeroLabel: ({
|
|
15
|
-
className,
|
|
16
|
-
...rest
|
|
17
|
-
}: React.ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
declare const FeedInHeroValue: ({
|
|
19
|
-
className,
|
|
20
|
-
tone,
|
|
21
|
-
...rest
|
|
22
|
-
}: React.ComponentProps<"span"> & {
|
|
23
|
-
tone?: Tone;
|
|
24
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
/** Smaller-weight unit suffix that sits inline with the value (e.g. "W"). */
|
|
26
|
-
declare const FeedInHeroValueUnit: ({
|
|
27
|
-
className,
|
|
28
|
-
...rest
|
|
29
|
-
}: React.ComponentProps<"span">) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { FeedInHero, FeedInHeroLabel, FeedInHeroValue, FeedInHeroValueUnit };
|
|
32
|
-
//# sourceMappingURL=feed-in-hero.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"feed-in-hero.js","names":[],"sources":["../../src/components/feed-in-hero.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\n\nconst FeedInHero = ({ className, ...rest }: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex flex-col items-center gap-1 rounded-lg border border-gray p-5 text-center',\n className,\n )}\n {...rest}\n />\n )\n}\n\n/**\n * Label row above the value. Lays out children in a flex row with a small\n * gap so a tooltip / icon can sit alongside the label text.\n */\nconst FeedInHeroLabel = ({\n className,\n ...rest\n}: React.ComponentProps<'div'>) => {\n return (\n <div\n className={cn(\n 'flex items-center gap-1.5 text-xs font-medium text-gray-light',\n className,\n )}\n {...rest}\n />\n )\n}\n\nconst valueToneVariants = cva('text-4xl font-bold tabular-nums', {\n variants: {\n tone: {\n success: 'text-success',\n warning: 'text-warning',\n error: 'text-error',\n accent: 'text-accent',\n neutral: 'text-gray',\n },\n },\n defaultVariants: {\n tone: 'neutral',\n },\n})\n\nconst FeedInHeroValue = ({\n className,\n tone,\n ...rest\n}: React.ComponentProps<'span'> & { tone?: Tone }) => {\n return <span className={valueToneVariants({ tone, className })} {...rest} />\n}\n\n/** Smaller-weight unit suffix that sits inline with the value (e.g. \"W\"). */\nconst FeedInHeroValueUnit = ({\n className,\n ...rest\n}: React.ComponentProps<'span'>) => {\n return <span className={cn('text-2xl font-semibold', className)} {...rest} />\n}\n\nexport { FeedInHero, FeedInHeroLabel, FeedInHeroValue, FeedInHeroValueUnit }\n"],"mappings":";;;;;AAIA,MAAM,cAAc,EAAE,WAAW,GAAG,WAAwC;CAC1E,OACE,oBAAC,OAAD;EACE,WAAW,GACT,kFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;;;;AAMA,MAAM,mBAAmB,EACvB,WACA,GAAG,WAC8B;CACjC,OACE,oBAAC,OAAD;EACE,WAAW,GACT,iEACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,oBAAoB,IAAI,mCAAmC;CAC/D,UAAU,EACR,MAAM;EACJ,SAAS;EACT,SAAS;EACT,OAAO;EACP,QAAQ;EACR,SAAS;CACX,EACF;CACA,iBAAiB,EACf,MAAM,UACR;AACF,CAAC;AAED,MAAM,mBAAmB,EACvB,WACA,MACA,GAAG,WACiD;CACpD,OAAO,oBAAC,QAAD;EAAM,WAAW,kBAAkB;GAAE;GAAM;EAAU,CAAC;EAAG,GAAI;CAAO,CAAA;AAC7E;;AAGA,MAAM,uBAAuB,EAC3B,WACA,GAAG,WAC+B;CAClC,OAAO,oBAAC,QAAD;EAAM,WAAW,GAAG,0BAA0B,SAAS;EAAG,GAAI;CAAO,CAAA;AAC9E"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_components_icon = require("./icon.cjs");
|
|
4
|
-
let react = require("react");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let cnfast = require("cnfast");
|
|
7
|
-
//#region src/components/metering-row.tsx
|
|
8
|
-
const MeteringRowContext = (0, react.createContext)(null);
|
|
9
|
-
function useMeteringRowTone() {
|
|
10
|
-
const tone = (0, react.useContext)(MeteringRowContext);
|
|
11
|
-
if (!tone) throw new Error("MeteringRow.* must be rendered inside <MeteringRow>");
|
|
12
|
-
return tone;
|
|
13
|
-
}
|
|
14
|
-
const MeteringRow = ({ className, tone, ...rest }) => {
|
|
15
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MeteringRowContext.Provider, {
|
|
16
|
-
value: tone,
|
|
17
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
18
|
-
className: (0, cnfast.cn)("group flex items-center gap-3", className),
|
|
19
|
-
"data-tone": tone,
|
|
20
|
-
...rest
|
|
21
|
-
})
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
const toneToIconColor = {
|
|
25
|
-
accent: "accent",
|
|
26
|
-
neutral: "neutral",
|
|
27
|
-
success: "success",
|
|
28
|
-
warning: "warning",
|
|
29
|
-
error: "danger"
|
|
30
|
-
};
|
|
31
|
-
const MeteringRowIcon = ({ className, icon: Glyph, ...rest }) => {
|
|
32
|
-
const tone = useMeteringRowTone();
|
|
33
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_icon.Icon, {
|
|
34
|
-
...rest,
|
|
35
|
-
className,
|
|
36
|
-
color: toneToIconColor[tone],
|
|
37
|
-
size: "large",
|
|
38
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Glyph, {})
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
const MeteringRowLabel = ({ className, ...rest }) => {
|
|
42
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
43
|
-
className: (0, cnfast.cn)("flex-1 text-sm text-gray", className),
|
|
44
|
-
...rest
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
const MeteringRowValue = ({ className, ...rest }) => {
|
|
48
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49
|
-
className: (0, cnfast.cn)("text-lg leading-tight font-bold tabular-nums group-data-[tone=accent]:text-accent group-data-[tone=error]:text-error group-data-[tone=neutral]:text-gray group-data-[tone=success]:text-success group-data-[tone=warning]:text-warning", className),
|
|
50
|
-
...rest
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
//#endregion
|
|
54
|
-
exports.MeteringRow = MeteringRow;
|
|
55
|
-
exports.MeteringRowIcon = MeteringRowIcon;
|
|
56
|
-
exports.MeteringRowLabel = MeteringRowLabel;
|
|
57
|
-
exports.MeteringRowValue = MeteringRowValue;
|
|
58
|
-
|
|
59
|
-
//# sourceMappingURL=metering-row.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metering-row.cjs","names":["Icon"],"sources":["../../src/components/metering-row.tsx"],"sourcesContent":["import type { SparkIcon } from '@epilot/spark-icons'\nimport { createContext, useContext } from 'react'\nimport type { SparkAccentColor } from '../lib/accent-colors'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\nimport { Icon } from './icon'\n\nconst MeteringRowContext = createContext<Tone | null>(null)\n\nfunction useMeteringRowTone() {\n const tone = useContext(MeteringRowContext)\n if (!tone) {\n throw new Error('MeteringRow.* must be rendered inside <MeteringRow>')\n }\n return tone\n}\n\nconst MeteringRow = ({\n className,\n tone,\n ...rest\n}: React.ComponentProps<'div'> & {\n tone: Tone\n}) => {\n return (\n <MeteringRowContext.Provider value={tone}>\n <div\n className={cn('group flex items-center gap-3', className)}\n data-tone={tone}\n {...rest}\n />\n </MeteringRowContext.Provider>\n )\n}\n\nconst toneToIconColor: Record<Tone, SparkAccentColor> = {\n accent: 'accent',\n neutral: 'neutral',\n success: 'success',\n warning: 'warning',\n error: 'danger',\n}\n\nconst MeteringRowIcon = ({\n className,\n icon: Glyph,\n ...rest\n}: React.ComponentProps<'span'> & {\n icon: SparkIcon\n}) => {\n const tone = useMeteringRowTone()\n return (\n <Icon\n {...rest}\n className={className}\n color={toneToIconColor[tone]}\n size=\"large\"\n >\n <Glyph />\n </Icon>\n )\n}\n\nconst MeteringRowLabel = ({\n className,\n ...rest\n}: React.ComponentProps<'span'>) => {\n return (\n <span className={cn('flex-1 text-sm text-gray', className)} {...rest} />\n )\n}\n\nconst MeteringRowValue = ({\n className,\n ...rest\n}: React.ComponentProps<'span'>) => {\n return (\n <span\n className={cn(\n 'text-lg leading-tight font-bold tabular-nums group-data-[tone=accent]:text-accent group-data-[tone=error]:text-error group-data-[tone=neutral]:text-gray group-data-[tone=success]:text-success group-data-[tone=warning]:text-warning',\n className,\n )}\n {...rest}\n />\n )\n}\n\nexport { MeteringRow, MeteringRowIcon, MeteringRowLabel, MeteringRowValue }\n"],"mappings":";;;;;;;AAOA,MAAM,sBAAA,GAAA,MAAA,eAAgD,IAAI;AAE1D,SAAS,qBAAqB;CAC5B,MAAM,QAAA,GAAA,MAAA,YAAkB,kBAAkB;CAC1C,IAAI,CAAC,MACH,MAAM,IAAI,MAAM,qDAAqD;CAEvE,OAAO;AACT;AAEA,MAAM,eAAe,EACnB,WACA,MACA,GAAG,WAGC;CACJ,OACE,iBAAA,GAAA,kBAAA,KAAC,mBAAmB,UAApB;EAA6B,OAAO;YAClC,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,YAAA,GAAA,OAAA,IAAc,iCAAiC,SAAS;GACxD,aAAW;GACX,GAAI;EACL,CAAA;CAC0B,CAAA;AAEjC;AAEA,MAAM,kBAAkD;CACtD,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAM,mBAAmB,EACvB,WACA,MAAM,OACN,GAAG,WAGC;CACJ,MAAM,OAAO,mBAAmB;CAChC,OACE,iBAAA,GAAA,kBAAA,KAACA,wBAAAA,MAAD;EACE,GAAI;EACO;EACX,OAAO,gBAAgB;EACvB,MAAK;YAEL,iBAAA,GAAA,kBAAA,KAAC,OAAD,CAAQ,CAAA;CACJ,CAAA;AAEV;AAEA,MAAM,oBAAoB,EACxB,WACA,GAAG,WAC+B;CAClC,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EAAM,YAAA,GAAA,OAAA,IAAc,4BAA4B,SAAS;EAAG,GAAI;CAAO,CAAA;AAE3E;AAEA,MAAM,oBAAoB,EACxB,WACA,GAAG,WAC+B;CAClC,OACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,YAAA,GAAA,OAAA,IACE,0OACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tone } from "../lib/tones.cjs";
|
|
4
|
-
import { SparkIcon } from "@epilot/spark-icons";
|
|
5
|
-
|
|
6
|
-
//#region src/components/metering-row.d.ts
|
|
7
|
-
declare const MeteringRow: ({
|
|
8
|
-
className,
|
|
9
|
-
tone,
|
|
10
|
-
...rest
|
|
11
|
-
}: React.ComponentProps<"div"> & {
|
|
12
|
-
tone: Tone;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare const MeteringRowIcon: ({
|
|
15
|
-
className,
|
|
16
|
-
icon: Glyph,
|
|
17
|
-
...rest
|
|
18
|
-
}: React.ComponentProps<"span"> & {
|
|
19
|
-
icon: SparkIcon;
|
|
20
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare const MeteringRowLabel: ({
|
|
22
|
-
className,
|
|
23
|
-
...rest
|
|
24
|
-
}: React.ComponentProps<"span">) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare const MeteringRowValue: ({
|
|
26
|
-
className,
|
|
27
|
-
...rest
|
|
28
|
-
}: React.ComponentProps<"span">) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { MeteringRow, MeteringRowIcon, MeteringRowLabel, MeteringRowValue };
|
|
31
|
-
//# sourceMappingURL=metering-row.d.cts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Tone } from "../lib/tones.js";
|
|
4
|
-
import { SparkIcon } from "@epilot/spark-icons";
|
|
5
|
-
|
|
6
|
-
//#region src/components/metering-row.d.ts
|
|
7
|
-
declare const MeteringRow: ({
|
|
8
|
-
className,
|
|
9
|
-
tone,
|
|
10
|
-
...rest
|
|
11
|
-
}: React.ComponentProps<"div"> & {
|
|
12
|
-
tone: Tone;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare const MeteringRowIcon: ({
|
|
15
|
-
className,
|
|
16
|
-
icon: Glyph,
|
|
17
|
-
...rest
|
|
18
|
-
}: React.ComponentProps<"span"> & {
|
|
19
|
-
icon: SparkIcon;
|
|
20
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare const MeteringRowLabel: ({
|
|
22
|
-
className,
|
|
23
|
-
...rest
|
|
24
|
-
}: React.ComponentProps<"span">) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare const MeteringRowValue: ({
|
|
26
|
-
className,
|
|
27
|
-
...rest
|
|
28
|
-
}: React.ComponentProps<"span">) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { MeteringRow, MeteringRowIcon, MeteringRowLabel, MeteringRowValue };
|
|
31
|
-
//# sourceMappingURL=metering-row.d.ts.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn } from "../utils/cn.js";
|
|
3
|
-
import { Icon } from "./icon.js";
|
|
4
|
-
import { createContext, useContext } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
//#region src/components/metering-row.tsx
|
|
7
|
-
const MeteringRowContext = createContext(null);
|
|
8
|
-
function useMeteringRowTone() {
|
|
9
|
-
const tone = useContext(MeteringRowContext);
|
|
10
|
-
if (!tone) throw new Error("MeteringRow.* must be rendered inside <MeteringRow>");
|
|
11
|
-
return tone;
|
|
12
|
-
}
|
|
13
|
-
const MeteringRow = ({ className, tone, ...rest }) => {
|
|
14
|
-
return /* @__PURE__ */ jsx(MeteringRowContext.Provider, {
|
|
15
|
-
value: tone,
|
|
16
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
17
|
-
className: cn("group flex items-center gap-3", className),
|
|
18
|
-
"data-tone": tone,
|
|
19
|
-
...rest
|
|
20
|
-
})
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
const toneToIconColor = {
|
|
24
|
-
accent: "accent",
|
|
25
|
-
neutral: "neutral",
|
|
26
|
-
success: "success",
|
|
27
|
-
warning: "warning",
|
|
28
|
-
error: "danger"
|
|
29
|
-
};
|
|
30
|
-
const MeteringRowIcon = ({ className, icon: Glyph, ...rest }) => {
|
|
31
|
-
const tone = useMeteringRowTone();
|
|
32
|
-
return /* @__PURE__ */ jsx(Icon, {
|
|
33
|
-
...rest,
|
|
34
|
-
className,
|
|
35
|
-
color: toneToIconColor[tone],
|
|
36
|
-
size: "large",
|
|
37
|
-
children: /* @__PURE__ */ jsx(Glyph, {})
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
const MeteringRowLabel = ({ className, ...rest }) => {
|
|
41
|
-
return /* @__PURE__ */ jsx("span", {
|
|
42
|
-
className: cn("flex-1 text-sm text-gray", className),
|
|
43
|
-
...rest
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
const MeteringRowValue = ({ className, ...rest }) => {
|
|
47
|
-
return /* @__PURE__ */ jsx("span", {
|
|
48
|
-
className: cn("text-lg leading-tight font-bold tabular-nums group-data-[tone=accent]:text-accent group-data-[tone=error]:text-error group-data-[tone=neutral]:text-gray group-data-[tone=success]:text-success group-data-[tone=warning]:text-warning", className),
|
|
49
|
-
...rest
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
//#endregion
|
|
53
|
-
export { MeteringRow, MeteringRowIcon, MeteringRowLabel, MeteringRowValue };
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=metering-row.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metering-row.js","names":[],"sources":["../../src/components/metering-row.tsx"],"sourcesContent":["import type { SparkIcon } from '@epilot/spark-icons'\nimport { createContext, useContext } from 'react'\nimport type { SparkAccentColor } from '../lib/accent-colors'\nimport type { Tone } from '../lib/tones'\nimport { cn } from '../utils/cn'\nimport { Icon } from './icon'\n\nconst MeteringRowContext = createContext<Tone | null>(null)\n\nfunction useMeteringRowTone() {\n const tone = useContext(MeteringRowContext)\n if (!tone) {\n throw new Error('MeteringRow.* must be rendered inside <MeteringRow>')\n }\n return tone\n}\n\nconst MeteringRow = ({\n className,\n tone,\n ...rest\n}: React.ComponentProps<'div'> & {\n tone: Tone\n}) => {\n return (\n <MeteringRowContext.Provider value={tone}>\n <div\n className={cn('group flex items-center gap-3', className)}\n data-tone={tone}\n {...rest}\n />\n </MeteringRowContext.Provider>\n )\n}\n\nconst toneToIconColor: Record<Tone, SparkAccentColor> = {\n accent: 'accent',\n neutral: 'neutral',\n success: 'success',\n warning: 'warning',\n error: 'danger',\n}\n\nconst MeteringRowIcon = ({\n className,\n icon: Glyph,\n ...rest\n}: React.ComponentProps<'span'> & {\n icon: SparkIcon\n}) => {\n const tone = useMeteringRowTone()\n return (\n <Icon\n {...rest}\n className={className}\n color={toneToIconColor[tone]}\n size=\"large\"\n >\n <Glyph />\n </Icon>\n )\n}\n\nconst MeteringRowLabel = ({\n className,\n ...rest\n}: React.ComponentProps<'span'>) => {\n return (\n <span className={cn('flex-1 text-sm text-gray', className)} {...rest} />\n )\n}\n\nconst MeteringRowValue = ({\n className,\n ...rest\n}: React.ComponentProps<'span'>) => {\n return (\n <span\n className={cn(\n 'text-lg leading-tight font-bold tabular-nums group-data-[tone=accent]:text-accent group-data-[tone=error]:text-error group-data-[tone=neutral]:text-gray group-data-[tone=success]:text-success group-data-[tone=warning]:text-warning',\n className,\n )}\n {...rest}\n />\n )\n}\n\nexport { MeteringRow, MeteringRowIcon, MeteringRowLabel, MeteringRowValue }\n"],"mappings":";;;;;;AAOA,MAAM,qBAAqB,cAA2B,IAAI;AAE1D,SAAS,qBAAqB;CAC5B,MAAM,OAAO,WAAW,kBAAkB;CAC1C,IAAI,CAAC,MACH,MAAM,IAAI,MAAM,qDAAqD;CAEvE,OAAO;AACT;AAEA,MAAM,eAAe,EACnB,WACA,MACA,GAAG,WAGC;CACJ,OACE,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;YAClC,oBAAC,OAAD;GACE,WAAW,GAAG,iCAAiC,SAAS;GACxD,aAAW;GACX,GAAI;EACL,CAAA;CAC0B,CAAA;AAEjC;AAEA,MAAM,kBAAkD;CACtD,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAM,mBAAmB,EACvB,WACA,MAAM,OACN,GAAG,WAGC;CACJ,MAAM,OAAO,mBAAmB;CAChC,OACE,oBAAC,MAAD;EACE,GAAI;EACO;EACX,OAAO,gBAAgB;EACvB,MAAK;YAEL,oBAAC,OAAD,CAAQ,CAAA;CACJ,CAAA;AAEV;AAEA,MAAM,oBAAoB,EACxB,WACA,GAAG,WAC+B;CAClC,OACE,oBAAC,QAAD;EAAM,WAAW,GAAG,4BAA4B,SAAS;EAAG,GAAI;CAAO,CAAA;AAE3E;AAEA,MAAM,oBAAoB,EACxB,WACA,GAAG,WAC+B;CAClC,OACE,oBAAC,QAAD;EACE,WAAW,GACT,0OACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_components_typography = require("./typography.cjs");
|
|
4
|
-
let _epilot_spark_icons = require("@epilot/spark-icons");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
//#region src/components/money-saved-block.tsx
|
|
7
|
-
const MoneySavedContainer = ({ children, ariaLabel = "Money saved today" }) => {
|
|
8
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
9
|
-
"aria-label": ariaLabel,
|
|
10
|
-
className: "flex items-center justify-between gap-4",
|
|
11
|
-
children
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
const MoneySavedContent = ({ children }) => {
|
|
15
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
16
|
-
className: "flex flex-col gap-1",
|
|
17
|
-
children
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const MoneySavedTitle = ({ children }) => {
|
|
21
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_typography.SectionTitle, { children });
|
|
22
|
-
};
|
|
23
|
-
const MoneySavedValue = ({ children }) => {
|
|
24
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_typography.StateValue, { children });
|
|
25
|
-
};
|
|
26
|
-
const MoneySavedDelta = ({ children }) => {
|
|
27
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
28
|
-
className: "flex items-end gap-1 text-sm text-base-success-solid",
|
|
29
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_epilot_spark_icons.SwapVert, { className: "rotate-180 [--spark-icon-size:14px]" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
30
|
-
className: "tabular-nums",
|
|
31
|
-
children
|
|
32
|
-
})]
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const MoneySavedGaugeContainer = ({ children }) => {
|
|
36
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
37
|
-
className: "relative top-2 flex flex-col items-end gap-1",
|
|
38
|
-
children
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
const MoneySavedGaugeContent = ({ autarkyProgress, autarkyLabel, autarkyCaption = "Autarky", gaugeWidth, gaugeHeight, gaugeArcPath, gaugeStrokeWidth }) => {
|
|
42
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
43
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
44
|
-
className: "h-[44px] w-[76px]",
|
|
45
|
-
viewBox: `0 0 ${gaugeWidth} ${gaugeHeight}`,
|
|
46
|
-
"aria-hidden": "true",
|
|
47
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
48
|
-
d: gaugeArcPath,
|
|
49
|
-
fill: "none",
|
|
50
|
-
stroke: "var(--neutral-a5)",
|
|
51
|
-
strokeWidth: gaugeStrokeWidth,
|
|
52
|
-
strokeLinecap: "round",
|
|
53
|
-
pathLength: 1
|
|
54
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
55
|
-
d: gaugeArcPath,
|
|
56
|
-
fill: "none",
|
|
57
|
-
stroke: "var(--green-a9)",
|
|
58
|
-
strokeWidth: gaugeStrokeWidth,
|
|
59
|
-
strokeLinecap: "round",
|
|
60
|
-
pathLength: 1,
|
|
61
|
-
strokeDasharray: `${autarkyProgress} 1`
|
|
62
|
-
})]
|
|
63
|
-
}),
|
|
64
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
65
|
-
className: "absolute inset-0 flex items-center justify-center text-sm font-semibold text-gray",
|
|
66
|
-
children: autarkyLabel
|
|
67
|
-
}),
|
|
68
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
69
|
-
className: "mx-auto text-xs text-gray-light",
|
|
70
|
-
children: autarkyCaption
|
|
71
|
-
})
|
|
72
|
-
] });
|
|
73
|
-
};
|
|
74
|
-
//#endregion
|
|
75
|
-
exports.MoneySavedContainer = MoneySavedContainer;
|
|
76
|
-
exports.MoneySavedContent = MoneySavedContent;
|
|
77
|
-
exports.MoneySavedDelta = MoneySavedDelta;
|
|
78
|
-
exports.MoneySavedGaugeContainer = MoneySavedGaugeContainer;
|
|
79
|
-
exports.MoneySavedGaugeContent = MoneySavedGaugeContent;
|
|
80
|
-
exports.MoneySavedTitle = MoneySavedTitle;
|
|
81
|
-
exports.MoneySavedValue = MoneySavedValue;
|
|
82
|
-
|
|
83
|
-
//# sourceMappingURL=money-saved-block.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"money-saved-block.cjs","names":["SectionTitle","StateValue","SwapVert"],"sources":["../../src/components/money-saved-block.tsx"],"sourcesContent":["import { SwapVert } from '@epilot/spark-icons'\nimport { SectionTitle, StateValue } from './typography'\n\nconst MoneySavedContainer = ({\n children,\n ariaLabel = 'Money saved today',\n}: {\n children: React.ReactNode\n /** Override the accessible label for the container. Defaults to `\"Money saved today\"`. */\n ariaLabel?: string\n}) => {\n return (\n <div\n aria-label={ariaLabel}\n className=\"flex items-center justify-between gap-4\"\n >\n {children}\n </div>\n )\n}\n\nconst MoneySavedContent = ({ children }: { children: React.ReactNode }) => {\n return <div className=\"flex flex-col gap-1\">{children}</div>\n}\n\nconst MoneySavedTitle = ({ children }: { children: React.ReactNode }) => {\n return <SectionTitle>{children}</SectionTitle>\n}\n\nconst MoneySavedValue = ({ children }: { children: React.ReactNode }) => {\n return <StateValue>{children}</StateValue>\n}\n\nconst MoneySavedDelta = ({ children }: { children: React.ReactNode }) => {\n return (\n <span className=\"flex items-end gap-1 text-sm text-base-success-solid\">\n <SwapVert className=\"rotate-180 [--spark-icon-size:14px]\" />\n <span className=\"tabular-nums\">{children}</span>\n </span>\n )\n}\n\nconst MoneySavedGaugeContainer = ({\n children,\n}: {\n children: React.ReactNode\n}) => {\n return (\n <div className=\"relative top-2 flex flex-col items-end gap-1\">\n {children}\n </div>\n )\n}\n\nconst MoneySavedGaugeContent = ({\n autarkyProgress,\n autarkyLabel,\n autarkyCaption = 'Autarky',\n gaugeWidth,\n gaugeHeight,\n gaugeArcPath,\n gaugeStrokeWidth,\n}: {\n autarkyProgress: number\n autarkyLabel: string\n /** Override the caption shown beneath the gauge. Defaults to `\"Autarky\"`. */\n autarkyCaption?: React.ReactNode\n gaugeWidth: number\n gaugeHeight: number\n gaugeArcPath: string\n gaugeStrokeWidth: number\n}) => {\n return (\n <>\n <svg\n className=\"h-[44px] w-[76px]\"\n viewBox={`0 0 ${gaugeWidth} ${gaugeHeight}`}\n aria-hidden=\"true\"\n >\n <path\n d={gaugeArcPath}\n fill=\"none\"\n stroke=\"var(--neutral-a5)\"\n strokeWidth={gaugeStrokeWidth}\n strokeLinecap=\"round\"\n pathLength={1}\n />\n <path\n d={gaugeArcPath}\n fill=\"none\"\n stroke=\"var(--green-a9)\"\n strokeWidth={gaugeStrokeWidth}\n strokeLinecap=\"round\"\n pathLength={1}\n strokeDasharray={`${autarkyProgress} 1`}\n />\n </svg>\n <span className=\"absolute inset-0 flex items-center justify-center text-sm font-semibold text-gray\">\n {autarkyLabel}\n </span>\n <span className=\"mx-auto text-xs text-gray-light\">{autarkyCaption}</span>\n </>\n )\n}\n\nexport {\n MoneySavedContainer,\n MoneySavedContent,\n MoneySavedTitle,\n MoneySavedValue,\n MoneySavedDelta,\n MoneySavedGaugeContainer,\n MoneySavedGaugeContent,\n}\n"],"mappings":";;;;;;AAGA,MAAM,uBAAuB,EAC3B,UACA,YAAY,0BAKR;CACJ,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,cAAY;EACZ,WAAU;EAET;CACE,CAAA;AAET;AAEA,MAAM,qBAAqB,EAAE,eAA8C;CACzE,OAAO,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;EAAuB;CAAc,CAAA;AAC7D;AAEA,MAAM,mBAAmB,EAAE,eAA8C;CACvE,OAAO,iBAAA,GAAA,kBAAA,KAACA,8BAAAA,cAAD,EAAe,SAAuB,CAAA;AAC/C;AAEA,MAAM,mBAAmB,EAAE,eAA8C;CACvE,OAAO,iBAAA,GAAA,kBAAA,KAACC,8BAAAA,YAAD,EAAa,SAAqB,CAAA;AAC3C;AAEA,MAAM,mBAAmB,EAAE,eAA8C;CACvE,OACE,iBAAA,GAAA,kBAAA,MAAC,QAAD;EAAM,WAAU;YAAhB,CACE,iBAAA,GAAA,kBAAA,KAACC,oBAAAA,UAAD,EAAU,WAAU,sCAAuC,CAAA,GAC3D,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;GAAgB;EAAe,CAAA,CAC3C;;AAEV;AAEA,MAAM,4BAA4B,EAChC,eAGI;CACJ,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;EACZ;CACE,CAAA;AAET;AAEA,MAAM,0BAA0B,EAC9B,iBACA,cACA,iBAAiB,WACjB,YACA,aACA,cACA,uBAUI;CACJ,OACE,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA;EACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;GACE,WAAU;GACV,SAAS,OAAO,WAAW,GAAG;GAC9B,eAAY;aAHd,CAKE,iBAAA,GAAA,kBAAA,KAAC,QAAD;IACE,GAAG;IACH,MAAK;IACL,QAAO;IACP,aAAa;IACb,eAAc;IACd,YAAY;GACb,CAAA,GACD,iBAAA,GAAA,kBAAA,KAAC,QAAD;IACE,GAAG;IACH,MAAK;IACL,QAAO;IACP,aAAa;IACb,eAAc;IACd,YAAY;IACZ,iBAAiB,GAAG,gBAAgB;GACrC,CAAA,CACE;;EACL,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA;EACN,iBAAA,GAAA,kBAAA,KAAC,QAAD;GAAM,WAAU;aAAmC;EAAqB,CAAA;CACxE,EAAA,CAAA;AAEN"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//#region src/components/money-saved-block.d.ts
|
|
4
|
-
declare const MoneySavedContainer: ({
|
|
5
|
-
children,
|
|
6
|
-
ariaLabel
|
|
7
|
-
}: {
|
|
8
|
-
children: React.ReactNode; /** Override the accessible label for the container. Defaults to `"Money saved today"`. */
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare const MoneySavedContent: ({
|
|
12
|
-
children
|
|
13
|
-
}: {
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare const MoneySavedTitle: ({
|
|
17
|
-
children
|
|
18
|
-
}: {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare const MoneySavedValue: ({
|
|
22
|
-
children
|
|
23
|
-
}: {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
declare const MoneySavedDelta: ({
|
|
27
|
-
children
|
|
28
|
-
}: {
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare const MoneySavedGaugeContainer: ({
|
|
32
|
-
children
|
|
33
|
-
}: {
|
|
34
|
-
children: React.ReactNode;
|
|
35
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
declare const MoneySavedGaugeContent: ({
|
|
37
|
-
autarkyProgress,
|
|
38
|
-
autarkyLabel,
|
|
39
|
-
autarkyCaption,
|
|
40
|
-
gaugeWidth,
|
|
41
|
-
gaugeHeight,
|
|
42
|
-
gaugeArcPath,
|
|
43
|
-
gaugeStrokeWidth
|
|
44
|
-
}: {
|
|
45
|
-
autarkyProgress: number;
|
|
46
|
-
autarkyLabel: string; /** Override the caption shown beneath the gauge. Defaults to `"Autarky"`. */
|
|
47
|
-
autarkyCaption?: React.ReactNode;
|
|
48
|
-
gaugeWidth: number;
|
|
49
|
-
gaugeHeight: number;
|
|
50
|
-
gaugeArcPath: string;
|
|
51
|
-
gaugeStrokeWidth: number;
|
|
52
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
//#endregion
|
|
54
|
-
export { MoneySavedContainer, MoneySavedContent, MoneySavedDelta, MoneySavedGaugeContainer, MoneySavedGaugeContent, MoneySavedTitle, MoneySavedValue };
|
|
55
|
-
//# sourceMappingURL=money-saved-block.d.cts.map
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//#region src/components/money-saved-block.d.ts
|
|
4
|
-
declare const MoneySavedContainer: ({
|
|
5
|
-
children,
|
|
6
|
-
ariaLabel
|
|
7
|
-
}: {
|
|
8
|
-
children: React.ReactNode; /** Override the accessible label for the container. Defaults to `"Money saved today"`. */
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare const MoneySavedContent: ({
|
|
12
|
-
children
|
|
13
|
-
}: {
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare const MoneySavedTitle: ({
|
|
17
|
-
children
|
|
18
|
-
}: {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare const MoneySavedValue: ({
|
|
22
|
-
children
|
|
23
|
-
}: {
|
|
24
|
-
children: React.ReactNode;
|
|
25
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
declare const MoneySavedDelta: ({
|
|
27
|
-
children
|
|
28
|
-
}: {
|
|
29
|
-
children: React.ReactNode;
|
|
30
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare const MoneySavedGaugeContainer: ({
|
|
32
|
-
children
|
|
33
|
-
}: {
|
|
34
|
-
children: React.ReactNode;
|
|
35
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
declare const MoneySavedGaugeContent: ({
|
|
37
|
-
autarkyProgress,
|
|
38
|
-
autarkyLabel,
|
|
39
|
-
autarkyCaption,
|
|
40
|
-
gaugeWidth,
|
|
41
|
-
gaugeHeight,
|
|
42
|
-
gaugeArcPath,
|
|
43
|
-
gaugeStrokeWidth
|
|
44
|
-
}: {
|
|
45
|
-
autarkyProgress: number;
|
|
46
|
-
autarkyLabel: string; /** Override the caption shown beneath the gauge. Defaults to `"Autarky"`. */
|
|
47
|
-
autarkyCaption?: React.ReactNode;
|
|
48
|
-
gaugeWidth: number;
|
|
49
|
-
gaugeHeight: number;
|
|
50
|
-
gaugeArcPath: string;
|
|
51
|
-
gaugeStrokeWidth: number;
|
|
52
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
//#endregion
|
|
54
|
-
export { MoneySavedContainer, MoneySavedContent, MoneySavedDelta, MoneySavedGaugeContainer, MoneySavedGaugeContent, MoneySavedTitle, MoneySavedValue };
|
|
55
|
-
//# sourceMappingURL=money-saved-block.d.ts.map
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { SectionTitle, StateValue } from "./typography.js";
|
|
3
|
-
import { SwapVert } from "@epilot/spark-icons";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/money-saved-block.tsx
|
|
6
|
-
const MoneySavedContainer = ({ children, ariaLabel = "Money saved today" }) => {
|
|
7
|
-
return /* @__PURE__ */ jsx("div", {
|
|
8
|
-
"aria-label": ariaLabel,
|
|
9
|
-
className: "flex items-center justify-between gap-4",
|
|
10
|
-
children
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
const MoneySavedContent = ({ children }) => {
|
|
14
|
-
return /* @__PURE__ */ jsx("div", {
|
|
15
|
-
className: "flex flex-col gap-1",
|
|
16
|
-
children
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const MoneySavedTitle = ({ children }) => {
|
|
20
|
-
return /* @__PURE__ */ jsx(SectionTitle, { children });
|
|
21
|
-
};
|
|
22
|
-
const MoneySavedValue = ({ children }) => {
|
|
23
|
-
return /* @__PURE__ */ jsx(StateValue, { children });
|
|
24
|
-
};
|
|
25
|
-
const MoneySavedDelta = ({ children }) => {
|
|
26
|
-
return /* @__PURE__ */ jsxs("span", {
|
|
27
|
-
className: "flex items-end gap-1 text-sm text-base-success-solid",
|
|
28
|
-
children: [/* @__PURE__ */ jsx(SwapVert, { className: "rotate-180 [--spark-icon-size:14px]" }), /* @__PURE__ */ jsx("span", {
|
|
29
|
-
className: "tabular-nums",
|
|
30
|
-
children
|
|
31
|
-
})]
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
const MoneySavedGaugeContainer = ({ children }) => {
|
|
35
|
-
return /* @__PURE__ */ jsx("div", {
|
|
36
|
-
className: "relative top-2 flex flex-col items-end gap-1",
|
|
37
|
-
children
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
const MoneySavedGaugeContent = ({ autarkyProgress, autarkyLabel, autarkyCaption = "Autarky", gaugeWidth, gaugeHeight, gaugeArcPath, gaugeStrokeWidth }) => {
|
|
41
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
-
/* @__PURE__ */ jsxs("svg", {
|
|
43
|
-
className: "h-[44px] w-[76px]",
|
|
44
|
-
viewBox: `0 0 ${gaugeWidth} ${gaugeHeight}`,
|
|
45
|
-
"aria-hidden": "true",
|
|
46
|
-
children: [/* @__PURE__ */ jsx("path", {
|
|
47
|
-
d: gaugeArcPath,
|
|
48
|
-
fill: "none",
|
|
49
|
-
stroke: "var(--neutral-a5)",
|
|
50
|
-
strokeWidth: gaugeStrokeWidth,
|
|
51
|
-
strokeLinecap: "round",
|
|
52
|
-
pathLength: 1
|
|
53
|
-
}), /* @__PURE__ */ jsx("path", {
|
|
54
|
-
d: gaugeArcPath,
|
|
55
|
-
fill: "none",
|
|
56
|
-
stroke: "var(--green-a9)",
|
|
57
|
-
strokeWidth: gaugeStrokeWidth,
|
|
58
|
-
strokeLinecap: "round",
|
|
59
|
-
pathLength: 1,
|
|
60
|
-
strokeDasharray: `${autarkyProgress} 1`
|
|
61
|
-
})]
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ jsx("span", {
|
|
64
|
-
className: "absolute inset-0 flex items-center justify-center text-sm font-semibold text-gray",
|
|
65
|
-
children: autarkyLabel
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ jsx("span", {
|
|
68
|
-
className: "mx-auto text-xs text-gray-light",
|
|
69
|
-
children: autarkyCaption
|
|
70
|
-
})
|
|
71
|
-
] });
|
|
72
|
-
};
|
|
73
|
-
//#endregion
|
|
74
|
-
export { MoneySavedContainer, MoneySavedContent, MoneySavedDelta, MoneySavedGaugeContainer, MoneySavedGaugeContent, MoneySavedTitle, MoneySavedValue };
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=money-saved-block.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"money-saved-block.js","names":[],"sources":["../../src/components/money-saved-block.tsx"],"sourcesContent":["import { SwapVert } from '@epilot/spark-icons'\nimport { SectionTitle, StateValue } from './typography'\n\nconst MoneySavedContainer = ({\n children,\n ariaLabel = 'Money saved today',\n}: {\n children: React.ReactNode\n /** Override the accessible label for the container. Defaults to `\"Money saved today\"`. */\n ariaLabel?: string\n}) => {\n return (\n <div\n aria-label={ariaLabel}\n className=\"flex items-center justify-between gap-4\"\n >\n {children}\n </div>\n )\n}\n\nconst MoneySavedContent = ({ children }: { children: React.ReactNode }) => {\n return <div className=\"flex flex-col gap-1\">{children}</div>\n}\n\nconst MoneySavedTitle = ({ children }: { children: React.ReactNode }) => {\n return <SectionTitle>{children}</SectionTitle>\n}\n\nconst MoneySavedValue = ({ children }: { children: React.ReactNode }) => {\n return <StateValue>{children}</StateValue>\n}\n\nconst MoneySavedDelta = ({ children }: { children: React.ReactNode }) => {\n return (\n <span className=\"flex items-end gap-1 text-sm text-base-success-solid\">\n <SwapVert className=\"rotate-180 [--spark-icon-size:14px]\" />\n <span className=\"tabular-nums\">{children}</span>\n </span>\n )\n}\n\nconst MoneySavedGaugeContainer = ({\n children,\n}: {\n children: React.ReactNode\n}) => {\n return (\n <div className=\"relative top-2 flex flex-col items-end gap-1\">\n {children}\n </div>\n )\n}\n\nconst MoneySavedGaugeContent = ({\n autarkyProgress,\n autarkyLabel,\n autarkyCaption = 'Autarky',\n gaugeWidth,\n gaugeHeight,\n gaugeArcPath,\n gaugeStrokeWidth,\n}: {\n autarkyProgress: number\n autarkyLabel: string\n /** Override the caption shown beneath the gauge. Defaults to `\"Autarky\"`. */\n autarkyCaption?: React.ReactNode\n gaugeWidth: number\n gaugeHeight: number\n gaugeArcPath: string\n gaugeStrokeWidth: number\n}) => {\n return (\n <>\n <svg\n className=\"h-[44px] w-[76px]\"\n viewBox={`0 0 ${gaugeWidth} ${gaugeHeight}`}\n aria-hidden=\"true\"\n >\n <path\n d={gaugeArcPath}\n fill=\"none\"\n stroke=\"var(--neutral-a5)\"\n strokeWidth={gaugeStrokeWidth}\n strokeLinecap=\"round\"\n pathLength={1}\n />\n <path\n d={gaugeArcPath}\n fill=\"none\"\n stroke=\"var(--green-a9)\"\n strokeWidth={gaugeStrokeWidth}\n strokeLinecap=\"round\"\n pathLength={1}\n strokeDasharray={`${autarkyProgress} 1`}\n />\n </svg>\n <span className=\"absolute inset-0 flex items-center justify-center text-sm font-semibold text-gray\">\n {autarkyLabel}\n </span>\n <span className=\"mx-auto text-xs text-gray-light\">{autarkyCaption}</span>\n </>\n )\n}\n\nexport {\n MoneySavedContainer,\n MoneySavedContent,\n MoneySavedTitle,\n MoneySavedValue,\n MoneySavedDelta,\n MoneySavedGaugeContainer,\n MoneySavedGaugeContent,\n}\n"],"mappings":";;;;;AAGA,MAAM,uBAAuB,EAC3B,UACA,YAAY,0BAKR;CACJ,OACE,oBAAC,OAAD;EACE,cAAY;EACZ,WAAU;EAET;CACE,CAAA;AAET;AAEA,MAAM,qBAAqB,EAAE,eAA8C;CACzE,OAAO,oBAAC,OAAD;EAAK,WAAU;EAAuB;CAAc,CAAA;AAC7D;AAEA,MAAM,mBAAmB,EAAE,eAA8C;CACvE,OAAO,oBAAC,cAAD,EAAe,SAAuB,CAAA;AAC/C;AAEA,MAAM,mBAAmB,EAAE,eAA8C;CACvE,OAAO,oBAAC,YAAD,EAAa,SAAqB,CAAA;AAC3C;AAEA,MAAM,mBAAmB,EAAE,eAA8C;CACvE,OACE,qBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,oBAAC,UAAD,EAAU,WAAU,sCAAuC,CAAA,GAC3D,oBAAC,QAAD;GAAM,WAAU;GAAgB;EAAe,CAAA,CAC3C;;AAEV;AAEA,MAAM,4BAA4B,EAChC,eAGI;CACJ,OACE,oBAAC,OAAD;EAAK,WAAU;EACZ;CACE,CAAA;AAET;AAEA,MAAM,0BAA0B,EAC9B,iBACA,cACA,iBAAiB,WACjB,YACA,aACA,cACA,uBAUI;CACJ,OACE,qBAAA,UAAA,EAAA,UAAA;EACE,qBAAC,OAAD;GACE,WAAU;GACV,SAAS,OAAO,WAAW,GAAG;GAC9B,eAAY;aAHd,CAKE,oBAAC,QAAD;IACE,GAAG;IACH,MAAK;IACL,QAAO;IACP,aAAa;IACb,eAAc;IACd,YAAY;GACb,CAAA,GACD,oBAAC,QAAD;IACE,GAAG;IACH,MAAK;IACL,QAAO;IACP,aAAa;IACb,eAAc;IACd,YAAY;IACZ,iBAAiB,GAAG,gBAAgB;GACrC,CAAA,CACE;;EACL,oBAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA;EACN,oBAAC,QAAD;GAAM,WAAU;aAAmC;EAAqB,CAAA;CACxE,EAAA,CAAA;AAEN"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
let _epilot_spark_icons = require("@epilot/spark-icons");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
let class_variance_authority = require("class-variance-authority");
|
|
6
|
-
//#region src/components/on-off-button.tsx
|
|
7
|
-
function OnOffButton({ disabled, isOn, onClick, className }) {
|
|
8
|
-
const handleClick = (event) => {
|
|
9
|
-
event.stopPropagation();
|
|
10
|
-
onClick();
|
|
11
|
-
};
|
|
12
|
-
const onOfButtonClassName = (0, class_variance_authority.cva)("focus-visible:ring-primary touch-target inline-flex size-9 min-w-9 cursor-pointer items-center justify-center justify-self-end rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60", { variants: { isOn: {
|
|
13
|
-
true: "bg-base-success-soft text-success hover:bg-base-success-soft/80",
|
|
14
|
-
false: "border border-gray text-gray-light hover:bg-base-gray-soft"
|
|
15
|
-
} } });
|
|
16
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
17
|
-
"aria-label": isOn ? "Turn off" : "Turn on",
|
|
18
|
-
"aria-pressed": isOn,
|
|
19
|
-
className: onOfButtonClassName({
|
|
20
|
-
isOn,
|
|
21
|
-
className
|
|
22
|
-
}),
|
|
23
|
-
disabled,
|
|
24
|
-
onClick: handleClick,
|
|
25
|
-
type: "button",
|
|
26
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_epilot_spark_icons.PowerSettingsNew, { className: "block leading-none [--spark-icon-size:16px]" })
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.OnOffButton = OnOffButton;
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=on-off-button.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"on-off-button.cjs","names":["PowerSettingsNew"],"sources":["../../src/components/on-off-button.tsx"],"sourcesContent":["import { PowerSettingsNew } from '@epilot/spark-icons'\nimport { cva } from 'class-variance-authority'\nimport type { MouseEvent } from 'react'\n\ninterface OnOffButtonProps {\n isOn: boolean\n disabled?: boolean\n onClick: () => void\n className?: string\n}\n\nexport function OnOffButton({\n disabled,\n isOn,\n onClick,\n className,\n}: OnOffButtonProps) {\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n onClick()\n }\n\n const onOfButtonClassName = cva(\n 'focus-visible:ring-primary touch-target inline-flex size-9 min-w-9 cursor-pointer items-center justify-center justify-self-end rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60',\n {\n variants: {\n isOn: {\n true: 'bg-base-success-soft text-success hover:bg-base-success-soft/80',\n false: 'border border-gray text-gray-light hover:bg-base-gray-soft',\n },\n },\n },\n )\n\n return (\n <button\n aria-label={isOn ? 'Turn off' : 'Turn on'}\n aria-pressed={isOn}\n className={onOfButtonClassName({ isOn, className })}\n disabled={disabled}\n onClick={handleClick}\n type=\"button\"\n >\n <PowerSettingsNew className=\"block leading-none [--spark-icon-size:16px]\" />\n </button>\n )\n}\n"],"mappings":";;;;;;AAWA,SAAgB,YAAY,EAC1B,UACA,MACA,SACA,aACmB;CACnB,MAAM,eAAe,UAAyC;EAC5D,MAAM,gBAAgB;EACtB,QAAQ;CACV;CAEA,MAAM,uBAAA,GAAA,yBAAA,KACJ,qTACA,EACE,UAAU,EACR,MAAM;EACJ,MAAM;EACN,OAAO;CACT,EACF,EACF,CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;EACE,cAAY,OAAO,aAAa;EAChC,gBAAc;EACd,WAAW,oBAAoB;GAAE;GAAM;EAAU,CAAC;EACxC;EACV,SAAS;EACT,MAAK;YAEL,iBAAA,GAAA,kBAAA,KAACA,oBAAAA,kBAAD,EAAkB,WAAU,8CAA+C,CAAA;CACrE,CAAA;AAEZ"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//#region src/components/on-off-button.d.ts
|
|
4
|
-
interface OnOffButtonProps {
|
|
5
|
-
isOn: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
declare function OnOffButton({
|
|
11
|
-
disabled,
|
|
12
|
-
isOn,
|
|
13
|
-
onClick,
|
|
14
|
-
className
|
|
15
|
-
}: OnOffButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { OnOffButton };
|
|
18
|
-
//# sourceMappingURL=on-off-button.d.cts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
//#region src/components/on-off-button.d.ts
|
|
4
|
-
interface OnOffButtonProps {
|
|
5
|
-
isOn: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
declare function OnOffButton({
|
|
11
|
-
disabled,
|
|
12
|
-
isOn,
|
|
13
|
-
onClick,
|
|
14
|
-
className
|
|
15
|
-
}: OnOffButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { OnOffButton };
|
|
18
|
-
//# sourceMappingURL=on-off-button.d.ts.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { PowerSettingsNew } from "@epilot/spark-icons";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import { cva } from "class-variance-authority";
|
|
5
|
-
//#region src/components/on-off-button.tsx
|
|
6
|
-
function OnOffButton({ disabled, isOn, onClick, className }) {
|
|
7
|
-
const handleClick = (event) => {
|
|
8
|
-
event.stopPropagation();
|
|
9
|
-
onClick();
|
|
10
|
-
};
|
|
11
|
-
const onOfButtonClassName = cva("focus-visible:ring-primary touch-target inline-flex size-9 min-w-9 cursor-pointer items-center justify-center justify-self-end rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60", { variants: { isOn: {
|
|
12
|
-
true: "bg-base-success-soft text-success hover:bg-base-success-soft/80",
|
|
13
|
-
false: "border border-gray text-gray-light hover:bg-base-gray-soft"
|
|
14
|
-
} } });
|
|
15
|
-
return /* @__PURE__ */ jsx("button", {
|
|
16
|
-
"aria-label": isOn ? "Turn off" : "Turn on",
|
|
17
|
-
"aria-pressed": isOn,
|
|
18
|
-
className: onOfButtonClassName({
|
|
19
|
-
isOn,
|
|
20
|
-
className
|
|
21
|
-
}),
|
|
22
|
-
disabled,
|
|
23
|
-
onClick: handleClick,
|
|
24
|
-
type: "button",
|
|
25
|
-
children: /* @__PURE__ */ jsx(PowerSettingsNew, { className: "block leading-none [--spark-icon-size:16px]" })
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { OnOffButton };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=on-off-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"on-off-button.js","names":[],"sources":["../../src/components/on-off-button.tsx"],"sourcesContent":["import { PowerSettingsNew } from '@epilot/spark-icons'\nimport { cva } from 'class-variance-authority'\nimport type { MouseEvent } from 'react'\n\ninterface OnOffButtonProps {\n isOn: boolean\n disabled?: boolean\n onClick: () => void\n className?: string\n}\n\nexport function OnOffButton({\n disabled,\n isOn,\n onClick,\n className,\n}: OnOffButtonProps) {\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation()\n onClick()\n }\n\n const onOfButtonClassName = cva(\n 'focus-visible:ring-primary touch-target inline-flex size-9 min-w-9 cursor-pointer items-center justify-center justify-self-end rounded-[max(var(--spark-rounded-md),var(--spark-rounded-full))] transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60',\n {\n variants: {\n isOn: {\n true: 'bg-base-success-soft text-success hover:bg-base-success-soft/80',\n false: 'border border-gray text-gray-light hover:bg-base-gray-soft',\n },\n },\n },\n )\n\n return (\n <button\n aria-label={isOn ? 'Turn off' : 'Turn on'}\n aria-pressed={isOn}\n className={onOfButtonClassName({ isOn, className })}\n disabled={disabled}\n onClick={handleClick}\n type=\"button\"\n >\n <PowerSettingsNew className=\"block leading-none [--spark-icon-size:16px]\" />\n </button>\n )\n}\n"],"mappings":";;;;;AAWA,SAAgB,YAAY,EAC1B,UACA,MACA,SACA,aACmB;CACnB,MAAM,eAAe,UAAyC;EAC5D,MAAM,gBAAgB;EACtB,QAAQ;CACV;CAEA,MAAM,sBAAsB,IAC1B,qTACA,EACE,UAAU,EACR,MAAM;EACJ,MAAM;EACN,OAAO;CACT,EACF,EACF,CACF;CAEA,OACE,oBAAC,UAAD;EACE,cAAY,OAAO,aAAa;EAChC,gBAAc;EACd,WAAW,oBAAoB;GAAE;GAAM;EAAU,CAAC;EACxC;EACV,SAAS;EACT,MAAK;YAEL,oBAAC,kBAAD,EAAkB,WAAU,8CAA+C,CAAA;CACrE,CAAA;AAEZ"}
|