@galaxy-io/dls 1.3.6 → 1.4.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/dist/accordion/Accordion.js +2 -2
- package/dist/avatar/AvatarShimmer.d.ts +1 -1
- package/dist/buttons/Button.js +2 -2
- package/dist/charts/BarChart.js +20 -43
- package/dist/charts/ChartAxis.d.ts +2 -11
- package/dist/charts/ChartAxis.js +4 -5
- package/dist/charts/ChartEmptyState.js +3 -3
- package/dist/charts/ChartFrame.js +1 -3
- package/dist/charts/ChartLegend.d.ts +1 -9
- package/dist/charts/ChartLegend.js +1 -27
- package/dist/charts/ChartPrimitives.d.ts +16 -15
- package/dist/charts/ChartPrimitives.js +74 -65
- package/dist/charts/ChartTooltip.js +19 -37
- package/dist/charts/LineChart.js +48 -69
- package/dist/charts/PieChart.js +19 -33
- package/dist/charts/constants.d.ts +0 -19
- package/dist/charts/constants.js +1 -78
- package/dist/charts/useChartInteraction.d.ts +11 -1
- package/dist/charts/useChartInteraction.js +7 -2
- package/dist/charts/useSeriesColorResolver.d.ts +0 -7
- package/dist/charts/useSeriesColorResolver.js +1 -2
- package/dist/dividers/HorizontalDivider.d.ts +4 -1
- package/dist/dividers/HorizontalDivider.js +28 -7
- package/dist/icons/GalaxyLogomark3D.js +4 -4
- package/dist/inputs/ColorInput.js +2 -2
- package/dist/inputs/CopyInput.js +4 -1
- package/dist/inputs/Input.d.ts +1 -1
- package/dist/inputs/MultiSelectInput.js +6 -6
- package/dist/inputs/SelectInput.js +6 -6
- package/dist/inputs/SwitcherInput.d.ts +11 -0
- package/dist/inputs/SwitcherInput.js +41 -0
- package/dist/shapes/Square.d.ts +6 -0
- package/dist/shapes/Square.js +25 -0
- package/dist/styles.css +28 -26
- package/dist/table/SpreadsheetCell.js +2 -2
- package/dist/table/SpreadsheetPrimitives.d.ts +6 -6
- package/dist/table/TablePrimitives.d.ts +6 -6
- package/dist/text/HotKeys.d.ts +20 -0
- package/dist/text/HotKeys.js +68 -0
- package/dist/toast/ToastProvider.js +3 -3
- package/dist/{animations → transform}/Fade.js +1 -1
- package/dist/transform/Flash.d.ts +3 -0
- package/dist/transform/Flash.js +14 -0
- package/dist/transform/Rotate.d.ts +8 -0
- package/dist/transform/Rotate.js +28 -0
- package/dist/{animations → transform}/ScaleFade.js +1 -1
- package/dist/transform/Spin.d.ts +7 -0
- package/dist/transform/Spin.js +20 -0
- package/package.json +4 -12
- package/dist/animations/Flashing.d.ts +0 -3
- package/dist/animations/Flashing.js +0 -14
- package/dist/animations/RotateWithTransition.d.ts +0 -8
- package/dist/animations/RotateWithTransition.js +0 -28
- package/dist/animations/SpinAnimation.d.ts +0 -7
- package/dist/animations/SpinAnimation.js +0 -20
- package/dist/animations/SpinVerticalAnimation.d.ts +0 -6
- package/dist/animations/SpinVerticalAnimation.js +0 -19
- package/dist/hotkeys/HotKeyBindings.d.ts +0 -7
- package/dist/hotkeys/HotKeyBindings.js +0 -23
- package/dist/hotkeys/HotKeySymbol.d.ts +0 -13
- package/dist/hotkeys/HotKeySymbol.js +0 -49
- package/dist/switcher/Switcher.d.ts +0 -11
- package/dist/switcher/Switcher.js +0 -41
- /package/dist/{animations → transform}/Fade.d.ts +0 -0
- /package/dist/{animations → transform}/ScaleFade.d.ts +0 -0
package/dist/charts/constants.js
CHANGED
|
@@ -214,83 +214,6 @@ var CHART_TOOLTIP_MAX_WIDTH = 320;
|
|
|
214
214
|
/** Gap in px between the plot box and a side-placed legend. */
|
|
215
215
|
var CHART_LEGEND_SIDE_GAP = 16;
|
|
216
216
|
/**
|
|
217
|
-
* Ghost bar heights, one inner array per group — three bars each, so the
|
|
218
|
-
* skeleton reads as the grouped chart it usually stands in for rather than a
|
|
219
|
-
* sparse row of lone bars.
|
|
220
|
-
*/
|
|
221
|
-
var SKELETON_BAR_GROUPS = [
|
|
222
|
-
[
|
|
223
|
-
65,
|
|
224
|
-
45,
|
|
225
|
-
25
|
|
226
|
-
],
|
|
227
|
-
[
|
|
228
|
-
80,
|
|
229
|
-
55,
|
|
230
|
-
30
|
|
231
|
-
],
|
|
232
|
-
[
|
|
233
|
-
45,
|
|
234
|
-
70,
|
|
235
|
-
35
|
|
236
|
-
],
|
|
237
|
-
[
|
|
238
|
-
70,
|
|
239
|
-
50,
|
|
240
|
-
40
|
|
241
|
-
],
|
|
242
|
-
[
|
|
243
|
-
55,
|
|
244
|
-
75,
|
|
245
|
-
30
|
|
246
|
-
]
|
|
247
|
-
];
|
|
248
|
-
/**
|
|
249
|
-
* Ghost lines, one inner array per line, offset from each other and drawn with
|
|
250
|
-
* their area fills so the skeleton has the layered depth of a real multi-series
|
|
251
|
-
* chart instead of a single bare stroke.
|
|
252
|
-
*/
|
|
253
|
-
var SKELETON_LINE_SERIES = [
|
|
254
|
-
[
|
|
255
|
-
30,
|
|
256
|
-
55,
|
|
257
|
-
45,
|
|
258
|
-
70,
|
|
259
|
-
60,
|
|
260
|
-
85,
|
|
261
|
-
75
|
|
262
|
-
],
|
|
263
|
-
[
|
|
264
|
-
20,
|
|
265
|
-
35,
|
|
266
|
-
50,
|
|
267
|
-
40,
|
|
268
|
-
60,
|
|
269
|
-
55,
|
|
270
|
-
70
|
|
271
|
-
],
|
|
272
|
-
[
|
|
273
|
-
10,
|
|
274
|
-
25,
|
|
275
|
-
20,
|
|
276
|
-
35,
|
|
277
|
-
30,
|
|
278
|
-
45,
|
|
279
|
-
40
|
|
280
|
-
]
|
|
281
|
-
];
|
|
282
|
-
/** Ghost donut shares — three arcs, halving. */
|
|
283
|
-
var SKELETON_PIE_VALUES = [
|
|
284
|
-
5,
|
|
285
|
-
3,
|
|
286
|
-
2
|
|
287
|
-
];
|
|
288
|
-
/**
|
|
289
|
-
* Skeleton pulse period, matching the cadence of `TextShimmer` and
|
|
290
|
-
* `AvatarShimmer` so charts load in step with everything else on the page.
|
|
291
|
-
*/
|
|
292
|
-
var CHART_SKELETON_PULSE_MS = 2500;
|
|
293
|
-
/**
|
|
294
217
|
* Approximate width of one CAPTION-size character.
|
|
295
218
|
*
|
|
296
219
|
* Axis sizing estimates label widths arithmetically rather than measuring the
|
|
@@ -338,4 +261,4 @@ var CHART_PALETTE_ORDER = [
|
|
|
338
261
|
ChartPalette.RED
|
|
339
262
|
];
|
|
340
263
|
//#endregion
|
|
341
|
-
export { AGGREGATED_SLICE_KEY, AUTO_MARGIN_LEFT_STEP, AXIS_TITLE_BAND, AXIS_TITLE_GAP, BAR_GAP_COMFORTABLE, BAR_GAP_MEDIUM, BAR_GAP_TIGHT, BAR_RADIUS, BAR_RADIUS_NARROW, BAR_WIDTH_RATIO, CAPTION_CHAR_WIDTH_PX, CATEGORY_AXIS_LABEL_GAP, CATEGORY_AXIS_LABEL_HEIGHT, CHART_LEGEND_SIDE_GAP, CHART_MARK_OPACITY_ACTIVE, CHART_MARK_OPACITY_MUTED, CHART_PALETTE_ORDER, CHART_RESTORE_DELAY_MS,
|
|
264
|
+
export { AGGREGATED_SLICE_KEY, AUTO_MARGIN_LEFT_STEP, AXIS_TITLE_BAND, AXIS_TITLE_GAP, BAR_GAP_COMFORTABLE, BAR_GAP_MEDIUM, BAR_GAP_TIGHT, BAR_RADIUS, BAR_RADIUS_NARROW, BAR_WIDTH_RATIO, CAPTION_CHAR_WIDTH_PX, CATEGORY_AXIS_LABEL_GAP, CATEGORY_AXIS_LABEL_HEIGHT, CHART_LEGEND_SIDE_GAP, CHART_MARK_OPACITY_ACTIVE, CHART_MARK_OPACITY_MUTED, CHART_PALETTE_ORDER, CHART_RESTORE_DELAY_MS, CHART_TOOLTIP_MAX_WIDTH, CHART_TOOLTIP_MIN_WIDTH, CHART_TOOLTIP_OFFSET, CHART_TRANSITION_MS, DEFAULT_CHART_MARGIN, DEFAULT_LINE_STROKE_WIDTH, DEFAULT_VALUE_TICK_COUNT, GRID_LINE_BLEED, GROUP_GAP_COMFORTABLE, GROUP_GAP_MEDIUM, GROUP_GAP_TIGHT, LINE_AREA_OPACITY, LINE_POINT_RADIUS, MAX_AUTO_MARGIN_LEFT, MAX_BAR_WIDTH, MAX_GAP_SHARE, MIN_AUTO_MARGIN_LEFT, MIN_BARS_FOR_TIGHT_SPACING, MIN_BAR_LENGTH, MIN_CATEGORY_LABEL_GAP, NARROW_BAR_WIDTH, PIE_CHART_MARGIN, PIE_CORNER_RADIUS, PIE_DONUT_INNER_RATIO, PIE_MAX_AUTO_INNER_RATIO, PIE_MAX_INSET_SHARE, PIE_MIN_SLICE_SHARE, PIE_PAD_ANGLE, PIE_TOOLTIP_ANCHOR_INSET, STACK_SEGMENT_GAP, VALUE_AXIS_LABEL_HEIGHT, VALUE_AXIS_TICK_GAP, WIDTH_FOR_MEDIUM_SPACING, WIDTH_FOR_TIGHT_SPACING };
|
|
@@ -25,6 +25,16 @@ interface UseChartInteractionOptions {
|
|
|
25
25
|
seriesKeys?: string[];
|
|
26
26
|
/** Suppress all interaction — used while loading and when the tooltip is off. */
|
|
27
27
|
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Render every mark muted, whatever the two axes say.
|
|
30
|
+
*
|
|
31
|
+
* Distinct from {@link disabled}, which suppresses *input*. Loading suppresses
|
|
32
|
+
* *emphasis*: there is nothing yet worth drawing attention to. Folded in here
|
|
33
|
+
* rather than left to each mark, because the alternative is the same
|
|
34
|
+
* `isLoading ? MUTED : getMarkState(…)` ternary hand-copied at every mark —
|
|
35
|
+
* which is exactly how one of them came to be missing it.
|
|
36
|
+
*/
|
|
37
|
+
isLoading?: boolean;
|
|
28
38
|
}
|
|
29
39
|
interface MarkStateArgs {
|
|
30
40
|
/** Omit for marks that belong to no particular category, such as a line. */
|
|
@@ -55,5 +65,5 @@ export interface ChartInteraction {
|
|
|
55
65
|
onSeriesEnter: (seriesKey: string) => void;
|
|
56
66
|
onSeriesLeave: () => void;
|
|
57
67
|
}
|
|
58
|
-
export declare function useChartInteraction({ categoryCount, seriesKeys, disabled, }: UseChartInteractionOptions): ChartInteraction;
|
|
68
|
+
export declare function useChartInteraction({ categoryCount, seriesKeys, disabled, isLoading, }: UseChartInteractionOptions): ChartInteraction;
|
|
59
69
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChartMarkState } from "./types.js";
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
3
|
//#region src/charts/useChartInteraction.ts
|
|
4
|
-
function useChartInteraction({ categoryCount, seriesKeys, disabled = false }) {
|
|
4
|
+
function useChartInteraction({ categoryCount, seriesKeys, disabled = false, isLoading = false }) {
|
|
5
5
|
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
6
6
|
const [hoveredSeriesKey, setHoveredSeriesKey] = useState(null);
|
|
7
7
|
const safeHovered = hoveredIndex !== null && hoveredIndex < categoryCount ? hoveredIndex : null;
|
|
@@ -21,8 +21,13 @@ function useChartInteraction({ categoryCount, seriesKeys, disabled = false }) {
|
|
|
21
21
|
setHoveredSeriesKey(null);
|
|
22
22
|
}, []);
|
|
23
23
|
const getMarkState = useCallback(({ categoryIndex, seriesKey }) => {
|
|
24
|
+
if (isLoading) return ChartMarkState.MUTED;
|
|
24
25
|
return categoryIndex !== void 0 && safeHovered !== null && categoryIndex !== safeHovered || seriesKey !== void 0 && safeHoveredSeries !== null && seriesKey !== safeHoveredSeries ? ChartMarkState.MUTED : ChartMarkState.ACTIVE;
|
|
25
|
-
}, [
|
|
26
|
+
}, [
|
|
27
|
+
isLoading,
|
|
28
|
+
safeHovered,
|
|
29
|
+
safeHoveredSeries
|
|
30
|
+
]);
|
|
26
31
|
return useMemo(() => ({
|
|
27
32
|
activeIndex: safeHovered,
|
|
28
33
|
hoveredSeriesKey: safeHoveredSeries,
|
|
@@ -33,12 +33,5 @@ export interface SeriesColorResolver<TKey extends string> {
|
|
|
33
33
|
* imply it is.
|
|
34
34
|
*/
|
|
35
35
|
neutral: string;
|
|
36
|
-
/**
|
|
37
|
-
* Ghost colour for skeleton marks while the chart is loading.
|
|
38
|
-
*
|
|
39
|
-
* The same token the shimmer components use, so the loading vocabulary is
|
|
40
|
-
* one colour everywhere.
|
|
41
|
-
*/
|
|
42
|
-
placeholder: string;
|
|
43
36
|
}
|
|
44
37
|
export declare function useSeriesColorResolver<TKey extends string>(series: ChartSeriesStyles<TKey>): SeriesColorResolver<TKey>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export interface HorizontalDividerProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
}
|
|
4
|
+
declare const HorizontalDivider: ({ label }: HorizontalDividerProps) => import("react").JSX.Element;
|
|
2
5
|
export default HorizontalDivider;
|
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
import Text, { TextSize, TextVariant } from "../text/Text.js";
|
|
2
3
|
/* empty css */
|
|
3
4
|
import { styled } from "@linaria/react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/dividers/HorizontalDivider.tsx
|
|
6
|
-
var _exp = () => ({
|
|
7
|
-
var
|
|
8
|
-
|
|
7
|
+
var _exp = () => ({ $flex }) => $flex ? "auto" : "100%";
|
|
8
|
+
var _exp2 = () => ({ $flex }) => $flex ? "1 1 0%" : "0 0 auto";
|
|
9
|
+
var _exp3 = () => ({ theme }) => theme.color.border.primary;
|
|
10
|
+
var HorizontalDividerLine = withTheme(/*#__PURE__*/ styled("div")({
|
|
11
|
+
name: "HorizontalDividerLine",
|
|
9
12
|
class: "h1sww5hz",
|
|
10
13
|
propsAsIs: false,
|
|
11
|
-
vars: {
|
|
14
|
+
vars: {
|
|
15
|
+
"h1sww5hz-0": [_exp()],
|
|
16
|
+
"h1sww5hz-1": [_exp2()],
|
|
17
|
+
"h1sww5hz-2": [_exp3()]
|
|
18
|
+
}
|
|
12
19
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
20
|
+
var LabeledDividerWrapper = /*#__PURE__*/ styled("div")({
|
|
21
|
+
name: "LabeledDividerWrapper",
|
|
22
|
+
class: "l44ah51",
|
|
23
|
+
propsAsIs: false
|
|
24
|
+
});
|
|
25
|
+
var HorizontalDivider = ({ label }) => {
|
|
26
|
+
if (!label) return /* @__PURE__ */ jsx(HorizontalDividerLine, {});
|
|
27
|
+
return /* @__PURE__ */ jsxs(LabeledDividerWrapper, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(HorizontalDividerLine, { $flex: true }),
|
|
29
|
+
/* @__PURE__ */ jsx(Text, {
|
|
30
|
+
size: TextSize.CAPTION,
|
|
31
|
+
variant: TextVariant.TERTIARY,
|
|
32
|
+
children: label
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsx(HorizontalDividerLine, { $flex: true })
|
|
35
|
+
] });
|
|
15
36
|
};
|
|
16
37
|
//#endregion
|
|
17
38
|
export { HorizontalDivider as default };
|
|
@@ -4,7 +4,7 @@ import galaxy_logomark_default from "../assets/models/galaxy-logomark.js";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { styled } from "@linaria/react";
|
|
6
6
|
import { Suspense, useEffect, useRef, useState } from "react";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Center, Environment, OrbitControls } from "@react-three/drei";
|
|
9
9
|
import { Canvas, useFrame, useLoader } from "@react-three/fiber";
|
|
10
10
|
import * as THREE from "three";
|
|
@@ -139,7 +139,7 @@ function LogoMesh({ color, isDark, isAutoRotate = false, isHoverable = true, isH
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
function SimpleLighting() {
|
|
142
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
142
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
143
143
|
/* @__PURE__ */ jsx("ambientLight", { intensity: .5 }),
|
|
144
144
|
/* @__PURE__ */ jsx("directionalLight", {
|
|
145
145
|
position: [
|
|
@@ -160,7 +160,7 @@ function SimpleLighting() {
|
|
|
160
160
|
] });
|
|
161
161
|
}
|
|
162
162
|
function DramaticLighting({ backlight, spotlight, fillLight }) {
|
|
163
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
163
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
164
164
|
/* @__PURE__ */ jsx("ambientLight", { intensity: .15 }),
|
|
165
165
|
/* @__PURE__ */ jsx("directionalLight", {
|
|
166
166
|
position: [
|
|
@@ -227,7 +227,7 @@ function DramaticLighting({ backlight, spotlight, fillLight }) {
|
|
|
227
227
|
] });
|
|
228
228
|
}
|
|
229
229
|
function Scene({ color, isDark, isAutoRotate, isInteractive, isHoverable, isHovered, speed, isDramaticMode, backlight, spotlight, fillLight, material, environmentPreset }) {
|
|
230
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
230
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
231
231
|
isDramaticMode && backlight && spotlight && fillLight ? /* @__PURE__ */ jsx(DramaticLighting, {
|
|
232
232
|
backlight,
|
|
233
233
|
spotlight,
|
|
@@ -12,7 +12,7 @@ import { InputLabel, InputSize } from "./Input.js";
|
|
|
12
12
|
import { styled } from "@linaria/react";
|
|
13
13
|
import { match } from "ts-pattern";
|
|
14
14
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
15
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { CaretDownIcon } from "@phosphor-icons/react";
|
|
17
17
|
import { Hue, Saturation } from "@uiw/react-color";
|
|
18
18
|
//#region src/inputs/ColorInput.tsx
|
|
@@ -339,7 +339,7 @@ var ColorInput = ({ label, size = InputSize.MEDIUM, value, placeholder = "Select
|
|
|
339
339
|
/* @__PURE__ */ jsxs(FlexWrapper, {
|
|
340
340
|
alignItems: AlignItems.CENTER,
|
|
341
341
|
gap: 8,
|
|
342
|
-
children: [value && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ColorInputPreviewSwatch, { $color: value }), /* @__PURE__ */ jsx(Spacing, { left: 4 })] }), /* @__PURE__ */ jsx(Text, {
|
|
342
|
+
children: [value && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ColorInputPreviewSwatch, { $color: value }), /* @__PURE__ */ jsx(Spacing, { left: 4 })] }), /* @__PURE__ */ jsx(Text, {
|
|
343
343
|
variant: textVariant,
|
|
344
344
|
size: COLOR_INPUT_SIZE_TO_TEXT_SIZE[size],
|
|
345
345
|
isEllipsis: true,
|
package/dist/inputs/CopyInput.js
CHANGED
|
@@ -2,7 +2,7 @@ import Button, { ButtonSize, ButtonVariant } from "../buttons/Button.js";
|
|
|
2
2
|
import FlexWrapper, { AlignItems } from "../containers/FlexWrapper.js";
|
|
3
3
|
import { InputSize } from "./Input.js";
|
|
4
4
|
import TextInput from "./TextInput.js";
|
|
5
|
-
import { useCallback, useState } from "react";
|
|
5
|
+
import { useCallback, useRef, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { CheckIcon, CopyIcon } from "@phosphor-icons/react";
|
|
8
8
|
//#region src/inputs/CopyInput.tsx
|
|
@@ -13,7 +13,9 @@ var INPUT_SIZE_TO_BUTTON_SIZE = {
|
|
|
13
13
|
};
|
|
14
14
|
var CopyInput = ({ value, label, labelTooltip, size = InputSize.MEDIUM, width, fillWidth, isMonospace = false }) => {
|
|
15
15
|
const [copied, setCopied] = useState(false);
|
|
16
|
+
const inputRef = useRef(null);
|
|
16
17
|
const handleCopy = useCallback(() => {
|
|
18
|
+
inputRef.current?.select();
|
|
17
19
|
navigator.clipboard.writeText(value).then(() => {
|
|
18
20
|
setCopied(true);
|
|
19
21
|
setTimeout(() => setCopied(false), 2e3);
|
|
@@ -24,6 +26,7 @@ var CopyInput = ({ value, label, labelTooltip, size = InputSize.MEDIUM, width, f
|
|
|
24
26
|
gap: 8,
|
|
25
27
|
fillWidth,
|
|
26
28
|
children: [/* @__PURE__ */ jsx(TextInput, {
|
|
29
|
+
ref: inputRef,
|
|
27
30
|
label,
|
|
28
31
|
labelTooltip,
|
|
29
32
|
value,
|
package/dist/inputs/Input.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const StyledInput: import("react").ComponentType<Pick<import("rea
|
|
|
24
24
|
theme: import("../theme").Theme;
|
|
25
25
|
} & {
|
|
26
26
|
as?: React.ElementType;
|
|
27
|
-
}, "$width" | "$fillWidth" | "
|
|
27
|
+
}, "$width" | "$fillWidth" | "$size" | "$isMonospace" | "as" | "$isError" | "$hasLeadingIcon" | "$hasTrailingAction" | "$isDisabled" | keyof import("react").ClassAttributes<HTMLInputElement> | keyof import("react").InputHTMLAttributes<HTMLInputElement>> & {
|
|
28
28
|
theme?: import("@callstack/react-theme-provider").$DeepPartial<import("../theme").Theme> | undefined;
|
|
29
29
|
}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<import("react").ComponentType<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
30
30
|
$size: InputSize;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
2
|
import { getCssSizeValue } from "../utils/linaria.js";
|
|
3
|
+
import Rotate from "../transform/Rotate.js";
|
|
3
4
|
import Text, { TextSize, TextVariant } from "../text/Text.js";
|
|
4
5
|
import FlexItem from "../containers/FlexItem.js";
|
|
5
6
|
import Icon, { IconVariant } from "../icons/Icon.js";
|
|
@@ -7,7 +8,6 @@ import FlexWrapper, { AlignItems, FlexDirection } from "../containers/FlexWrappe
|
|
|
7
8
|
import CheckboxInput, { CheckboxInputVariant } from "./CheckboxInput.js";
|
|
8
9
|
import Dropdown, { DropdownPosition, DropdownVariant } from "../dropdown/Dropdown.js";
|
|
9
10
|
import { InputLabel, InputSize } from "./Input.js";
|
|
10
|
-
import RotateWithTransition from "../animations/RotateWithTransition.js";
|
|
11
11
|
import HorizontalDivider from "../dividers/HorizontalDivider.js";
|
|
12
12
|
import { useElementWidth } from "../hooks/useElementWidth.js";
|
|
13
13
|
import { useControlledOpenState, useDebouncedValue } from "./hooks.js";
|
|
@@ -16,7 +16,7 @@ import { SELECT_INPUT_SIZE_TO_ICON_SIZE, SELECT_INPUT_SIZE_TO_TEXT_SIZE_MAP, SEL
|
|
|
16
16
|
import { styled } from "@linaria/react";
|
|
17
17
|
import { match } from "ts-pattern";
|
|
18
18
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
19
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
import { ArrowCounterClockwiseIcon, CaretDownIcon } from "@phosphor-icons/react";
|
|
21
21
|
//#region src/inputs/MultiSelectInput.tsx
|
|
22
22
|
var _exp = () => ({ $size }) => {
|
|
@@ -324,7 +324,7 @@ var MultiSelectInput = ({ label, icon, variant = SelectInputVariant.PRIMARY, siz
|
|
|
324
324
|
$fillWidth: fillWidth,
|
|
325
325
|
$width: resolvedDropdownWidth,
|
|
326
326
|
children: [
|
|
327
|
-
filteredPinnedOptions.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [filteredPinnedOptions.map((pinnedOption, index) => /* @__PURE__ */ jsx(PinnedOptionButton, {
|
|
327
|
+
filteredPinnedOptions.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [filteredPinnedOptions.map((pinnedOption, index) => /* @__PURE__ */ jsx(PinnedOptionButton, {
|
|
328
328
|
ref: (el) => {
|
|
329
329
|
optionsRefs.current[index] = el;
|
|
330
330
|
},
|
|
@@ -409,7 +409,7 @@ var MultiSelectInput = ({ label, icon, variant = SelectInputVariant.PRIMARY, siz
|
|
|
409
409
|
})
|
|
410
410
|
})
|
|
411
411
|
}),
|
|
412
|
-
onReset && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FlexItem, {
|
|
412
|
+
onReset && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FlexItem, {
|
|
413
413
|
shrink: 0,
|
|
414
414
|
children: /* @__PURE__ */ jsx(HorizontalDivider, {})
|
|
415
415
|
}), /* @__PURE__ */ jsx(PinnedOptionButton, {
|
|
@@ -503,7 +503,7 @@ var MultiSelectInput = ({ label, icon, variant = SelectInputVariant.PRIMARY, siz
|
|
|
503
503
|
disabled: effectiveIsDisabled,
|
|
504
504
|
onClick: (e) => e.stopPropagation()
|
|
505
505
|
}),
|
|
506
|
-
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(
|
|
506
|
+
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(Rotate, {
|
|
507
507
|
isRotated: visible,
|
|
508
508
|
deg: -180,
|
|
509
509
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
@@ -541,7 +541,7 @@ var MultiSelectInput = ({ label, icon, variant = SelectInputVariant.PRIMARY, siz
|
|
|
541
541
|
isEllipsis: true,
|
|
542
542
|
children: displayValue
|
|
543
543
|
}),
|
|
544
|
-
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(
|
|
544
|
+
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(Rotate, {
|
|
545
545
|
isRotated: visible,
|
|
546
546
|
deg: -180,
|
|
547
547
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
2
|
import { getCssSizeValue } from "../utils/linaria.js";
|
|
3
|
+
import Rotate from "../transform/Rotate.js";
|
|
3
4
|
import Text, { TextSize, TextVariant } from "../text/Text.js";
|
|
4
5
|
import FlexItem from "../containers/FlexItem.js";
|
|
5
6
|
import Icon, { IconVariant, IconWeight } from "../icons/Icon.js";
|
|
@@ -7,7 +8,6 @@ import FlexWrapper, { AlignItems, FlexDirection } from "../containers/FlexWrappe
|
|
|
7
8
|
import Dropdown, { DropdownVariant } from "../dropdown/Dropdown.js";
|
|
8
9
|
import Spacing from "../containers/Spacing.js";
|
|
9
10
|
import { InputLabel, InputSize } from "./Input.js";
|
|
10
|
-
import RotateWithTransition from "../animations/RotateWithTransition.js";
|
|
11
11
|
import HorizontalDivider from "../dividers/HorizontalDivider.js";
|
|
12
12
|
import { useElementWidth } from "../hooks/useElementWidth.js";
|
|
13
13
|
import { useControlledOpenState, useDebouncedValue } from "./hooks.js";
|
|
@@ -15,7 +15,7 @@ import { useControlledOpenState, useDebouncedValue } from "./hooks.js";
|
|
|
15
15
|
import { styled } from "@linaria/react";
|
|
16
16
|
import { match } from "ts-pattern";
|
|
17
17
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
18
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { ArrowCounterClockwiseIcon, CaretDownIcon, CheckIcon } from "@phosphor-icons/react";
|
|
20
20
|
//#region src/inputs/SelectInput.tsx
|
|
21
21
|
var SelectInputVariant = /* @__PURE__ */ function(SelectInputVariant) {
|
|
@@ -301,7 +301,7 @@ var SelectInput = ({ label, variant = "PRIMARY", size = InputSize.MEDIUM, option
|
|
|
301
301
|
$fillWidth: fillWidth,
|
|
302
302
|
$width: resolvedDropdownWidth,
|
|
303
303
|
children: [
|
|
304
|
-
filteredPinnedOptions.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [filteredPinnedOptions.map((pinnedOption, index) => /* @__PURE__ */ jsxs(PinnedOptionButton, {
|
|
304
|
+
filteredPinnedOptions.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [filteredPinnedOptions.map((pinnedOption, index) => /* @__PURE__ */ jsxs(PinnedOptionButton, {
|
|
305
305
|
ref: (el) => {
|
|
306
306
|
optionsRefs.current[index] = el;
|
|
307
307
|
},
|
|
@@ -369,7 +369,7 @@ var SelectInput = ({ label, variant = "PRIMARY", size = InputSize.MEDIUM, option
|
|
|
369
369
|
})
|
|
370
370
|
})
|
|
371
371
|
}),
|
|
372
|
-
onReset && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(HorizontalDivider, {}), /* @__PURE__ */ jsx(PinnedOptionButton, {
|
|
372
|
+
onReset && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(HorizontalDivider, {}), /* @__PURE__ */ jsx(PinnedOptionButton, {
|
|
373
373
|
onClick: handleReset,
|
|
374
374
|
$isSelected: false,
|
|
375
375
|
$isFocused: false,
|
|
@@ -451,7 +451,7 @@ var SelectInput = ({ label, variant = "PRIMARY", size = InputSize.MEDIUM, option
|
|
|
451
451
|
onClick: (e) => e.stopPropagation()
|
|
452
452
|
}),
|
|
453
453
|
/* @__PURE__ */ jsx(Spacing, { left: 8 }),
|
|
454
|
-
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(
|
|
454
|
+
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(Rotate, {
|
|
455
455
|
isRotated: visible,
|
|
456
456
|
deg: -180,
|
|
457
457
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
@@ -498,7 +498,7 @@ var SelectInput = ({ label, variant = "PRIMARY", size = InputSize.MEDIUM, option
|
|
|
498
498
|
})]
|
|
499
499
|
}),
|
|
500
500
|
/* @__PURE__ */ jsx(Spacing, { left: 8 }),
|
|
501
|
-
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(
|
|
501
|
+
/* @__PURE__ */ jsx(FlexWrapper, { children: /* @__PURE__ */ jsx(Rotate, {
|
|
502
502
|
isRotated: visible,
|
|
503
503
|
deg: -180,
|
|
504
504
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SwitcherInputItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface SwitcherInputProps {
|
|
7
|
+
items: SwitcherInputItem[];
|
|
8
|
+
selectedId: string;
|
|
9
|
+
}
|
|
10
|
+
declare const SwitcherInput: ({ items, selectedId }: SwitcherInputProps) => import("react").JSX.Element;
|
|
11
|
+
export default SwitcherInput;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
import Text, { TextWeight } from "../text/Text.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { styled } from "@linaria/react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/inputs/SwitcherInput.tsx
|
|
7
|
+
var _exp = () => ({ theme }) => theme.color.background.primary;
|
|
8
|
+
var _exp2 = () => ({ theme }) => theme.color.border.primary;
|
|
9
|
+
var StyledSwitcherInput = withTheme(/*#__PURE__*/ styled("div")({
|
|
10
|
+
name: "StyledSwitcherInput",
|
|
11
|
+
class: "sx2momv",
|
|
12
|
+
propsAsIs: false,
|
|
13
|
+
vars: {
|
|
14
|
+
"sx2momv-0": [_exp()],
|
|
15
|
+
"sx2momv-1": [_exp2()]
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
var _exp3 = () => ({ theme, $isSelected }) => $isSelected ? theme.color.background.secondary : "transparent";
|
|
19
|
+
var _exp4 = () => ({ theme, $isSelected }) => $isSelected ? theme.color.border.primary : "transparent";
|
|
20
|
+
var StyledSwitcherInputItem = withTheme(/*#__PURE__*/ styled("div")({
|
|
21
|
+
name: "StyledSwitcherInputItem",
|
|
22
|
+
class: "s1pe4aqp",
|
|
23
|
+
propsAsIs: false,
|
|
24
|
+
vars: {
|
|
25
|
+
"s1pe4aqp-0": [_exp3()],
|
|
26
|
+
"s1pe4aqp-1": [_exp4()]
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
29
|
+
var SwitcherInput = ({ items, selectedId }) => {
|
|
30
|
+
return /* @__PURE__ */ jsx(StyledSwitcherInput, { children: items.map((item) => /* @__PURE__ */ jsx(StyledSwitcherInputItem, {
|
|
31
|
+
onClick: item.onClick,
|
|
32
|
+
$isSelected: item.id === selectedId,
|
|
33
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
34
|
+
weight: TextWeight.MEDIUM,
|
|
35
|
+
cursor: "pointer",
|
|
36
|
+
children: item.label
|
|
37
|
+
})
|
|
38
|
+
}, item.label)) });
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { SwitcherInput as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { withTheme } from "../theme/GalaxyTheme.js";
|
|
2
|
+
import { getCssSizeValue } from "../utils/linaria.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { styled } from "@linaria/react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/shapes/Square.tsx
|
|
7
|
+
var _exp2 = () => ({ $size }) => getCssSizeValue($size);
|
|
8
|
+
var _exp3 = () => ({ theme, $hex }) => $hex ?? theme.color.text.tertiary;
|
|
9
|
+
var SquareWrapper = withTheme(/*#__PURE__*/ styled("div")({
|
|
10
|
+
name: "SquareWrapper",
|
|
11
|
+
class: "s1ibzzfh",
|
|
12
|
+
propsAsIs: false,
|
|
13
|
+
vars: {
|
|
14
|
+
"s1ibzzfh-0": [_exp2()],
|
|
15
|
+
"s1ibzzfh-1": [_exp3()]
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
var Square = ({ size, hex }) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(SquareWrapper, {
|
|
20
|
+
$size: size,
|
|
21
|
+
$hex: hex
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Square as default };
|