@splunk/react-ui 5.3.0 → 5.5.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/Accordion.js +31 -31
- package/Avatar.js +13 -13
- package/Badge.js +154 -0
- package/Breadcrumbs.js +66 -63
- package/ButtonSimple.js +52 -52
- package/CHANGELOG.md +43 -0
- package/CardLayout.js +39 -36
- package/Clickable.js +5 -6
- package/Code.js +917 -424
- package/CollapsiblePanel.js +1 -1
- package/Color.js +904 -1025
- package/ComboBox.js +6 -5
- package/DefinitionList.js +1 -1
- package/FormRows.js +13 -11
- package/JSONTree.js +682 -1408
- package/Link.js +74 -44
- package/MIGRATION.md +32 -1
- package/Markdown.js +9 -5
- package/Menu.js +100 -97
- package/Multiselect.js +1223 -2858
- package/Number.js +3 -3
- package/PhoneNumber.d.ts +2 -0
- package/PhoneNumber.js +769 -0
- package/Popover.js +235 -232
- package/RadioList.js +166 -151
- package/Resize.js +11 -8
- package/ResultsMenu.js +911 -1030
- package/ScreenReaderContent.js +86 -130
- package/Scroll.js +366 -425
- package/Select.js +267 -1947
- package/SelectBase.d.ts +2 -0
- package/SelectBase.js +1681 -0
- package/Slider.js +202 -199
- package/SlidingPanels.js +170 -175
- package/StepBar.js +123 -97
- package/Switch.js +137 -118
- package/TabBar.js +296 -295
- package/TabLayout.js +14 -14
- package/Table.js +1562 -1516
- package/TextArea.js +596 -684
- package/TransitionOpen.js +82 -74
- package/Tree.js +638 -682
- package/docker-compose.yml +99 -52
- package/package.json +16 -12
- package/stubs-splunkui.d.ts +0 -86
- package/test-runner-jest.config.js +1 -0
- package/types/src/Badge/Badge.d.ts +29 -0
- package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
- package/types/src/Badge/docs/examples/Count.d.ts +6 -0
- package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
- package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
- package/types/src/Badge/index.d.ts +2 -0
- package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
- package/types/src/Breadcrumbs/Item.d.ts +1 -1
- package/types/src/ButtonSimple/mixin.d.ts +1 -1
- package/types/src/Code/Code.d.ts +4 -3
- package/types/src/Code/index.d.ts +1 -0
- package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
- package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/LinkContext.d.ts +14 -0
- package/types/src/Link/docs/examples/Visited.d.ts +7 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Modal/ModalContext.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +3 -3
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/Multiselect/Normal.d.ts +2 -2
- package/types/src/Number/utils.d.ts +1 -1
- package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
- package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/PhoneNumber/index.d.ts +2 -0
- package/types/src/PhoneNumber/utils.d.ts +47 -0
- package/types/src/Popover/getPlacement.d.ts +1 -1
- package/types/src/RadioList/Option.d.ts +7 -2
- package/types/src/RadioList/RadioListContext.d.ts +1 -1
- package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
- package/types/src/Select/Option.d.ts +8 -3
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
- package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
- package/types/src/SelectBase/index.d.ts +2 -0
- package/types/src/StepBar/StepBar.d.ts +4 -1
- package/types/src/StepBar/StepBarContext.d.ts +1 -0
- package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
- package/types/src/Switch/Switch.d.ts +10 -1
- package/types/src/TabBar/Tab.d.ts +3 -1
- package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
- package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
- package/types/src/TabLayout/Panel.d.ts +2 -0
- package/types/src/Table/Body.d.ts +6 -1
- package/types/src/Table/Cell.d.ts +5 -1
- package/types/src/Table/Head.d.ts +6 -2
- package/types/src/Table/HeadCell.d.ts +5 -1
- package/types/src/Table/Row.d.ts +5 -1
- package/types/src/Table/Table.d.ts +21 -1
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
- package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
- package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
- package/types/src/Tree/TreeContext.d.ts +1 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
- package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
- package/useControlled.js +61 -97
- package/usePrevious.d.ts +2 -0
- package/usePrevious.js +30 -62
- package/useResizeObserver.js +71 -136
- package/useRovingFocus.js +96 -41
- /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/docker-compose.yml
CHANGED
|
@@ -1,53 +1,100 @@
|
|
|
1
1
|
services:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
2
|
+
prisma-storybook:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: ../../infra/visual-tests/Dockerfile.storybook
|
|
6
|
+
args:
|
|
7
|
+
port: 6007
|
|
8
|
+
storybookfolder: storybook-static-visual-prisma
|
|
9
|
+
workdir: /react-ui
|
|
10
|
+
command: npx http-server storybook-static-visual-prisma --port 6007
|
|
11
|
+
ports:
|
|
12
|
+
- '6007:6007'
|
|
13
|
+
enterprise-storybook:
|
|
14
|
+
build:
|
|
15
|
+
context: .
|
|
16
|
+
dockerfile: ../../infra/visual-tests/Dockerfile.storybook
|
|
17
|
+
args:
|
|
18
|
+
port: 6008
|
|
19
|
+
storybookfolder: storybook-static-visual-enterprise
|
|
20
|
+
workdir: /react-ui
|
|
21
|
+
command: npx http-server storybook-static-visual-enterprise --port 6008
|
|
22
|
+
ports:
|
|
23
|
+
- '6008:6008'
|
|
24
|
+
splunk-magnetic-storybook:
|
|
25
|
+
build:
|
|
26
|
+
context: .
|
|
27
|
+
dockerfile: ../../infra/visual-tests/Dockerfile.storybook
|
|
28
|
+
args:
|
|
29
|
+
port: 6009
|
|
30
|
+
storybookfolder: storybook-static-visual-splunk-magnetic
|
|
31
|
+
workdir: /react-ui
|
|
32
|
+
command: npx http-server storybook-static-visual-splunk-magnetic --port 6009
|
|
33
|
+
ports:
|
|
34
|
+
- '6009:6009'
|
|
35
|
+
prisma-visual-test:
|
|
36
|
+
build:
|
|
37
|
+
context: .
|
|
38
|
+
dockerfile: ../../infra/visual-tests/Dockerfile.visual
|
|
39
|
+
args:
|
|
40
|
+
workdir: /react-ui
|
|
41
|
+
env_file:
|
|
42
|
+
- ./.storybook-visual/config/.env.visual
|
|
43
|
+
environment:
|
|
44
|
+
- JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE=1
|
|
45
|
+
- JOB_BROWSER=${JOB_BROWSER}
|
|
46
|
+
working_dir: /react-ui
|
|
47
|
+
volumes:
|
|
48
|
+
- './src:/react-ui/src'
|
|
49
|
+
- './test-reports:/react-ui/test-reports'
|
|
50
|
+
# TODO(SUI-8236): can remove once webpack.test.config.js imports of infra/.config.js are removed as this won't be needed any longer (verify with no cache docker build something else didn't start using it though)
|
|
51
|
+
- '../../infra/.config.js:/infra/.config.js:ro'
|
|
52
|
+
- '../../infra/storybook/utils.js:/infra/storybook/utils.js:ro'
|
|
53
|
+
- '../../infra/visual-tests/orphaned-snapshot-check-reporter.js:/infra/visual-tests/orphaned-snapshot-check-reporter.js:ro'
|
|
54
|
+
depends_on:
|
|
55
|
+
- prisma-storybook
|
|
56
|
+
command: /bin/sh -c "npx wait-on http://prisma-storybook:6007 && yarn cache clean && yarn test-storybook -c .storybook-visual --browsers $${STORYBOOK_BROWSER} $${STORYBOOK_UPDATE_SNAPSHOT} $${STORYBOOK_MAX_WORKERS} --url http://prisma-storybook:6007 --no-index-json"
|
|
57
|
+
enterprise-visual-test:
|
|
58
|
+
build:
|
|
59
|
+
context: .
|
|
60
|
+
dockerfile: ../../infra/visual-tests/Dockerfile.visual
|
|
61
|
+
args:
|
|
62
|
+
workdir: /react-ui
|
|
63
|
+
env_file:
|
|
64
|
+
- ./.storybook-visual/config/.env.visual
|
|
65
|
+
environment:
|
|
66
|
+
- JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE=1
|
|
67
|
+
- JOB_BROWSER=${JOB_BROWSER}
|
|
68
|
+
working_dir: /react-ui
|
|
69
|
+
volumes:
|
|
70
|
+
- './src:/react-ui/src'
|
|
71
|
+
- './test-reports:/react-ui/test-reports'
|
|
72
|
+
# TODO(SUI-8236): can remove once webpack.test.config.js imports of infra/.config.js are removed as this won't be needed any longer (verify with no cache docker build something else didn't start using it though)
|
|
73
|
+
- '../../infra/.config.js:/infra/.config.js:ro'
|
|
74
|
+
- '../../infra/storybook/utils.js:/infra/storybook/utils.js:ro'
|
|
75
|
+
- '../../infra/visual-tests/orphaned-snapshot-check-reporter.js:/infra/visual-tests/orphaned-snapshot-check-reporter.js:ro'
|
|
76
|
+
depends_on:
|
|
77
|
+
- enterprise-storybook
|
|
78
|
+
command: /bin/sh -c "npx wait-on http://enterprise-storybook:6008 && yarn cache clean && yarn test-storybook -c .storybook-visual --browsers $${STORYBOOK_BROWSER} $${STORYBOOK_UPDATE_SNAPSHOT} $${STORYBOOK_MAX_WORKERS} --url http://enterprise-storybook:6008 --no-index-json"
|
|
79
|
+
splunk-magnetic-visual-test:
|
|
80
|
+
build:
|
|
81
|
+
context: .
|
|
82
|
+
dockerfile: ../../infra/visual-tests/Dockerfile.visual
|
|
83
|
+
args:
|
|
84
|
+
workdir: /react-ui
|
|
85
|
+
env_file:
|
|
86
|
+
- ./.storybook-visual/config/.env.visual
|
|
87
|
+
environment:
|
|
88
|
+
- JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE=1
|
|
89
|
+
- JOB_BROWSER=${JOB_BROWSER}
|
|
90
|
+
working_dir: /react-ui
|
|
91
|
+
volumes:
|
|
92
|
+
- './src:/react-ui/src'
|
|
93
|
+
- './test-reports:/react-ui/test-reports'
|
|
94
|
+
# TODO(SUI-8236): can remove once webpack.test.config.js imports of infra/.config.js are removed as this won't be needed any longer (verify with no cache docker build something else didn't start using it though)
|
|
95
|
+
- '../../infra/.config.js:/infra/.config.js:ro'
|
|
96
|
+
- '../../infra/storybook/utils.js:/infra/storybook/utils.js:ro'
|
|
97
|
+
- '../../infra/visual-tests/orphaned-snapshot-check-reporter.js:/infra/visual-tests/orphaned-snapshot-check-reporter.js:ro'
|
|
98
|
+
depends_on:
|
|
99
|
+
- splunk-magnetic-storybook
|
|
100
|
+
command: /bin/sh -c "npx wait-on http://splunk-magnetic-storybook:6009 && yarn cache clean && yarn test-storybook -c .storybook-visual --browsers $${STORYBOOK_BROWSER} $${STORYBOOK_UPDATE_SNAPSHOT} $${STORYBOOK_MAX_WORKERS} --url http://splunk-magnetic-storybook:6009 --no-index-json"
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/react-ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "Library of React components that implement the Splunk design language",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Splunk Inc.",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "cross-env NODE_ENV=production webpack && yarn types:build",
|
|
9
9
|
"docs": "NODE_ENV=production webpack --config docs.gen.webpack.config.js",
|
|
10
|
+
"docs:llm": "NODE_ENV=production webpack --config docs-llm.gen.webpack.config.js",
|
|
10
11
|
"docs:publish": "eval $(splunk-docs-package docs) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
|
|
11
12
|
"docs:publish:external": "eval $(splunk-docs-package docs-external --suffix=public) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
|
|
12
13
|
"docs:start": "INTERNAL=true webpack serve --config docs.gen.webpack.config.js",
|
|
@@ -44,28 +45,30 @@
|
|
|
44
45
|
"@dnd-kit/sortable": "^8.0.0",
|
|
45
46
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
47
|
"@react-spring/web": "^9.7.5",
|
|
47
|
-
"@splunk/react-icons": "^5.
|
|
48
|
-
"@splunk/themes": "^1.
|
|
49
|
-
"@splunk/ui-utils": "^1.
|
|
50
|
-
"decimal.js-light": "^2.
|
|
48
|
+
"@splunk/react-icons": "^5.5.0",
|
|
49
|
+
"@splunk/themes": "^1.4.0",
|
|
50
|
+
"@splunk/ui-utils": "^1.12.0",
|
|
51
|
+
"decimal.js-light": "^2.5.1",
|
|
52
|
+
"intl-tel-input": "^25.3.2",
|
|
51
53
|
"lodash": "^4.17.14",
|
|
52
54
|
"moment": "^2.29.4",
|
|
53
55
|
"prop-types": "^15.6.2",
|
|
54
56
|
"react-markdown": "^8.0.7",
|
|
55
57
|
"remark-gfm": "^1.0.0",
|
|
56
58
|
"tinycolor2": "^1.4.1",
|
|
59
|
+
"use-sync-external-store": "^1.6.0",
|
|
57
60
|
"use-typed-event-listener": "^3.0.0"
|
|
58
61
|
},
|
|
59
62
|
"devDependencies": {
|
|
60
63
|
"@babel/core": "^7.28.0",
|
|
61
64
|
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
62
65
|
"@splunk/babel-preset": "^4.0.0",
|
|
63
|
-
"@splunk/docs-gen": "^1.
|
|
66
|
+
"@splunk/docs-gen": "^1.2.0",
|
|
64
67
|
"@splunk/eslint-config": "^5.0.0",
|
|
65
|
-
"@splunk/react-docs": "^1.
|
|
68
|
+
"@splunk/react-docs": "^1.4.0",
|
|
66
69
|
"@splunk/stylelint-config": "^5.0.0",
|
|
67
70
|
"@splunk/test-runner-utils": "^0.4.1",
|
|
68
|
-
"@splunk/webpack-configs": "^7.0.
|
|
71
|
+
"@splunk/webpack-configs": "^7.0.3",
|
|
69
72
|
"@storybook/addon-a11y": "^7.6.20",
|
|
70
73
|
"@storybook/addon-essentials": "^7.6.20",
|
|
71
74
|
"@storybook/addon-interactions": "^7.6.20",
|
|
@@ -74,12 +77,12 @@
|
|
|
74
77
|
"@storybook/react-webpack5": "^7.6.20",
|
|
75
78
|
"@storybook/test-runner": "0.16.0",
|
|
76
79
|
"@testing-library/cypress": "^9.0.0",
|
|
77
|
-
"@testing-library/dom": "^10.4.
|
|
80
|
+
"@testing-library/dom": "^10.4.1",
|
|
78
81
|
"@testing-library/jest-dom": "^6.6.3",
|
|
79
82
|
"@testing-library/react": "^16.3.0",
|
|
80
83
|
"@testing-library/react-hooks": "^8.0.1",
|
|
81
84
|
"@testing-library/user-event": "^14.6.1",
|
|
82
|
-
"@types/jest": "^
|
|
85
|
+
"@types/jest": "^30.0.0",
|
|
83
86
|
"@types/lodash": "^4.14.156",
|
|
84
87
|
"@types/node": "^18.16.0",
|
|
85
88
|
"@types/prismjs": "^1.26.3",
|
|
@@ -87,6 +90,7 @@
|
|
|
87
90
|
"@types/react-dom": "^18.2.0",
|
|
88
91
|
"@types/styled-components": "^5.1.0",
|
|
89
92
|
"@types/tinycolor2": "^1.4.2",
|
|
93
|
+
"@types/use-sync-external-store": "^1.5.0",
|
|
90
94
|
"@types/webpack-env": "^1.15.2",
|
|
91
95
|
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
92
96
|
"@typescript-eslint/parser": "^8.29.1",
|
|
@@ -118,8 +122,8 @@
|
|
|
118
122
|
"fs-readdir-recursive": "^1.0.0",
|
|
119
123
|
"glob": "^7.1.6",
|
|
120
124
|
"http-server": "^14.1.1",
|
|
121
|
-
"jest": "^
|
|
122
|
-
"jest-environment-jsdom": "^
|
|
125
|
+
"jest": "^30.1.3",
|
|
126
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
123
127
|
"jest-image-snapshot": "^5.1.0",
|
|
124
128
|
"jest-junit": "^10.0.0",
|
|
125
129
|
"jest-stare": "^2.4.1",
|
package/stubs-splunkui.d.ts
CHANGED
|
@@ -8,92 +8,6 @@ declare module '__FONTS_IMPORT__/*' {
|
|
|
8
8
|
export default component;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
declare module '@splunk/ui-utils/color' {
|
|
12
|
-
function expandShortHandHex<T extends string | null | undefined>(arg: T): T;
|
|
13
|
-
function hexToRgb(hex: string): [number, number, number] | null;
|
|
14
|
-
function isCSSColor(value: string): boolean;
|
|
15
|
-
function isValidHexColor(value: string): boolean;
|
|
16
|
-
function isValidRgb(value: string): boolean;
|
|
17
|
-
function namedColorToHex(colorName: string): string | undefined;
|
|
18
|
-
|
|
19
|
-
const extendedColorKeywords: string[];
|
|
20
|
-
const extendedColorKeywordsToHex: { string: string };
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare module '@splunk/ui-utils/filter' {
|
|
24
|
-
function keywordLocations(
|
|
25
|
-
phrase: string,
|
|
26
|
-
keywords: string[]
|
|
27
|
-
): { keyword: string; start: number; end: number }[];
|
|
28
|
-
function stringToKeywords(filterPhrase?: string): string[];
|
|
29
|
-
function testPhrase(phrase: string, keywords: string[]): boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare module '@splunk/ui-utils/format' {
|
|
33
|
-
// for now, assume this is guaranteed to return a string (and not undefined, null, ...)
|
|
34
|
-
function sprintf(...args: any[]): string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare module '@splunk/ui-utils/focus' {
|
|
38
|
-
// getSortedTabbableElements returns Elements
|
|
39
|
-
// handleTab / takeFocus both call focus() which exists only on HTMLElement/SVGElement (modern browsers), but not Element
|
|
40
|
-
function getSortedTabbableElements(
|
|
41
|
-
container: Element,
|
|
42
|
-
options?: { ignoreTabIndex: boolean }
|
|
43
|
-
): Element[];
|
|
44
|
-
function isTabKey(event: KeyboardEvent<Element>): boolean;
|
|
45
|
-
function handleTab(container: Element, event: KeyboardEvent): Element | null;
|
|
46
|
-
function takeFocus(container: Element, defaultElement?: 'first' | 'container'): Element | null;
|
|
47
|
-
function handleFocus(
|
|
48
|
-
key: string,
|
|
49
|
-
actionItems: Element[],
|
|
50
|
-
currentIndex: number,
|
|
51
|
-
options?: {
|
|
52
|
-
enableLoop?: boolean;
|
|
53
|
-
orientation?: 'horizontal' | 'vertical';
|
|
54
|
-
enableTab?: boolean;
|
|
55
|
-
enableHomeEnd?: boolean;
|
|
56
|
-
}
|
|
57
|
-
): void;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
declare module '@splunk/ui-utils/i18n' {
|
|
61
|
-
// for now, assume this is guaranteed to return a string (and not undefined, null, ...)
|
|
62
|
-
function _(...args: any[]): string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
declare module '@splunk/ui-utils/id' {
|
|
66
|
-
function createDOMID(prefix?: string): string;
|
|
67
|
-
function createGUID(): string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
declare module '@splunk/ui-utils/keyboard' {
|
|
71
|
-
function addsCharacter(event: KeyboardEvent): boolean | undefined;
|
|
72
|
-
function keycode(event: KeyboardEvent | number | string): string;
|
|
73
|
-
function isDecimal(event: KeyboardEvent, options?: { locale: string }): boolean;
|
|
74
|
-
function isMinus(event: KeyboardEvent): boolean;
|
|
75
|
-
function isNumber(event: KeyboardEvent): boolean;
|
|
76
|
-
function isNumeric(event: KeyboardEvent, options?: { locale: string }): boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
declare module '@splunk/ui-utils/promise' {
|
|
80
|
-
interface CancelablePromise<T> {
|
|
81
|
-
cancel: () => void;
|
|
82
|
-
promise: Promise<T>;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function makeCancelable<T>(arg: Promise<T>): CancelablePromise<T>;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
declare module '@splunk/ui-utils/scroll' {
|
|
89
|
-
export function scrollIntoViewIfNeeded(el?: HTMLElement | null): void;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
declare module '@splunk/ui-utils/style' {
|
|
93
|
-
type ClassNameArg = ClassNameArg | Record<string, unknown> | string | undefined | null;
|
|
94
|
-
function toClassName(...args: ClassNameArg[]): string;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
11
|
declare module '@splunk/react-docs/DocExample' {
|
|
98
12
|
function getDependencyVersions(
|
|
99
13
|
packageJSON: Record<string, unknown>,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { AnyTheme, Interpolation, OptionalThemedProps } from '@splunk/themes';
|
|
4
|
+
import { ComponentProps } from '../utils/types';
|
|
5
|
+
interface BadgePropsBase {
|
|
6
|
+
/** Changes the background color. Accepts `@splunk/themes` variable or any valid `color` value. */
|
|
7
|
+
backgroundColor?: React.CSSProperties['color'] | Interpolation<AnyTheme, OptionalThemedProps<AnyTheme>>;
|
|
8
|
+
children?: never;
|
|
9
|
+
/** A React ref which is set to the DOM element when the component mounts and null when it unmounts. */
|
|
10
|
+
elementRef?: React.Ref<HTMLSpanElement>;
|
|
11
|
+
/** The content of the badge. */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Icon before the label. */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/** Changes the text and icon color. Accepts `@splunk/themes` variable or any valid `color` value. */
|
|
16
|
+
foregroundColor?: React.CSSProperties['color'] | Interpolation<AnyTheme, OptionalThemedProps<AnyTheme>>;
|
|
17
|
+
}
|
|
18
|
+
type BadgeProps = ComponentProps<BadgePropsBase, 'span'>;
|
|
19
|
+
declare function Badge({ backgroundColor, elementRef, label, icon, foregroundColor, ...otherProps }: BadgeProps): React.JSX.Element;
|
|
20
|
+
declare namespace Badge {
|
|
21
|
+
var propTypes: {
|
|
22
|
+
backgroundColor: PropTypes.Requireable<NonNullable<string | ((...args: any[]) => any) | null | undefined>>;
|
|
23
|
+
elementRef: PropTypes.Requireable<object>;
|
|
24
|
+
label: PropTypes.Validator<string>;
|
|
25
|
+
icon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
|
+
foregroundColor: PropTypes.Requireable<NonNullable<string | ((...args: any[]) => any) | null | undefined>>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export default Badge;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name Custom colors
|
|
4
|
+
* @description The background and text of Badge can be customized with the `backgroundColor` and `foregroundColor` props. Prefer using variables from `@splunk/themes`, but other valid CSS color values are supported.
|
|
5
|
+
*
|
|
6
|
+
* In all cases, you must check that the chosen colors meet [contrast minimum for text of 4.5:1](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html#user%20interface%20component).
|
|
7
|
+
*/
|
|
8
|
+
export default function CustomColors(): React.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @name With icon
|
|
4
|
+
* @description Use the `icon` prop with an icon component (e.g., `@splunk/react-icons`) to add visual context or emphasis alongside the badge's `label`. When using an icon, a label must also be provided.
|
|
5
|
+
*/
|
|
6
|
+
export default function Icon(): React.JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import BreadcrumbsContext from './BreadcrumbsContext';
|
|
3
4
|
import Item from './Item';
|
|
4
5
|
import { ComponentProps } from '../utils/types';
|
|
5
6
|
/** @public */
|
|
@@ -27,11 +28,6 @@ interface BreadcrumbsPropsBase {
|
|
|
27
28
|
onClick?: BreadcrumbsClickHandler;
|
|
28
29
|
}
|
|
29
30
|
type BreadcrumbsProps = ComponentProps<BreadcrumbsPropsBase, 'nav'>;
|
|
30
|
-
type BreadcrumbsContextValue = {
|
|
31
|
-
onClick?: BreadcrumbsClickHandler;
|
|
32
|
-
prefix?: string;
|
|
33
|
-
};
|
|
34
|
-
declare const BreadcrumbsContext: React.Context<BreadcrumbsContextValue>;
|
|
35
31
|
declare function Breadcrumbs({ children, elementRef, enableCurrentPage, onClick, ...otherProps }: BreadcrumbsProps): React.JSX.Element;
|
|
36
32
|
declare namespace Breadcrumbs {
|
|
37
33
|
var propTypes: {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
|
|
2
|
+
export interface BreadcrumbsContext {
|
|
3
|
+
onClick?: BreadcrumbsClickHandler;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const BreadcrumbsContext: import("react").Context<BreadcrumbsContext>;
|
|
7
|
+
export default BreadcrumbsContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { BreadcrumbsClickHandler } from '
|
|
3
|
+
import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface ItemPropsBase {
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyTheme, Interpolation, InterpolationResult, ThemedProps } from '@splunk/themes';
|
|
2
2
|
declare const buttonVariants: readonly ["primary", "secondary", "destructive", "destructiveSecondary", "subtle", "standalone"];
|
|
3
|
-
type ButtonVariant = typeof buttonVariants[number];
|
|
3
|
+
type ButtonVariant = (typeof buttonVariants)[number];
|
|
4
4
|
type ButtonStyleProps = ThemedProps & Partial<{
|
|
5
5
|
$append: boolean;
|
|
6
6
|
$prepend: boolean;
|
package/types/src/Code/Code.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ComponentProps } from '../utils/types';
|
|
4
|
-
type CodeSupportedLanguages = 'bash' | 'clike' | '
|
|
4
|
+
type CodeSupportedLanguages = 'bash' | 'c' | 'clike' | 'cpp' | 'cs' | 'csharp' | 'css' | 'html' | 'javascript' | 'js' | 'json' | 'jsx' | 'markup' | 'mathml' | 'plain' | 'plaintext' | 'powershell' | 'py' | 'python' | 'sh' | 'shell' | 'splunk-spl' | 'sql' | 'svg' | 'text' | 'ts' | 'tsx' | 'txt' | 'typescript' | 'xml' | 'yaml' | 'yml';
|
|
5
5
|
interface CodePropsBase {
|
|
6
6
|
/** Change the style of the Code container. */
|
|
7
7
|
containerAppearance?: 'none' | 'section';
|
|
@@ -51,8 +51,8 @@ declare namespace Code {
|
|
|
51
51
|
containerAppearance: PropTypes.Requireable<string>;
|
|
52
52
|
elementRef: PropTypes.Requireable<object>;
|
|
53
53
|
indentChars: PropTypes.Requireable<number>;
|
|
54
|
-
language: PropTypes.Requireable<
|
|
55
|
-
languageFallback: PropTypes.Requireable<
|
|
54
|
+
language: PropTypes.Requireable<CodeSupportedLanguages>;
|
|
55
|
+
languageFallback: PropTypes.Requireable<CodeSupportedLanguages>;
|
|
56
56
|
lineHighlights: PropTypes.Requireable<string>;
|
|
57
57
|
lineNumberStart: PropTypes.Requireable<number>;
|
|
58
58
|
showIndentGuide: PropTypes.Requireable<boolean>;
|
|
@@ -61,3 +61,4 @@ declare namespace Code {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
export default Code;
|
|
64
|
+
export type { CodeSupportedLanguages };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import { JSONElement } from '@splunk/react-ui/JSONTree';
|
|
3
4
|
import { TreeItemPropsBase } from '@splunk/react-ui/Tree';
|
|
4
|
-
import { JSONElement } from './JSONTree';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
export type ExpandLinkRenderer = (params: {
|
|
7
7
|
onToggleExpansion: (event: React.KeyboardEvent<HTMLLIElement> | React.MouseEvent<HTMLSpanElement>, data?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '
|
|
2
|
+
import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '@splunk/react-ui/JSONTree';
|
|
3
3
|
type RenderTreeItemsProps = {
|
|
4
4
|
baseId: string;
|
|
5
5
|
defaultOpen?: boolean;
|
package/types/src/Link/Link.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ interface LinkPropsBase {
|
|
|
10
10
|
* Adds an aria-disabled attribute and prevents clicking.
|
|
11
11
|
*/
|
|
12
12
|
disabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
enableVisitedStyling?: boolean;
|
|
13
17
|
/**
|
|
14
18
|
* A React ref which is set to the DOM element when the component mounts and null when it unmounts.
|
|
15
19
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface LinkProviderProps {
|
|
3
|
+
enableVisitedStyling?: boolean;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
type LinkContextValue = {
|
|
7
|
+
enableVisitedStyling: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const LinkContext: React.Context<LinkContextValue>;
|
|
10
|
+
/**
|
|
11
|
+
* Control behavior for all children Link components.
|
|
12
|
+
*/
|
|
13
|
+
declare const LinkProvider: ({ enableVisitedStyling, children, }: LinkProviderProps) => React.ReactElement;
|
|
14
|
+
export { LinkContext, LinkProvider, LinkContextValue, LinkProviderProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '
|
|
4
|
-
import { SelectBaseProps } from '
|
|
3
|
+
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
|
|
4
|
+
import { SelectBaseProps } from '@splunk/react-ui/SelectBase';
|
|
5
5
|
import { ComponentProps } from '../utils/types';
|
|
6
6
|
interface CompactPropsBase {
|
|
7
7
|
animateLoading?: boolean;
|
|
@@ -196,7 +196,7 @@ declare namespace Compact {
|
|
|
196
196
|
/** @private */
|
|
197
197
|
virtualization: PropTypes.Requireable<number>;
|
|
198
198
|
};
|
|
199
|
-
var Option: typeof import("
|
|
199
|
+
var Option: typeof import("@splunk/react-ui/Multiselect").Option;
|
|
200
200
|
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
201
201
|
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
202
202
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Heading, Divider } from '@splunk/react-ui/Menu';
|
|
4
|
-
import { SelectBaseChangeReason } from '@splunk/react-ui/
|
|
4
|
+
import { SelectBaseChangeReason } from '@splunk/react-ui/SelectBase';
|
|
5
5
|
import { CompactPropsBase } from './Compact';
|
|
6
6
|
import Option from './Option';
|
|
7
7
|
import { ComponentProps } from '../utils/types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '
|
|
3
|
+
import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
interface NormalPropsBase {
|
|
6
6
|
/**
|
|
@@ -165,7 +165,7 @@ declare namespace Normal {
|
|
|
165
165
|
tabConfirmsNewValue: PropTypes.Requireable<boolean>;
|
|
166
166
|
values: PropTypes.Requireable<any[]>;
|
|
167
167
|
};
|
|
168
|
-
var Option: typeof import("
|
|
168
|
+
var Option: typeof import("@splunk/react-ui/Multiselect").Option;
|
|
169
169
|
var Divider: typeof import("@splunk/react-ui/Menu").Divider;
|
|
170
170
|
var Heading: typeof import("@splunk/react-ui/Menu").Heading;
|
|
171
171
|
}
|