@galaxy-io/dls 1.4.9 → 1.4.11
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.d.ts +19 -2
- package/dist/accordion/Accordion.js +8 -0
- package/dist/avatar/Avatar.d.ts +9 -0
- package/dist/avatar/Avatar.js +4 -0
- package/dist/avatar/AvatarShimmer.d.ts +2 -0
- package/dist/avatar/AvatarShimmer.js +1 -0
- package/dist/backgrounds/CellGridBackground.d.ts +12 -1
- package/dist/backgrounds/CellGridBackground.js +5 -0
- package/dist/backgrounds/CrossGridBackground.d.ts +13 -1
- package/dist/backgrounds/CrossGridBackground.js +4 -0
- package/dist/backgrounds/DotGridBackground.d.ts +12 -1
- package/dist/backgrounds/DotGridBackground.js +4 -0
- package/dist/badge/Badge.d.ts +12 -0
- package/dist/badge/Badge.js +7 -0
- package/dist/beacons/Beacon.d.ts +7 -13
- package/dist/beacons/Beacon.js +3 -0
- package/dist/buttons/Button.d.ts +18 -0
- package/dist/buttons/Button.js +10 -1
- package/dist/charts/BarChart.js +3 -1
- package/dist/charts/ChartFrame.js +5 -7
- package/dist/charts/ChartLegend.js +1 -5
- package/dist/charts/ChartPrimitives.d.ts +1 -14
- package/dist/charts/ChartPrimitives.js +50 -69
- package/dist/charts/DashboardProvider.d.ts +47 -0
- package/dist/charts/DashboardProvider.js +52 -0
- package/dist/charts/LineChart.js +1 -0
- package/dist/charts/ProgressBar.d.ts +13 -1
- package/dist/charts/ProgressBar.js +7 -0
- package/dist/charts/StatChart.d.ts +10 -1
- package/dist/charts/StatChart.js +5 -0
- package/dist/charts/constants.d.ts +4 -18
- package/dist/charts/constants.js +5 -19
- package/dist/charts/useChartInteraction.d.ts +25 -8
- package/dist/charts/useChartInteraction.js +61 -6
- package/dist/chips/Chip.d.ts +20 -1
- package/dist/chips/Chip.js +9 -1
- package/dist/containers/FlexItem.d.ts +14 -12
- package/dist/containers/FlexItem.js +4 -0
- package/dist/containers/FlexWrapper.d.ts +29 -96
- package/dist/containers/FlexWrapper.js +12 -0
- package/dist/containers/GridWrapper.d.ts +25 -66
- package/dist/containers/GridWrapper.js +8 -0
- package/dist/containers/Spacing.d.ts +10 -0
- package/dist/containers/Spacing.js +7 -0
- package/dist/containers/Wrapper.d.ts +11 -1
- package/dist/containers/Wrapper.js +4 -0
- package/dist/dividers/HorizontalDivider.d.ts +2 -0
- package/dist/dividers/HorizontalDivider.js +1 -0
- package/dist/dividers/VerticalDivider.d.ts +4 -0
- package/dist/dividers/VerticalDivider.js +4 -0
- package/dist/drawer/Drawer.d.ts +11 -4
- package/dist/drawer/Drawer.js +7 -0
- package/dist/dropdown/Dropdown.d.ts +24 -0
- package/dist/dropdown/Dropdown.js +9 -0
- package/dist/editor/CodeEditor.d.ts +23 -42
- package/dist/editor/CodeEditor.js +9 -1
- package/dist/hooks/useDismiss.d.ts +6 -0
- package/dist/hooks/useDismiss.js +6 -0
- package/dist/hooks/useElementClientSize.d.ts +2 -2
- package/dist/hooks/useResize.d.ts +5 -2
- package/dist/icons/GalaxyLogomark.d.ts +9 -1
- package/dist/icons/GalaxyLogomark.js +7 -1
- package/dist/icons/GalaxyLogomark3D.d.ts +15 -0
- package/dist/icons/GalaxyLogomark3D.js +9 -0
- package/dist/icons/GalaxyLogomarkAnimation.d.ts +10 -0
- package/dist/icons/GalaxyLogomarkAnimation.js +7 -1
- package/dist/icons/GalaxyWordmark.d.ts +7 -1
- package/dist/icons/GalaxyWordmark.js +5 -1
- package/dist/icons/Icon.d.ts +10 -0
- package/dist/icons/Icon.js +5 -0
- package/dist/inputs/CheckboxInput.d.ts +13 -0
- package/dist/inputs/CheckboxInput.js +8 -0
- package/dist/inputs/ColorInput.d.ts +15 -0
- package/dist/inputs/ColorInput.js +6 -0
- package/dist/inputs/CopyInput.d.ts +9 -0
- package/dist/inputs/CopyInput.js +4 -0
- package/dist/inputs/DateInput.d.ts +13 -0
- package/dist/inputs/DateInput.js +5 -0
- package/dist/inputs/Input.d.ts +37 -0
- package/dist/inputs/Input.js +13 -0
- package/dist/inputs/MultiSelectInput.d.ts +26 -0
- package/dist/inputs/MultiSelectInput.js +6 -0
- package/dist/inputs/MultiTextInput.d.ts +16 -0
- package/dist/inputs/MultiTextInput.js +9 -0
- package/dist/inputs/NumberInput.d.ts +8 -2
- package/dist/inputs/NumberInput.js +7 -1
- package/dist/inputs/PasswordInput.d.ts +9 -1
- package/dist/inputs/PasswordInput.js +4 -0
- package/dist/inputs/RadioInput.d.ts +13 -0
- package/dist/inputs/RadioInput.js +8 -0
- package/dist/inputs/SelectInput.d.ts +30 -0
- package/dist/inputs/SelectInput.js +8 -0
- package/dist/inputs/SliderInput.d.ts +15 -0
- package/dist/inputs/SliderInput.js +6 -0
- package/dist/inputs/SwitcherInput.d.ts +10 -1
- package/dist/inputs/SwitcherInput.js +4 -0
- package/dist/inputs/TextAreaInput.d.ts +24 -0
- package/dist/inputs/TextAreaInput.js +9 -0
- package/dist/inputs/TextInput.d.ts +8 -1
- package/dist/inputs/TextInput.js +6 -0
- package/dist/inputs/ToggleInput.d.ts +11 -0
- package/dist/inputs/ToggleInput.js +6 -0
- package/dist/lists/BulletedList.d.ts +4 -0
- package/dist/lists/BulletedList.js +2 -0
- package/dist/modal/Modal.d.ts +8 -0
- package/dist/modal/Modal.js +6 -0
- package/dist/overlay/OverlayProvider.d.ts +11 -0
- package/dist/overlay/OverlayProvider.js +7 -0
- package/dist/overlay/constants.d.ts +1 -0
- package/dist/overlay/constants.js +1 -0
- package/dist/overlay/useOverlay.d.ts +11 -0
- package/dist/overlay/useOverlay.js +9 -0
- package/dist/resizable/HorizontalResizeHandle.d.ts +8 -1
- package/dist/resizable/HorizontalResizeHandle.js +6 -0
- package/dist/resizable/VerticalResizeHandle.d.ts +8 -1
- package/dist/resizable/VerticalResizeHandle.js +6 -0
- package/dist/shapes/Circle.d.ts +4 -1
- package/dist/shapes/Circle.js +1 -0
- package/dist/shapes/Square.d.ts +4 -1
- package/dist/shapes/Square.js +1 -0
- package/dist/styles.css +20 -21
- package/dist/table/InfiniteSpreadsheet.d.ts +7 -0
- package/dist/table/InfiniteSpreadsheet.js +7 -0
- package/dist/table/InfiniteTable.d.ts +8 -0
- package/dist/table/InfiniteTable.js +8 -0
- package/dist/table/VirtualizedInfiniteTable.d.ts +7 -0
- package/dist/table/VirtualizedInfiniteTable.js +7 -0
- package/dist/text/Bold.d.ts +4 -0
- package/dist/text/Bold.js +4 -0
- package/dist/text/Code.d.ts +4 -0
- package/dist/text/Code.js +4 -0
- package/dist/text/EditableText.d.ts +10 -1
- package/dist/text/EditableText.js +7 -0
- package/dist/text/Ellipsis.d.ts +6 -4
- package/dist/text/Ellipsis.js +4 -0
- package/dist/text/HotKeys.d.ts +10 -0
- package/dist/text/HotKeys.js +6 -0
- package/dist/text/MarkdownText.d.ts +9 -1
- package/dist/text/MarkdownText.js +6 -0
- package/dist/text/Paragraph.d.ts +17 -0
- package/dist/text/Paragraph.js +7 -0
- package/dist/text/RequiredMarker.d.ts +3 -1
- package/dist/text/RequiredMarker.js +1 -0
- package/dist/text/Selectable.d.ts +4 -0
- package/dist/text/Selectable.js +4 -0
- package/dist/text/Text.d.ts +19 -0
- package/dist/text/Text.js +10 -0
- package/dist/text/TextShimmer.d.ts +7 -0
- package/dist/text/TextShimmer.js +4 -0
- package/dist/theme/GalaxyTheme.d.ts +35 -4
- package/dist/theme/GalaxyTheme.js +13 -1
- package/dist/theme/constants.d.ts +1 -6
- package/dist/theme/constants.js +10 -15
- package/dist/theme/index.js +2 -1
- package/dist/theme/types.d.ts +21 -0
- package/dist/theme/types.js +10 -0
- package/dist/toast/Toast.d.ts +11 -0
- package/dist/toast/Toast.js +5 -0
- package/dist/toast/ToastProvider.d.ts +9 -0
- package/dist/toast/ToastProvider.js +4 -0
- package/dist/toast/useToast.d.ts +7 -0
- package/dist/toast/useToast.js +7 -0
- package/dist/tooltip/Tooltip.d.ts +19 -1
- package/dist/tooltip/Tooltip.js +9 -0
- package/dist/transform/Fade.d.ts +7 -0
- package/dist/transform/Fade.js +6 -0
- package/dist/transform/Flash.d.ts +4 -0
- package/dist/transform/Flash.js +4 -0
- package/dist/transform/Rotate.d.ts +7 -0
- package/dist/transform/Rotate.js +4 -0
- package/dist/transform/ScaleFade.d.ts +7 -0
- package/dist/transform/ScaleFade.js +6 -0
- package/dist/transform/Spin.d.ts +7 -0
- package/dist/transform/Spin.js +5 -0
- package/dist/widget/Widget.d.ts +18 -1
- package/dist/widget/Widget.js +5 -0
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -24,28 +24,27 @@
|
|
|
24
24
|
.c1hcga6s{position:relative;display:var(--c1hcga6s-0);-webkit-flex-direction:var(--c1hcga6s-1);-ms-flex-direction:var(--c1hcga6s-1);flex-direction:var(--c1hcga6s-1);-webkit-align-items:var(--c1hcga6s-2);-webkit-box-align:var(--c1hcga6s-2);-ms-flex-align:var(--c1hcga6s-2);align-items:var(--c1hcga6s-2);-webkit-box-pack:var(--c1hcga6s-3);-ms-flex-pack:var(--c1hcga6s-3);-webkit-justify-content:var(--c1hcga6s-3);justify-content:var(--c1hcga6s-3);width:var(--c1hcga6s-4);min-width:0;height:var(--c1hcga6s-5);min-height:0;}
|
|
25
25
|
.c1fvbgkp{position:relative;width:var(--c1fvbgkp-0);min-width:0;aspect-ratio:var(--c1fvbgkp-1);height:var(--c1fvbgkp-2);-webkit-flex:var(--c1fvbgkp-3);-ms-flex:var(--c1fvbgkp-3);flex:var(--c1fvbgkp-3);min-height:var(--c1fvbgkp-4);}
|
|
26
26
|
.c10uj5yt{display:block;overflow:visible;}
|
|
27
|
-
.cyuty3o
|
|
28
|
-
.c1ob2op2{
|
|
29
|
-
.c8c506o{
|
|
30
|
-
.ceqlpek{
|
|
31
|
-
.c1fcbddl{
|
|
32
|
-
.cpcxr59{
|
|
27
|
+
.cyuty3o{opacity:1;}.cyuty3o[data-state="muted"]{opacity:0.1;}
|
|
28
|
+
.c1ob2op2{fill:none;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;opacity:1;}.c1ob2op2[data-state="muted"]{opacity:0.1;}
|
|
29
|
+
.c8c506o{stroke:none;pointer-events:none;opacity:1;}.c8c506o[data-state="muted"]{opacity:0.1;}
|
|
30
|
+
.ceqlpek{pointer-events:none;opacity:1;}.ceqlpek[data-state="muted"]{opacity:0.1;}
|
|
31
|
+
.c1fcbddl{opacity:1;}.c1fcbddl[data-state="muted"]{opacity:0.1;}
|
|
32
|
+
.cpcxr59{fill:transparent;outline:none;}
|
|
33
33
|
.c1wvzvu4{fill:transparent;outline:none;}
|
|
34
|
-
.c17guewt{
|
|
35
|
-
.cblgiyf{stroke:var(--cblgiyf-0);
|
|
36
|
-
.c1lr03cc{
|
|
37
|
-
.cizy1s8{
|
|
38
|
-
.c1ukq11d{
|
|
39
|
-
.cwcko2m{display:-
|
|
40
|
-
.cqwhvyz{
|
|
41
|
-
.c1iaray{
|
|
42
|
-
.cz6jod1{position:absolute;
|
|
43
|
-
.c1de5mqk{position:
|
|
44
|
-
.cjirv6a{position:
|
|
45
|
-
.c1armna5{
|
|
46
|
-
.cgd77rv{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:
|
|
47
|
-
.cutidpi{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px
|
|
48
|
-
.ccpczg{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;opacity:1;-webkit-transition:opacity 100ms ease-in-out 200ms;transition:opacity 100ms ease-in-out 200ms;}.ccpczg[data-state="muted"]{opacity:0.1;}@media (prefers-reduced-motion: reduce){.ccpczg{-webkit-transition:none;transition:none;}}
|
|
34
|
+
.c17guewt{stroke:var(--c17guewt-0);shape-rendering:crispEdges;}
|
|
35
|
+
.cblgiyf{stroke:var(--cblgiyf-0);pointer-events:none;}
|
|
36
|
+
.c1lr03cc{overflow:visible;pointer-events:none;}
|
|
37
|
+
.cizy1s8{position:absolute;z-index:10;pointer-events:none;left:var(--cizy1s8-0);top:var(--cizy1s8-1);min-width:168px;max-width:320px;padding:10px 12px;border:0.5px solid var(--cizy1s8-2);border-radius:6px;background-color:var(--cizy1s8-3);opacity:var(--cizy1s8-4);-webkit-transition:opacity 100ms ease-in-out,left 100ms ease-out,top 100ms ease-out;transition:opacity 100ms ease-in-out,left 100ms ease-out,top 100ms ease-out;}@media (prefers-reduced-motion: reduce){.cizy1s8{-webkit-transition:none;transition:none;}}
|
|
38
|
+
.c1ukq11d{display:-ms-grid;display:grid;-ms-grid-columns:minmax(0, 1fr) auto;grid-template-columns:minmax(0, 1fr) auto;-webkit-column-gap:16px;column-gap:16px;row-gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;}
|
|
39
|
+
.cwcko2m{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;min-width:0;}
|
|
40
|
+
.cqwhvyz{text-align:right;white-space:nowrap;}
|
|
41
|
+
.c1iaray{position:absolute;left:var(--c1iaray-0);top:var(--c1iaray-1);width:var(--c1iaray-2);height:var(--c1iaray-2);-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);pointer-events:none;text-align:center;}
|
|
42
|
+
.cz6jod1{position:absolute;top:38%;left:50%;-webkit-transform:translate(-50%, -50%);-moz-transform:translate(-50%, -50%);-ms-transform:translate(-50%, -50%);transform:translate(-50%, -50%);max-width:60%;padding:6px 8px;border:0.5px solid var(--cz6jod1-0);border-radius:6px;background-color:var(--cz6jod1-1);pointer-events:none;text-align:center;}
|
|
43
|
+
.c1de5mqk{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:var(--c1de5mqk-0);-ms-flex-direction:var(--c1de5mqk-0);flex-direction:var(--c1de5mqk-0);-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-align-items:var(--c1de5mqk-1);-webkit-box-align:var(--c1de5mqk-1);-ms-flex-align:var(--c1de5mqk-1);align-items:var(--c1de5mqk-1);-webkit-box-pack:var(--c1de5mqk-2);-ms-flex-pack:var(--c1de5mqk-2);-webkit-justify-content:var(--c1de5mqk-2);justify-content:var(--c1de5mqk-2);gap:var(--c1de5mqk-3);width:var(--c1de5mqk-4);min-width:var(--c1de5mqk-5);height:var(--c1de5mqk-6);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;padding-top:var(--c1de5mqk-7);padding-left:var(--c1de5mqk-8);}
|
|
44
|
+
.cjirv6a{position:absolute;visibility:hidden;pointer-events:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:var(--cjirv6a-0);-ms-flex-direction:var(--cjirv6a-0);flex-direction:var(--cjirv6a-0);-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-align-items:var(--cjirv6a-1);-webkit-box-align:var(--cjirv6a-1);-ms-flex-align:var(--cjirv6a-1);align-items:var(--cjirv6a-1);gap:var(--cjirv6a-2);width:-webkit-max-content;width:-moz-max-content;width:max-content;height:-webkit-max-content;height:-moz-max-content;height:max-content;white-space:nowrap;}
|
|
45
|
+
.c1armna5{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:8px;max-height:208px;overflow-y:auto;}
|
|
46
|
+
.cgd77rv{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;cursor:default;border-radius:2px;opacity:1;}.cgd77rv[data-state="muted"]{opacity:0.1;}.cgd77rv:focus-visible{outline:1.5px solid currentColor;outline-offset:2px;}
|
|
47
|
+
.cutidpi{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;opacity:1;}.cutidpi[data-state="muted"]{opacity:0.1;}
|
|
49
48
|
.cmbdg2q{width:var(--cmbdg2q-0);height:var(--cmbdg2q-0);border-radius:50%;background-color:var(--cmbdg2q-1);}
|
|
50
49
|
.tbnx4ok{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
|
51
50
|
.tjda4tq{display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content;padding:var(--tjda4tq-0);background-color:var(--tjda4tq-1);border:var(--tjda4tq-2);border-radius:5px;}
|
|
@@ -2,5 +2,12 @@ import { type InfiniteSpreadsheetProps } from "./types";
|
|
|
2
2
|
export { ColumnAlign, ColumnPin, ColumnResizeMode, TableDensity, TableVariant } from "./types";
|
|
3
3
|
export type { ColumnSizingState, EditingCell, InfiniteSpreadsheetProps, Row, SpreadsheetColumnAction, SpreadsheetColumnDef, SpreadsheetHeaderAction, SpreadsheetRowAction, SpreadsheetRowsContext, } from "./types";
|
|
4
4
|
export { CellEnrichmentStatus, SpreadsheetCellType } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* An editable grid — cell-level editing, keyboard navigation between cells, and
|
|
7
|
+
* per-row actions, over the same infinite-scroll machinery as `InfiniteTable`.
|
|
8
|
+
*
|
|
9
|
+
* Reach for this when cells are inputs. When the data is read-only, the tables
|
|
10
|
+
* are lighter.
|
|
11
|
+
*/
|
|
5
12
|
declare function InfiniteSpreadsheet<TData>(props: InfiniteSpreadsheetProps<TData>): import("react").JSX.Element;
|
|
6
13
|
export default InfiniteSpreadsheet;
|
|
@@ -18,6 +18,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
import { PlusIcon } from "@phosphor-icons/react";
|
|
19
19
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
20
20
|
//#region src/table/InfiniteSpreadsheet.tsx
|
|
21
|
+
/**
|
|
22
|
+
* An editable grid — cell-level editing, keyboard navigation between cells, and
|
|
23
|
+
* per-row actions, over the same infinite-scroll machinery as `InfiniteTable`.
|
|
24
|
+
*
|
|
25
|
+
* Reach for this when cells are inputs. When the data is read-only, the tables
|
|
26
|
+
* are lighter.
|
|
27
|
+
*/
|
|
21
28
|
function InfiniteSpreadsheet(props) {
|
|
22
29
|
const { columns, totalRowCount, getRowData, getRowId, height, width, fillWidth, fillHeight, density = TableDensity.MEDIUM, variant = TableVariant.PRIMARY, estimateRowHeight, overscan = 25, hasNextPage, isFetchingNextPage, fetchNextPage, isLoading = false, isError = false, error, loadingRowCount = 5, contentWhenEmpty, contentWhenError, noHeader = false, noLastRowBorder = false, noLastRowPadding = false, enableColumnResizing = true, columnSizing, defaultColumnSizing, onColumnSizingChange, columnResizeMode = ColumnResizeMode.ON_CHANGE, ariaLabel, ariaLabelledBy, onAddColumn, addColumnAriaLabel = "Add column", rowActions, getRowActionsAriaLabel, editingCell: controlledEditingCell, onEditingCellChange, enableRowFocus = true } = props;
|
|
23
30
|
const scrollContainerRef = useRef(null);
|
|
@@ -4,6 +4,14 @@ import { type InfiniteTableProps } from "./types";
|
|
|
4
4
|
export { ColumnAlign, ColumnPin, ColumnResizeMode, TableDensity, TableVariant } from "./types";
|
|
5
5
|
export type { ColumnDef, ColumnSizingState, EstimateColumnWidthOptions, InfiniteTableProps, Row, } from "./types";
|
|
6
6
|
export { estimateColumnWidth } from "./utils";
|
|
7
|
+
/**
|
|
8
|
+
* A data table with infinite scroll, sorting, row selection, expandable rows and
|
|
9
|
+
* resizable columns. Define the shape with `ColumnDef[]`; `TData` is inferred
|
|
10
|
+
* from your row type.
|
|
11
|
+
*
|
|
12
|
+
* Renders every loaded row. Past a few thousand rows reach for
|
|
13
|
+
* `VirtualizedInfiniteTable`, which shares the same column and row API.
|
|
14
|
+
*/
|
|
7
15
|
declare function InfiniteTable<TData>(props: InfiniteTableProps<TData>): React.JSX.Element;
|
|
8
16
|
export default InfiniteTable;
|
|
9
17
|
export type { TanstackTable as Table };
|
|
@@ -18,6 +18,14 @@ import React, { useCallback, useEffect, useId, useMemo, useRef } from "react";
|
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { flexRender, getCoreRowModel, getExpandedRowModel, getSortedRowModel, useReactTable } from "@tanstack/react-table";
|
|
20
20
|
//#region src/table/InfiniteTable.tsx
|
|
21
|
+
/**
|
|
22
|
+
* A data table with infinite scroll, sorting, row selection, expandable rows and
|
|
23
|
+
* resizable columns. Define the shape with `ColumnDef[]`; `TData` is inferred
|
|
24
|
+
* from your row type.
|
|
25
|
+
*
|
|
26
|
+
* Renders every loaded row. Past a few thousand rows reach for
|
|
27
|
+
* `VirtualizedInfiniteTable`, which shares the same column and row API.
|
|
28
|
+
*/
|
|
21
29
|
function InfiniteTable(props) {
|
|
22
30
|
const { columns, data, getRowId, height, width, fillWidth, fillHeight, density = TableDensity.MEDIUM, variant = TableVariant.PRIMARY, hasNextPage, isFetchingNextPage, fetchNextPage, enableRowSelection, enableMultiRowSelection = true, rowSelection, defaultRowSelection, onRowSelectionChange, onSelectedRowsChange, showSelectionColumn = false, selectionColumnPin = ColumnPin.LEFT, enableSelectAll, enableSelectionRange = true, selectAllAriaLabel = "Select all rows", getRowSelectAriaLabel, enableSorting = false, enableMultiSort = false, sorting, onSortingChange, manualSorting = false, isLoading = false, isError = false, error, loadingRowCount = 5, contentWhenEmpty, contentWhenError, noHeader = false, noLastRowBorder = false, noLastRowPadding = false, onRowClick, onRowDoubleClick, onRowActivate, onRowExpand, expandedRowIds, defaultExpandedRowIds, onExpandedChange, getRowCanExpand, enableMultiRowExpansion = true, showExpandColumn = true, expandColumnPin = ColumnPin.LEFT, enableColumnResizing = false, columnSizing, defaultColumnSizing, onColumnSizingChange, columnResizeMode = ColumnResizeMode.ON_CHANGE, ariaLabel, ariaLabelledBy, getRowAriaLabel, enableRowFocus, onTableReady } = props;
|
|
23
31
|
const instanceId = useId();
|
|
@@ -8,5 +8,12 @@ export type { ColumnDef, ColumnSizingState, Row, VirtualizedInfiniteTableProps }
|
|
|
8
8
|
* resolves.
|
|
9
9
|
*/
|
|
10
10
|
export type InfiniteTableProps<TData> = VirtualizedInfiniteTableProps<TData>;
|
|
11
|
+
/**
|
|
12
|
+
* `InfiniteTable` with row virtualization — only the visible window is in the
|
|
13
|
+
* DOM, so it stays responsive at tens of thousands of rows.
|
|
14
|
+
*
|
|
15
|
+
* The trade is a fixed row height and no natural content sizing. Prefer plain
|
|
16
|
+
* `InfiniteTable` until row count actually becomes the problem.
|
|
17
|
+
*/
|
|
11
18
|
declare function VirtualizedInfiniteTable<TData>(props: VirtualizedInfiniteTableProps<TData>): React.JSX.Element;
|
|
12
19
|
export default VirtualizedInfiniteTable;
|
|
@@ -42,6 +42,13 @@ function VirtualizedRowInner({ rowData, rowIndex, translateY, rowHeight, density
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
var VirtualizedRow = React.memo(VirtualizedRowInner);
|
|
45
|
+
/**
|
|
46
|
+
* `InfiniteTable` with row virtualization — only the visible window is in the
|
|
47
|
+
* DOM, so it stays responsive at tens of thousands of rows.
|
|
48
|
+
*
|
|
49
|
+
* The trade is a fixed row height and no natural content sizing. Prefer plain
|
|
50
|
+
* `InfiniteTable` until row count actually becomes the problem.
|
|
51
|
+
*/
|
|
45
52
|
function VirtualizedInfiniteTable(props) {
|
|
46
53
|
const { columns, totalRowCount, getRowData, getRowId, height, width, fillWidth, fillHeight, density = TableDensity.MEDIUM, variant = TableVariant.PRIMARY, estimateRowHeight, overscan = 25, hasNextPage, isFetchingNextPage, fetchNextPage, isLoading = false, isError = false, error, loadingRowCount = 5, contentWhenEmpty, contentWhenError, noHeader = false, noLastRowBorder = false, noLastRowPadding = false, enableColumnResizing = false, columnSizing, defaultColumnSizing, onColumnSizingChange, columnResizeMode = ColumnResizeMode.ON_CHANGE, ariaLabel, ariaLabelledBy, onRowClick } = props;
|
|
47
54
|
const scrollContainerRef = useRef(null);
|
package/dist/text/Bold.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Bumps its children to the medium weight. Nest it inside a `Text` to emphasize
|
|
4
|
+
* part of a string — DLS has only two weights, so this is as bold as type gets.
|
|
5
|
+
*/
|
|
2
6
|
declare const Bold: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
3
7
|
export default Bold;
|
package/dist/text/Bold.js
CHANGED
|
@@ -10,6 +10,10 @@ var StyledBoldText = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
10
10
|
propsAsIs: false,
|
|
11
11
|
vars: { "s10i74tu-0": [_exp()] }
|
|
12
12
|
}));
|
|
13
|
+
/**
|
|
14
|
+
* Bumps its children to the medium weight. Nest it inside a `Text` to emphasize
|
|
15
|
+
* part of a string — DLS has only two weights, so this is as bold as type gets.
|
|
16
|
+
*/
|
|
13
17
|
var Bold = ({ children }) => {
|
|
14
18
|
return /* @__PURE__ */ jsx(StyledBoldText, { children });
|
|
15
19
|
};
|
package/dist/text/Code.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Inline code — mono family on a tinted, hairline-bordered chip. Nest it inside
|
|
4
|
+
* a `Text` for identifiers and literals in prose.
|
|
5
|
+
*/
|
|
2
6
|
declare const Code: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
3
7
|
export default Code;
|
package/dist/text/Code.js
CHANGED
|
@@ -20,6 +20,10 @@ var StyledCodeText = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
20
20
|
"sdpyy92-4": [_exp5()]
|
|
21
21
|
}
|
|
22
22
|
}));
|
|
23
|
+
/**
|
|
24
|
+
* Inline code — mono family on a tinted, hairline-bordered chip. Nest it inside
|
|
25
|
+
* a `Text` for identifiers and literals in prose.
|
|
26
|
+
*/
|
|
23
27
|
var Code = ({ children }) => {
|
|
24
28
|
return /* @__PURE__ */ jsx(StyledCodeText, { children });
|
|
25
29
|
};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { type TextProps } from "./Text";
|
|
2
|
-
type EditableTextProps = TextProps & {
|
|
2
|
+
export type EditableTextProps = TextProps & {
|
|
3
|
+
/** Current text. Also the value the field resets to on cancel. */
|
|
3
4
|
label: string;
|
|
5
|
+
/** Called with the new text when the edit is committed. */
|
|
4
6
|
onSave: (text: string) => void;
|
|
5
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Click-to-edit text. Renders as `Text` until clicked, then swaps to an inline
|
|
10
|
+
* input. Accepts every `TextProps` styling prop on top of its own.
|
|
11
|
+
*
|
|
12
|
+
* Holds the draft internally and only calls `onSave` on commit, so it works as
|
|
13
|
+
* an uncontrolled field — `label` is the starting value, not a bound one.
|
|
14
|
+
*/
|
|
6
15
|
declare const EditableText: ({ label, onSave, size, variant, weight, align, isMonospace, ...textProps }: EditableTextProps) => import("react").JSX.Element;
|
|
7
16
|
export default EditableText;
|
|
@@ -50,6 +50,13 @@ var EditableTextText = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
50
50
|
propsAsIs: false,
|
|
51
51
|
vars: { "e1j2x5d3-0": [_exp9()] }
|
|
52
52
|
}));
|
|
53
|
+
/**
|
|
54
|
+
* Click-to-edit text. Renders as `Text` until clicked, then swaps to an inline
|
|
55
|
+
* input. Accepts every `TextProps` styling prop on top of its own.
|
|
56
|
+
*
|
|
57
|
+
* Holds the draft internally and only calls `onSave` on commit, so it works as
|
|
58
|
+
* an uncontrolled field — `label` is the starting value, not a bound one.
|
|
59
|
+
*/
|
|
53
60
|
var EditableText = ({ label, onSave, size = TextSize.BODY_MD, variant = TextVariant.PRIMARY, weight = TextWeight.REGULAR, align = "left", isMonospace = false, ...textProps }) => {
|
|
54
61
|
const [state, setState] = useState(() => ({
|
|
55
62
|
localLabel: label,
|
package/dist/text/Ellipsis.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export interface EllipsisProps {
|
|
2
|
+
/** Animate the dots. Static when false. */
|
|
2
3
|
isPulse?: boolean;
|
|
3
|
-
/**
|
|
4
|
-
* The speed of the pulse animation in seconds.
|
|
5
|
-
* @default 1.4
|
|
6
|
-
*/
|
|
4
|
+
/** Duration of one pulse cycle in seconds. @default 1 */
|
|
7
5
|
speed?: number;
|
|
8
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Three dots that pulse in sequence — the "…thinking" affordance. Renders the
|
|
9
|
+
* literal characters, so it aligns with adjacent text rather than a spinner.
|
|
10
|
+
*/
|
|
9
11
|
declare const Ellipsis: ({ isPulse, speed }: EllipsisProps) => import("react").JSX.Element;
|
|
10
12
|
export default Ellipsis;
|
package/dist/text/Ellipsis.js
CHANGED
|
@@ -13,6 +13,10 @@ var StyledEllipsis = /*#__PURE__*/ styled("span")({
|
|
|
13
13
|
"szfsuud-1": [_exp2()]
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
/**
|
|
17
|
+
* Three dots that pulse in sequence — the "…thinking" affordance. Renders the
|
|
18
|
+
* literal characters, so it aligns with adjacent text rather than a spinner.
|
|
19
|
+
*/
|
|
16
20
|
var Ellipsis = ({ isPulse = false, speed = 1 }) => {
|
|
17
21
|
return /* @__PURE__ */ jsxs(StyledEllipsis, {
|
|
18
22
|
$isPulse: isPulse,
|
package/dist/text/HotKeys.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Key-cap contrast. Step it down when the shortcut is secondary to its label. */
|
|
1
2
|
export declare enum HotKeysVariant {
|
|
2
3
|
BASE = "BASE",
|
|
3
4
|
PRIMARY = "PRIMARY",
|
|
@@ -5,16 +6,25 @@ export declare enum HotKeysVariant {
|
|
|
5
6
|
TERTIARY = "TERTIARY",
|
|
6
7
|
DISABLED = "DISABLED"
|
|
7
8
|
}
|
|
9
|
+
/** Key-cap size — 14 / 16 / 18px minimum width. Match the adjacent text. */
|
|
8
10
|
export declare enum HotKeysSize {
|
|
9
11
|
SMALL = "SMALL",
|
|
10
12
|
MEDIUM = "MEDIUM",
|
|
11
13
|
LARGE = "LARGE"
|
|
12
14
|
}
|
|
13
15
|
export interface HotKeysProps {
|
|
16
|
+
/** One cap per entry, in press order — e.g. `["⌘", "K"]`. Rendered verbatim. */
|
|
14
17
|
hotKeys: string[];
|
|
18
|
+
/** @default HotKeysVariant.BASE */
|
|
15
19
|
variant?: HotKeysVariant;
|
|
20
|
+
/** @default HotKeysSize.MEDIUM */
|
|
16
21
|
size?: HotKeysSize;
|
|
22
|
+
/** Render caps in the mono family. */
|
|
17
23
|
isMonospace?: boolean;
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Renders a keyboard shortcut as a row of key caps. Display only — it does not
|
|
27
|
+
* bind anything; wire the actual handler yourself.
|
|
28
|
+
*/
|
|
19
29
|
declare const HotKeys: ({ hotKeys, variant, size, isMonospace, }: HotKeysProps) => import("react").JSX.Element;
|
|
20
30
|
export default HotKeys;
|
package/dist/text/HotKeys.js
CHANGED
|
@@ -4,6 +4,7 @@ import { styled } from "@linaria/react";
|
|
|
4
4
|
import { match } from "ts-pattern";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/text/HotKeys.tsx
|
|
7
|
+
/** Key-cap contrast. Step it down when the shortcut is secondary to its label. */
|
|
7
8
|
var HotKeysVariant = /* @__PURE__ */ function(HotKeysVariant) {
|
|
8
9
|
HotKeysVariant["BASE"] = "BASE";
|
|
9
10
|
HotKeysVariant["PRIMARY"] = "PRIMARY";
|
|
@@ -12,6 +13,7 @@ var HotKeysVariant = /* @__PURE__ */ function(HotKeysVariant) {
|
|
|
12
13
|
HotKeysVariant["DISABLED"] = "DISABLED";
|
|
13
14
|
return HotKeysVariant;
|
|
14
15
|
}({});
|
|
16
|
+
/** Key-cap size — 14 / 16 / 18px minimum width. Match the adjacent text. */
|
|
15
17
|
var HotKeysSize = /* @__PURE__ */ function(HotKeysSize) {
|
|
16
18
|
HotKeysSize["SMALL"] = "SMALL";
|
|
17
19
|
HotKeysSize["MEDIUM"] = "MEDIUM";
|
|
@@ -56,6 +58,10 @@ var StyledHotKey = withTheme(/*#__PURE__*/ styled("div")({
|
|
|
56
58
|
"sl247mt-7": [_exp9()]
|
|
57
59
|
}
|
|
58
60
|
}));
|
|
61
|
+
/**
|
|
62
|
+
* Renders a keyboard shortcut as a row of key caps. Display only — it does not
|
|
63
|
+
* bind anything; wire the actual handler yourself.
|
|
64
|
+
*/
|
|
59
65
|
var HotKeys = ({ hotKeys, variant, size = "MEDIUM", isMonospace = false }) => {
|
|
60
66
|
return /* @__PURE__ */ jsx(HotKeysWrapper, { children: hotKeys.map((hotKey) => /* @__PURE__ */ jsx(StyledHotKey, {
|
|
61
67
|
$variant: variant,
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { type Components } from "react-markdown";
|
|
2
|
-
interface MarkdownTextProps {
|
|
2
|
+
export interface MarkdownTextProps {
|
|
3
|
+
/** Markdown source. GitHub-flavored, and raw HTML is allowed through. */
|
|
3
4
|
content: string;
|
|
5
|
+
/** Replace the renderer for specific tags. Merged over the DLS defaults. */
|
|
4
6
|
componentOverrides?: Partial<Components>;
|
|
5
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders Markdown using DLS components — headings, lists, tables and code all
|
|
10
|
+
* come out on theme tokens rather than browser defaults.
|
|
11
|
+
*
|
|
12
|
+
* Raw HTML in `content` is rendered, not escaped. Don't pass untrusted input.
|
|
13
|
+
*/
|
|
6
14
|
declare const MarkdownText: ({ content, componentOverrides }: MarkdownTextProps) => import("react").JSX.Element;
|
|
7
15
|
export default MarkdownText;
|
|
@@ -297,6 +297,12 @@ var markdownComponents = {
|
|
|
297
297
|
children
|
|
298
298
|
})
|
|
299
299
|
};
|
|
300
|
+
/**
|
|
301
|
+
* Renders Markdown using DLS components — headings, lists, tables and code all
|
|
302
|
+
* come out on theme tokens rather than browser defaults.
|
|
303
|
+
*
|
|
304
|
+
* Raw HTML in `content` is rendered, not escaped. Don't pass untrusted input.
|
|
305
|
+
*/
|
|
300
306
|
var MarkdownText = ({ content, componentOverrides }) => {
|
|
301
307
|
const components = componentOverrides ? {
|
|
302
308
|
...markdownComponents,
|
package/dist/text/Paragraph.d.ts
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import type { CSSProperties, PropsWithChildren } from "react";
|
|
2
2
|
import { TextSize, TextVariant, TextWeight } from "./Text";
|
|
3
3
|
export interface ParagraphProps {
|
|
4
|
+
/** Color role. @default TextVariant.PRIMARY */
|
|
4
5
|
variant?: TextVariant;
|
|
6
|
+
/** Type scale step. @default TextSize.BODY_MD */
|
|
5
7
|
size?: TextSize;
|
|
8
|
+
/** @default TextWeight.REGULAR */
|
|
6
9
|
weight?: TextWeight;
|
|
10
|
+
/** @default "left" */
|
|
7
11
|
align?: CSSProperties["textAlign"];
|
|
12
|
+
/** Cursor over the text. Inherits from the parent when unset. */
|
|
8
13
|
cursor?: CSSProperties["cursor"];
|
|
14
|
+
/** Raw color that bypasses `variant`. Escape hatch — prefer `variant`. */
|
|
9
15
|
hex?: string;
|
|
16
|
+
/** Render in the mono family (Berkeley Mono) instead of sans. */
|
|
10
17
|
isMonospace?: boolean;
|
|
18
|
+
/** Let the user select the text. Off by default so UI chrome isn't selectable. */
|
|
11
19
|
isSelectable?: boolean;
|
|
20
|
+
/** Truncate after this many lines with an ellipsis. Omit to let it run. */
|
|
12
21
|
lineClamp?: number;
|
|
22
|
+
/** Reserve height so clamped copy doesn't shift layout. Defaults to `lineClamp` em. */
|
|
13
23
|
minHeight?: string;
|
|
14
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Multi-line body copy. Same tokens as `Text`, but with a 1.25× line height for
|
|
27
|
+
* readability and `lineClamp` instead of single-line ellipsis.
|
|
28
|
+
*
|
|
29
|
+
* Use `Text` for labels and single-line UI strings; reach for this when the copy
|
|
30
|
+
* is a real paragraph.
|
|
31
|
+
*/
|
|
15
32
|
declare const Paragraph: ({ children, size, variant, weight, align, cursor, isMonospace, isSelectable, lineClamp, minHeight, hex, }: PropsWithChildren<ParagraphProps>) => import("react").JSX.Element;
|
|
16
33
|
export default Paragraph;
|
package/dist/text/Paragraph.js
CHANGED
|
@@ -57,6 +57,13 @@ var StyledParagraph = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
57
57
|
"sts1mtj-14": [_exp16()]
|
|
58
58
|
}
|
|
59
59
|
}));
|
|
60
|
+
/**
|
|
61
|
+
* Multi-line body copy. Same tokens as `Text`, but with a 1.25× line height for
|
|
62
|
+
* readability and `lineClamp` instead of single-line ellipsis.
|
|
63
|
+
*
|
|
64
|
+
* Use `Text` for labels and single-line UI strings; reach for this when the copy
|
|
65
|
+
* is a real paragraph.
|
|
66
|
+
*/
|
|
60
67
|
var Paragraph = ({ children, size = TextSize.BODY_MD, variant = TextVariant.PRIMARY, weight = TextWeight.REGULAR, align = "left", cursor, isMonospace = false, isSelectable = false, lineClamp, minHeight, hex }) => {
|
|
61
68
|
return /* @__PURE__ */ jsx(StyledParagraph, {
|
|
62
69
|
$size: size,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { TextSize } from "./Text";
|
|
2
|
-
interface RequiredMarkerProps {
|
|
2
|
+
export interface RequiredMarkerProps {
|
|
3
|
+
/** Match the size of the label it sits beside. @default TextSize.BODY_MD */
|
|
3
4
|
size?: TextSize;
|
|
4
5
|
}
|
|
6
|
+
/** The red asterisk marking a required field. Inputs render it from `isRequired`. */
|
|
5
7
|
declare const RequiredMarker: ({ size }: RequiredMarkerProps) => import("react").JSX.Element;
|
|
6
8
|
export default RequiredMarker;
|
|
@@ -34,6 +34,7 @@ var StyledRequiredMarker = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
34
34
|
"s1i18c6k-5": [_exp6()]
|
|
35
35
|
}
|
|
36
36
|
}));
|
|
37
|
+
/** The red asterisk marking a required field. Inputs render it from `isRequired`. */
|
|
37
38
|
var RequiredMarker = ({ size = TextSize.BODY_MD }) => {
|
|
38
39
|
return /* @__PURE__ */ jsx(StyledRequiredMarker, {
|
|
39
40
|
$size: size,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import type { PropsWithChildren } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Makes its children selectable. DLS text is `user-select: none` by default so
|
|
4
|
+
* UI chrome doesn't highlight — wrap the parts a user should be able to copy.
|
|
5
|
+
*/
|
|
2
6
|
declare const Selectable: ({ children }: PropsWithChildren) => import("react").JSX.Element;
|
|
3
7
|
export default Selectable;
|
package/dist/text/Selectable.js
CHANGED
|
@@ -8,6 +8,10 @@ var StyledSelectable = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
8
8
|
class: "sfziwh",
|
|
9
9
|
propsAsIs: false
|
|
10
10
|
}));
|
|
11
|
+
/**
|
|
12
|
+
* Makes its children selectable. DLS text is `user-select: none` by default so
|
|
13
|
+
* UI chrome doesn't highlight — wrap the parts a user should be able to copy.
|
|
14
|
+
*/
|
|
11
15
|
var Selectable = ({ children }) => {
|
|
12
16
|
return /* @__PURE__ */ jsx(StyledSelectable, { children });
|
|
13
17
|
};
|
package/dist/text/Text.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties, PropsWithChildren } from "react";
|
|
2
|
+
/** Text color role. Resolves to a `theme.color.text.*` token in both themes. */
|
|
2
3
|
export declare enum TextVariant {
|
|
3
4
|
PRIMARY = "PRIMARY",
|
|
4
5
|
PRIMARY_ALT = "PRIMARY_ALT",
|
|
@@ -18,6 +19,7 @@ export declare enum TextVariant {
|
|
|
18
19
|
PURPLE = "PURPLE",
|
|
19
20
|
DISABLED = "DISABLED"
|
|
20
21
|
}
|
|
22
|
+
/** Type scale step. Sets font-size, line-height and letter-spacing together. */
|
|
21
23
|
export declare enum TextSize {
|
|
22
24
|
CAPTION = "CAPTION",
|
|
23
25
|
BODY_SM = "BODY_SM",
|
|
@@ -27,21 +29,38 @@ export declare enum TextSize {
|
|
|
27
29
|
HEADING_MD = "HEADING_MD",
|
|
28
30
|
HEADING_LG = "HEADING_LG"
|
|
29
31
|
}
|
|
32
|
+
/** Font weight. Two steps by design — hierarchy comes from size, not weight. */
|
|
30
33
|
export declare enum TextWeight {
|
|
31
34
|
REGULAR = "REGULAR",
|
|
32
35
|
MEDIUM = "MEDIUM"
|
|
33
36
|
}
|
|
34
37
|
export interface TextProps {
|
|
38
|
+
/** Color role. @default TextVariant.PRIMARY */
|
|
35
39
|
variant?: TextVariant;
|
|
40
|
+
/** Type scale step. @default TextSize.BODY_MD */
|
|
36
41
|
size?: TextSize;
|
|
42
|
+
/** @default TextWeight.REGULAR */
|
|
37
43
|
weight?: TextWeight;
|
|
44
|
+
/** @default "left" */
|
|
38
45
|
align?: CSSProperties["textAlign"];
|
|
46
|
+
/** Cursor over the text. Inherits from the parent when unset. */
|
|
39
47
|
cursor?: CSSProperties["cursor"];
|
|
48
|
+
/** Raw color that bypasses `variant`. Escape hatch — prefer `variant`. */
|
|
40
49
|
hex?: string;
|
|
50
|
+
/** Render in the mono family (Berkeley Mono) instead of sans. */
|
|
41
51
|
isMonospace?: boolean;
|
|
52
|
+
/** Let the user select the text. Off by default so UI chrome isn't selectable. */
|
|
42
53
|
isSelectable?: boolean;
|
|
43
54
|
isUnderlined?: boolean;
|
|
55
|
+
/** Truncate to one line with an ellipsis. Needs a width-bounded parent. */
|
|
44
56
|
isEllipsis?: boolean;
|
|
45
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* The text primitive. Every string in a Galaxy UI renders through it, so color,
|
|
60
|
+
* size and weight always resolve from theme tokens rather than raw CSS.
|
|
61
|
+
*
|
|
62
|
+
* Renders a `<p>`. For inline treatments nest `Bold`, `Code`, `Selectable` or
|
|
63
|
+
* `HotKeys` inside it rather than reaching for a raw tag.
|
|
64
|
+
*/
|
|
46
65
|
declare const Text: ({ children, size, variant, weight, align, cursor, isMonospace, isSelectable, isUnderlined, isEllipsis, hex, }: PropsWithChildren<TextProps>) => import("react").JSX.Element;
|
|
47
66
|
export default Text;
|
package/dist/text/Text.js
CHANGED
|
@@ -4,6 +4,7 @@ import { styled } from "@linaria/react";
|
|
|
4
4
|
import { match } from "ts-pattern";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/text/Text.tsx
|
|
7
|
+
/** Text color role. Resolves to a `theme.color.text.*` token in both themes. */
|
|
7
8
|
var TextVariant = /* @__PURE__ */ function(TextVariant) {
|
|
8
9
|
TextVariant["PRIMARY"] = "PRIMARY";
|
|
9
10
|
TextVariant["PRIMARY_ALT"] = "PRIMARY_ALT";
|
|
@@ -24,6 +25,7 @@ var TextVariant = /* @__PURE__ */ function(TextVariant) {
|
|
|
24
25
|
TextVariant["DISABLED"] = "DISABLED";
|
|
25
26
|
return TextVariant;
|
|
26
27
|
}({});
|
|
28
|
+
/** Type scale step. Sets font-size, line-height and letter-spacing together. */
|
|
27
29
|
var TextSize = /* @__PURE__ */ function(TextSize) {
|
|
28
30
|
TextSize["CAPTION"] = "CAPTION";
|
|
29
31
|
TextSize["BODY_SM"] = "BODY_SM";
|
|
@@ -34,6 +36,7 @@ var TextSize = /* @__PURE__ */ function(TextSize) {
|
|
|
34
36
|
TextSize["HEADING_LG"] = "HEADING_LG";
|
|
35
37
|
return TextSize;
|
|
36
38
|
}({});
|
|
39
|
+
/** Font weight. Two steps by design — hierarchy comes from size, not weight. */
|
|
37
40
|
var TextWeight = /* @__PURE__ */ function(TextWeight) {
|
|
38
41
|
TextWeight["REGULAR"] = "REGULAR";
|
|
39
42
|
TextWeight["MEDIUM"] = "MEDIUM";
|
|
@@ -85,6 +88,13 @@ var StyledText = withTheme(/*#__PURE__*/ styled("p")({
|
|
|
85
88
|
"shbcgkd-13": [_exp15()]
|
|
86
89
|
}
|
|
87
90
|
}));
|
|
91
|
+
/**
|
|
92
|
+
* The text primitive. Every string in a Galaxy UI renders through it, so color,
|
|
93
|
+
* size and weight always resolve from theme tokens rather than raw CSS.
|
|
94
|
+
*
|
|
95
|
+
* Renders a `<p>`. For inline treatments nest `Bold`, `Code`, `Selectable` or
|
|
96
|
+
* `HotKeys` inside it rather than reaching for a raw tag.
|
|
97
|
+
*/
|
|
88
98
|
var Text = ({ children, size = "BODY_MD", variant = "PRIMARY", weight = "REGULAR", align = "left", cursor, isMonospace = false, isSelectable = false, isUnderlined = false, isEllipsis = false, hex }) => {
|
|
89
99
|
return /* @__PURE__ */ jsx(StyledText, {
|
|
90
100
|
$size: size,
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export interface TextShimmerProps {
|
|
2
|
+
/** A number is px. Match the line height of the text being stood in for. */
|
|
2
3
|
height: number | string;
|
|
4
|
+
/** A number is px. */
|
|
3
5
|
width: number | string;
|
|
6
|
+
/** Render square corners instead of the default 4px radius. */
|
|
4
7
|
noBorderRadius?: boolean;
|
|
5
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A shimmering placeholder bar for text that hasn't loaded. Size it to the copy
|
|
11
|
+
* it replaces so the layout doesn't jump when the real text arrives.
|
|
12
|
+
*/
|
|
6
13
|
declare const TextShimmer: ({ height, width, noBorderRadius }: TextShimmerProps) => import("react").JSX.Element;
|
|
7
14
|
export default TextShimmer;
|
package/dist/text/TextShimmer.js
CHANGED
|
@@ -19,6 +19,10 @@ var StyledTextShimmer = withTheme(/*#__PURE__*/ styled("span")({
|
|
|
19
19
|
"s1p67zkf-3": [_exp6()]
|
|
20
20
|
}
|
|
21
21
|
}));
|
|
22
|
+
/**
|
|
23
|
+
* A shimmering placeholder bar for text that hasn't loaded. Size it to the copy
|
|
24
|
+
* it replaces so the layout doesn't jump when the real text arrives.
|
|
25
|
+
*/
|
|
22
26
|
var TextShimmer = ({ height, width, noBorderRadius }) => {
|
|
23
27
|
return /* @__PURE__ */ jsx(StyledTextShimmer, {
|
|
24
28
|
$height: height,
|