@neo4j-ndl/react 3.9.3 → 3.9.5
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/lib/cjs/next/side-navigation/stories/side-nav-default.story.js +1 -1
- package/lib/cjs/next/side-navigation/stories/side-nav-default.story.js.map +1 -1
- package/lib/cjs/select/stories/index.js +80 -0
- package/lib/cjs/select/stories/index.js.map +1 -0
- package/lib/cjs/select/stories/select-async.story.js +52 -0
- package/lib/cjs/select/stories/select-async.story.js.map +1 -0
- package/lib/cjs/select/stories/select-clean.story.js +40 -0
- package/lib/cjs/select/stories/select-clean.story.js.map +1 -0
- package/lib/cjs/select/stories/select-controlled.story.js +45 -0
- package/lib/cjs/select/stories/select-controlled.story.js.map +1 -0
- package/lib/cjs/select/stories/select-creatable.story.js +41 -0
- package/lib/cjs/select/stories/select-creatable.story.js.map +1 -0
- package/lib/cjs/select/stories/select-custom-label.story.js +42 -0
- package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -0
- package/lib/cjs/select/stories/select-default.story.js +40 -0
- package/lib/cjs/select/stories/select-default.story.js.map +1 -0
- package/lib/cjs/select/stories/select-disabled.story.js +41 -0
- package/lib/cjs/select/stories/select-disabled.story.js.map +1 -0
- package/lib/cjs/select/stories/select-empty.story.js +34 -0
- package/lib/cjs/select/stories/select-empty.story.js.map +1 -0
- package/lib/cjs/select/stories/select-error-state.story.js +40 -0
- package/lib/cjs/select/stories/select-error-state.story.js.map +1 -0
- package/lib/cjs/select/stories/select-inside-modal.story.js +44 -0
- package/lib/cjs/select/stories/select-inside-modal.story.js.map +1 -0
- package/lib/cjs/select/stories/select-menu-positionings.story.js +47 -0
- package/lib/cjs/select/stories/select-menu-positionings.story.js.map +1 -0
- package/lib/cjs/select/stories/select-multi.story.js +43 -0
- package/lib/cjs/select/stories/select-multi.story.js.map +1 -0
- package/lib/cjs/select/stories/select-sizes.story.js +46 -0
- package/lib/cjs/select/stories/select-sizes.story.js.map +1 -0
- package/lib/cjs/select/stories/select.stories.js +226 -0
- package/lib/cjs/select/stories/select.stories.js.map +1 -0
- package/lib/cjs/spotlight/stories/index.js +59 -0
- package/lib/cjs/spotlight/stories/index.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js +49 -0
- package/lib/cjs/spotlight/stories/spotlight-in-dialog.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js +53 -0
- package/lib/cjs/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-tour.story.js +46 -0
- package/lib/cjs/spotlight/stories/spotlight-tour.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js +49 -0
- package/lib/cjs/spotlight/stories/spotlight-with-icon.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-with-image.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-with-label.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js +48 -0
- package/lib/cjs/spotlight/stories/spotlight-with-pointer.story.js.map +1 -0
- package/lib/cjs/spotlight/stories/spotlight.stories.js +163 -0
- package/lib/cjs/spotlight/stories/spotlight.stories.js.map +1 -0
- package/lib/cjs/tooltip/stories/index.js +68 -0
- package/lib/cjs/tooltip/stories/index.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-controlled.story.js +32 -0
- package/lib/cjs/tooltip/stories/tooltip-controlled.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-default.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-default.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-disabled.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-disabled.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-in-dialog.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-in-dialog.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-initial-open.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-initial-open.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-placements.story.js +40 -0
- package/lib/cjs/tooltip/stories/tooltip-placements.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-rich-pass-through.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-rich-pass-through.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-rich.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-rich.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip-trigger-button-wrapper.story.js +30 -0
- package/lib/cjs/tooltip/stories/tooltip-trigger-button-wrapper.story.js.map +1 -0
- package/lib/cjs/tooltip/stories/tooltip.stories.js +176 -0
- package/lib/cjs/tooltip/stories/tooltip.stories.js.map +1 -0
- package/lib/esm/next/side-navigation/stories/side-nav-default.story.js +1 -1
- package/lib/esm/next/side-navigation/stories/side-nav-default.story.js.map +1 -1
- package/lib/esm/select/stories/index.js +61 -0
- package/lib/esm/select/stories/index.js.map +1 -0
- package/lib/esm/select/stories/select-async.story.js +50 -0
- package/lib/esm/select/stories/select-async.story.js.map +1 -0
- package/lib/esm/select/stories/select-clean.story.js +38 -0
- package/lib/esm/select/stories/select-clean.story.js.map +1 -0
- package/lib/esm/select/stories/select-controlled.story.js +43 -0
- package/lib/esm/select/stories/select-controlled.story.js.map +1 -0
- package/lib/esm/select/stories/select-creatable.story.js +39 -0
- package/lib/esm/select/stories/select-creatable.story.js.map +1 -0
- package/lib/esm/select/stories/select-custom-label.story.js +40 -0
- package/lib/esm/select/stories/select-custom-label.story.js.map +1 -0
- package/lib/esm/select/stories/select-default.story.js +38 -0
- package/lib/esm/select/stories/select-default.story.js.map +1 -0
- package/lib/esm/select/stories/select-disabled.story.js +39 -0
- package/lib/esm/select/stories/select-disabled.story.js.map +1 -0
- package/lib/esm/select/stories/select-empty.story.js +32 -0
- package/lib/esm/select/stories/select-empty.story.js.map +1 -0
- package/lib/esm/select/stories/select-error-state.story.js +38 -0
- package/lib/esm/select/stories/select-error-state.story.js.map +1 -0
- package/lib/esm/select/stories/select-inside-modal.story.js +42 -0
- package/lib/esm/select/stories/select-inside-modal.story.js.map +1 -0
- package/lib/esm/select/stories/select-menu-positionings.story.js +45 -0
- package/lib/esm/select/stories/select-menu-positionings.story.js.map +1 -0
- package/lib/esm/select/stories/select-multi.story.js +41 -0
- package/lib/esm/select/stories/select-multi.story.js.map +1 -0
- package/lib/esm/select/stories/select-sizes.story.js +44 -0
- package/lib/esm/select/stories/select-sizes.story.js.map +1 -0
- package/lib/esm/select/stories/select.stories.js +220 -0
- package/lib/esm/select/stories/select.stories.js.map +1 -0
- package/lib/esm/spotlight/stories/index.js +45 -0
- package/lib/esm/spotlight/stories/index.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-fixed-positioning.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js +47 -0
- package/lib/esm/spotlight/stories/spotlight-in-dialog.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js +51 -0
- package/lib/esm/spotlight/stories/spotlight-in-side-nav.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-tour.story.js +44 -0
- package/lib/esm/spotlight/stories/spotlight-tour.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js +47 -0
- package/lib/esm/spotlight/stories/spotlight-with-icon.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-with-image.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-with-label.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js +46 -0
- package/lib/esm/spotlight/stories/spotlight-with-pointer.story.js.map +1 -0
- package/lib/esm/spotlight/stories/spotlight.stories.js +157 -0
- package/lib/esm/spotlight/stories/spotlight.stories.js.map +1 -0
- package/lib/esm/tooltip/stories/index.js +52 -0
- package/lib/esm/tooltip/stories/index.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-controlled.story.js +30 -0
- package/lib/esm/tooltip/stories/tooltip-controlled.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-default.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-default.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-disabled.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-disabled.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-in-dialog.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-in-dialog.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-initial-open.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-initial-open.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-placements.story.js +38 -0
- package/lib/esm/tooltip/stories/tooltip-placements.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-rich-pass-through.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-rich-pass-through.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-rich.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-rich.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip-trigger-button-wrapper.story.js +28 -0
- package/lib/esm/tooltip/stories/tooltip-trigger-button-wrapper.story.js.map +1 -0
- package/lib/esm/tooltip/stories/tooltip.stories.js +170 -0
- package/lib/esm/tooltip/stories/tooltip.stories.js.map +1 -0
- package/lib/types/select/stories/index.d.ts +46 -0
- package/lib/types/select/stories/select-async.story.d.ts +24 -0
- package/lib/types/select/stories/select-clean.story.d.ts +24 -0
- package/lib/types/select/stories/select-controlled.story.d.ts +23 -0
- package/lib/types/select/stories/select-creatable.story.d.ts +24 -0
- package/lib/types/select/stories/select-custom-label.story.d.ts +24 -0
- package/lib/types/select/stories/select-default.story.d.ts +24 -0
- package/lib/types/select/stories/select-disabled.story.d.ts +24 -0
- package/lib/types/select/stories/select-empty.story.d.ts +24 -0
- package/lib/types/select/stories/select-error-state.story.d.ts +24 -0
- package/lib/types/select/stories/select-inside-modal.story.d.ts +24 -0
- package/lib/types/select/stories/select-menu-positionings.story.d.ts +24 -0
- package/lib/types/select/stories/select-multi.story.d.ts +24 -0
- package/lib/types/select/stories/select-sizes.story.d.ts +24 -0
- package/lib/types/select/stories/select.stories.d.ts +38 -0
- package/lib/types/spotlight/stories/index.d.ts +36 -0
- package/lib/types/spotlight/stories/spotlight-fixed-positioning.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-in-dialog.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-in-side-nav.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-tour.story.d.ts +23 -0
- package/lib/types/spotlight/stories/spotlight-with-icon.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-with-image.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-with-label.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight-with-pointer.story.d.ts +27 -0
- package/lib/types/spotlight/stories/spotlight.stories.d.ts +36 -0
- package/lib/types/tooltip/stories/index.d.ts +40 -0
- package/lib/types/tooltip/stories/tooltip-controlled.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-default.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-disabled.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-hover-delay.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-in-dialog.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-initial-open.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-placements.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-rich-pass-through.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-rich.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip-trigger-button-wrapper.story.d.ts +23 -0
- package/lib/types/tooltip/stories/tooltip.stories.d.ts +35 -0
- package/package.json +3 -3
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
import isChromatic from 'chromatic/isChromatic';
|
|
24
|
+
import { Select } from '../../index';
|
|
25
|
+
import { SelectAsync, SelectAsyncSource, SelectClean, SelectCleanSource, SelectControlled, SelectControlledSource, SelectCreatable, SelectCreatableSource, SelectCustomLabel, SelectCustomLabelSource, SelectDefault, SelectDefaultSource, SelectDisabled, SelectDisabledSource, SelectEmpty, SelectEmptySource, SelectErrorState, SelectErrorStateSource, SelectInsideModal, SelectInsideModalSource, SelectMenuPositionings, SelectMenuPositioningsSource, SelectMulti, SelectMultiSource, SelectSizes, SelectSizesSource, } from '.';
|
|
26
|
+
const centeredContainerDecorator = (Story) => (_jsx("div", { className: "n-flex n-justify-center", children: _jsx(Story, {}) }));
|
|
27
|
+
const widthDecorator = (Story) => (_jsx("div", { className: "n-w-80", children: _jsx(Story, {}) }));
|
|
28
|
+
const fullSizeDecorator = (Story) => (_jsx("div", { className: "n-w-full n-h-full", children: _jsx(Story, {}) }));
|
|
29
|
+
const componentMeta = {
|
|
30
|
+
title: 'Components/Select',
|
|
31
|
+
id: 'components-select',
|
|
32
|
+
component: Select,
|
|
33
|
+
tags: ['docsPage'],
|
|
34
|
+
parameters: {
|
|
35
|
+
controls: { disable: true },
|
|
36
|
+
},
|
|
37
|
+
decorators: [centeredContainerDecorator],
|
|
38
|
+
};
|
|
39
|
+
export default componentMeta;
|
|
40
|
+
export const Default = {
|
|
41
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
42
|
+
decorators: [widthDecorator],
|
|
43
|
+
render: SelectDefault,
|
|
44
|
+
parameters: {
|
|
45
|
+
docs: {
|
|
46
|
+
source: {
|
|
47
|
+
language: 'tsx',
|
|
48
|
+
type: 'code',
|
|
49
|
+
code: SelectDefaultSource,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const Async = {
|
|
55
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
56
|
+
decorators: [widthDecorator],
|
|
57
|
+
render: SelectAsync,
|
|
58
|
+
parameters: {
|
|
59
|
+
docs: {
|
|
60
|
+
source: {
|
|
61
|
+
language: 'tsx',
|
|
62
|
+
type: 'code',
|
|
63
|
+
code: SelectAsyncSource,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export const Creatable = {
|
|
69
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
70
|
+
decorators: [widthDecorator],
|
|
71
|
+
render: SelectCreatable,
|
|
72
|
+
parameters: {
|
|
73
|
+
docs: {
|
|
74
|
+
source: {
|
|
75
|
+
language: 'tsx',
|
|
76
|
+
type: 'code',
|
|
77
|
+
code: SelectCreatableSource,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
export const Controlled = {
|
|
83
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
84
|
+
decorators: [widthDecorator],
|
|
85
|
+
render: SelectControlled,
|
|
86
|
+
parameters: {
|
|
87
|
+
docs: {
|
|
88
|
+
source: {
|
|
89
|
+
language: 'tsx',
|
|
90
|
+
type: 'code',
|
|
91
|
+
code: SelectControlledSource,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
export const MultipleSelections = {
|
|
97
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
98
|
+
decorators: [widthDecorator],
|
|
99
|
+
render: SelectMulti,
|
|
100
|
+
parameters: {
|
|
101
|
+
docs: {
|
|
102
|
+
source: {
|
|
103
|
+
language: 'tsx',
|
|
104
|
+
type: 'code',
|
|
105
|
+
code: SelectMultiSource,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
export const Empty = {
|
|
111
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
112
|
+
decorators: [widthDecorator],
|
|
113
|
+
render: SelectEmpty,
|
|
114
|
+
parameters: {
|
|
115
|
+
docs: {
|
|
116
|
+
source: {
|
|
117
|
+
language: 'tsx',
|
|
118
|
+
type: 'code',
|
|
119
|
+
code: SelectEmptySource,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
export const ErrorState = {
|
|
125
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
126
|
+
decorators: [widthDecorator],
|
|
127
|
+
render: SelectErrorState,
|
|
128
|
+
parameters: {
|
|
129
|
+
docs: {
|
|
130
|
+
source: {
|
|
131
|
+
language: 'tsx',
|
|
132
|
+
type: 'code',
|
|
133
|
+
code: SelectErrorStateSource,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
export const Disabled = {
|
|
139
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
140
|
+
decorators: [widthDecorator],
|
|
141
|
+
render: SelectDisabled,
|
|
142
|
+
parameters: {
|
|
143
|
+
docs: {
|
|
144
|
+
source: {
|
|
145
|
+
language: 'tsx',
|
|
146
|
+
type: 'code',
|
|
147
|
+
code: SelectDisabledSource,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
export const Clean = {
|
|
153
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
154
|
+
decorators: [widthDecorator],
|
|
155
|
+
render: SelectClean,
|
|
156
|
+
parameters: {
|
|
157
|
+
docs: {
|
|
158
|
+
source: {
|
|
159
|
+
language: 'tsx',
|
|
160
|
+
type: 'code',
|
|
161
|
+
code: SelectCleanSource,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
export const CustomLabel = {
|
|
167
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
168
|
+
decorators: [widthDecorator],
|
|
169
|
+
render: SelectCustomLabel,
|
|
170
|
+
parameters: {
|
|
171
|
+
docs: {
|
|
172
|
+
source: {
|
|
173
|
+
language: 'tsx',
|
|
174
|
+
type: 'code',
|
|
175
|
+
code: SelectCustomLabelSource,
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
export const Sizes = {
|
|
181
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
182
|
+
render: SelectSizes,
|
|
183
|
+
parameters: {
|
|
184
|
+
docs: {
|
|
185
|
+
source: {
|
|
186
|
+
language: 'tsx',
|
|
187
|
+
type: 'code',
|
|
188
|
+
code: SelectSizesSource,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
export const MenuPositionings = {
|
|
194
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
195
|
+
render: SelectMenuPositionings,
|
|
196
|
+
parameters: {
|
|
197
|
+
docs: {
|
|
198
|
+
source: {
|
|
199
|
+
language: 'tsx',
|
|
200
|
+
type: 'code',
|
|
201
|
+
code: SelectMenuPositioningsSource,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
export const InsideModal = {
|
|
207
|
+
args: { selectProps: { menuIsOpen: isChromatic() || undefined } },
|
|
208
|
+
decorators: [fullSizeDecorator],
|
|
209
|
+
render: SelectInsideModal,
|
|
210
|
+
parameters: {
|
|
211
|
+
docs: {
|
|
212
|
+
source: {
|
|
213
|
+
language: 'tsx',
|
|
214
|
+
type: 'code',
|
|
215
|
+
code: SelectInsideModalSource,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=select.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.stories.js","sourceRoot":"","sources":["../../../../src/select/stories/select.stories.tsx"],"names":[],"mappings":";AAsBA,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,WAAW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EAAE,EAAE;IACjE,MAAM,EAAE,sBAAsB;IAC9B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,4BAA4B;aACnC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,SAAS,EAAE,EAAE;IACjE,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,iBAAiB;IACzB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,uBAAuB;aAC9B;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export { default as SpotlightWithLabel } from './spotlight-with-label.story';
|
|
22
|
+
export { default as SpotlightWithIcon } from './spotlight-with-icon.story';
|
|
23
|
+
export { default as SpotlightWithImage } from './spotlight-with-image.story';
|
|
24
|
+
export { default as SpotlightWithPointer } from './spotlight-with-pointer.story';
|
|
25
|
+
export { default as SpotlightTour } from './spotlight-tour.story';
|
|
26
|
+
export { default as SpotlightInSideNav } from './spotlight-in-side-nav.story';
|
|
27
|
+
export { default as SpotlightInDialog } from './spotlight-in-dialog.story';
|
|
28
|
+
export { default as SpotlightFixedPositioning } from './spotlight-fixed-positioning.story';
|
|
29
|
+
import SpotlightFixedPositioningSrcRaw from './spotlight-fixed-positioning.story?raw';
|
|
30
|
+
import SpotlightInDialogSrcRaw from './spotlight-in-dialog.story?raw';
|
|
31
|
+
import SpotlightInSideNavSrcRaw from './spotlight-in-side-nav.story?raw';
|
|
32
|
+
import SpotlightTourSrcRaw from './spotlight-tour.story?raw';
|
|
33
|
+
import SpotlightWithIconSrcRaw from './spotlight-with-icon.story?raw';
|
|
34
|
+
import SpotlightWithImageSrcRaw from './spotlight-with-image.story?raw';
|
|
35
|
+
import SpotlightWithLabelSrcRaw from './spotlight-with-label.story?raw';
|
|
36
|
+
import SpotlightWithPointerSrcRaw from './spotlight-with-pointer.story?raw';
|
|
37
|
+
export const SpotlightWithLabelSrc = SpotlightWithLabelSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
38
|
+
export const SpotlightWithIconSrc = SpotlightWithIconSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
39
|
+
export const SpotlightWithImageSrc = SpotlightWithImageSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
40
|
+
export const SpotlightWithPointerSrc = SpotlightWithPointerSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
41
|
+
export const SpotlightTourSrc = SpotlightTourSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
42
|
+
export const SpotlightInSideNavSrc = SpotlightInSideNavSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
43
|
+
export const SpotlightInDialogSrc = SpotlightInDialogSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
44
|
+
export const SpotlightFixedPositioningSrc = SpotlightFixedPositioningSrcRaw.replace(/^\/\*[\s\S]*?\*\/\s*/, '');
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAE3F,OAAO,+BAA+B,MAAM,yCAAyC,CAAC;AACtF,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AACtE,OAAO,wBAAwB,MAAM,mCAAmC,CAAC;AACzE,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAC7D,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AACtE,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,0BAA0B,MAAM,oCAAoC,CAAC;AAE5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,CACnE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,CACjE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,CACnE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,OAAO,CACvE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,OAAO,CACzD,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,CACnE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,CACjE,sBAAsB,EACtB,EAAE,CACH,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GACvC,+BAA+B,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { Button, Spotlight, SpotlightTarget, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
|
|
24
|
+
import { useEffect } from 'react';
|
|
25
|
+
const Component = (props) => {
|
|
26
|
+
const { themeClassName } = useNeedleTheme();
|
|
27
|
+
const { setIsOpen, setActiveSpotlight } = useSpotlightContext();
|
|
28
|
+
const targetId = `test-target-${themeClassName}`;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (props.isChromatic) {
|
|
31
|
+
setActiveSpotlight(targetId);
|
|
32
|
+
setIsOpen(true);
|
|
33
|
+
}
|
|
34
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
35
|
+
return (_jsxs("div", { className: "n-flex n-justify-center n-gap-token-10 n-h-[100px]", children: [_jsx(Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), _jsx("div", { className: "n-left-[auto] n-top-[110px] n-fixed", children: _jsx(SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", indicatorPlacement: "middle-middle", children: _jsx(Button, { onClick: () => alert('Target button clicked'), children: "Target" }) }) }), _jsxs(Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
36
|
+
{
|
|
37
|
+
label: 'Close',
|
|
38
|
+
onClick: () => {
|
|
39
|
+
setIsOpen(false);
|
|
40
|
+
setActiveSpotlight(null);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
], children: [_jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })] }));
|
|
44
|
+
};
|
|
45
|
+
export default Component;
|
|
46
|
+
//# sourceMappingURL=spotlight-fixed-positioning.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-fixed-positioning.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-fixed-positioning.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,eAAK,SAAS,EAAC,oDAAoD,aACjE,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,cAAK,SAAS,EAAC,qCAAqC,YAClD,KAAC,eAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,EAC3D,gBAAgB,EAAC,QAAQ,EACzB,kBAAkB,EAAC,eAAe,YAElC,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,uBAAiB,GACtD,GACd,EACN,MAAC,SAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,KAAC,SAAS,CAAC,MAAM,mCAAoC,EACrD,KAAC,SAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { Button, Dialog, Spotlight, SpotlightTarget, Typography, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
|
|
24
|
+
import { useEffect, useState } from 'react';
|
|
25
|
+
const Component = (props) => {
|
|
26
|
+
const { themeClassName } = useNeedleTheme();
|
|
27
|
+
const { setIsOpen, setActiveSpotlight } = useSpotlightContext();
|
|
28
|
+
const [isModalOpen, setIsModalOpen] = useState(props.isChromatic);
|
|
29
|
+
const targetId = `test-target-${themeClassName}`;
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (props.isChromatic && isModalOpen) {
|
|
32
|
+
setActiveSpotlight(targetId);
|
|
33
|
+
setIsOpen(true);
|
|
34
|
+
}
|
|
35
|
+
}, [isModalOpen, setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
36
|
+
return (_jsxs("div", { className: "n-flex n-justify-center n-gap-token-10", children: [_jsx(Button, { onClick: () => setIsModalOpen(true), children: "Open Modal" }), _jsxs(Dialog, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), "aria-label": "Dialog", modalProps: { className: themeClassName }, children: [_jsx(Dialog.Header, { children: "Using Spotlight inside a modal" }), _jsxs(Dialog.Description, { className: "n-flex n-flex-col n-gap-token-8", children: [_jsx(Typography, { variant: "body-medium", children: "Make sure to set hasAnchorPortal to true for both Spotlight and SpotlightTarget when the target is in a Dialog" }), _jsxs("div", { className: "n-flex n-justify-center n-gap-token-10", children: [_jsx(Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), _jsx(SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", hasAnchorPortal: true, children: _jsx(Button, { onClick: () => alert('Target button clicked'), children: "Target" }) })] })] }), _jsxs(Spotlight, { placement: "bottom-end-top-end", hasAnchorPortal: true, target: targetId, actions: [
|
|
37
|
+
{
|
|
38
|
+
label: 'Close',
|
|
39
|
+
onClick: () => {
|
|
40
|
+
setIsOpen(false);
|
|
41
|
+
setActiveSpotlight(null);
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
], children: [_jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })] })] }));
|
|
45
|
+
};
|
|
46
|
+
export default Component;
|
|
47
|
+
//# sourceMappingURL=spotlight-in-dialog.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-in-dialog.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-in-dialog.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAM5C,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEhE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,WAAW,CAAC,CAAC;IAC3E,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,IAAI,WAAW,EAAE,CAAC;YACrC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EA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,IAAI,kCAAiC,IACtC,IACL,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { Button, Spotlight, SpotlightTarget, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
|
|
24
|
+
import { SideNavigation } from '@neo4j-ndl/react/next';
|
|
25
|
+
import { useEffect, useState } from 'react';
|
|
26
|
+
const Component = (props) => {
|
|
27
|
+
const { themeClassName } = useNeedleTheme();
|
|
28
|
+
const { setActiveSpotlight, setIsOpen } = useSpotlightContext();
|
|
29
|
+
const [isSelected, setIsSelected] = useState('aura-db-instances');
|
|
30
|
+
const targetId = `test-target-${themeClassName}`;
|
|
31
|
+
const handleClick = (item) => {
|
|
32
|
+
setIsSelected(item);
|
|
33
|
+
};
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (props.isChromatic) {
|
|
36
|
+
setActiveSpotlight(targetId);
|
|
37
|
+
setIsOpen(true);
|
|
38
|
+
}
|
|
39
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
40
|
+
return (_jsxs("div", { className: "n-h-[500px] n-flex", children: [_jsx(SideNavigation, { isExpanded: true, children: _jsxs(SideNavigation.List, { children: [_jsx(SideNavigation.CategoryHeader, { children: "AuraDB" }), _jsx(SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-instances'), isSelected: isSelected === 'aura-db-instances', label: "Instances" }), _jsx(SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-connect'), isSelected: isSelected === 'aura-db-connect', label: "Connect" }), _jsxs(SideNavigation.List, { children: [_jsx(SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-python'), isSelected: isSelected === 'aura-db-python', label: "Python" }), _jsx(SpotlightTarget, { as: "li", id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "point", indicatorPlacement: "top-right", children: _jsx(SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-db-javascript'), isSelected: isSelected === 'aura-db-javascript', label: "JavaScript" }) })] }), _jsx(SideNavigation.CategoryHeader, { children: "AuraDS" }), _jsxs(SideNavigation.List, { children: [_jsx(SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-ds-instances'), isSelected: isSelected === 'aura-ds-instances', label: "Instances" }), _jsx(SideNavigation.NavItem, { as: "button", onClick: () => handleClick('aura-ds-getting-started'), isSelected: isSelected === 'aura-ds-getting-started', label: "Getting Started" })] })] }) }), _jsx("div", { className: "n-w-full n-h-full n-flex n-flex-col n-items-center n-justify-center n-rounded-md n-p-token-6", children: _jsx(Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }) }), _jsxs(Spotlight, { placement: "top-end-top-start", target: targetId, actions: [
|
|
41
|
+
{
|
|
42
|
+
label: 'Close',
|
|
43
|
+
onClick: () => {
|
|
44
|
+
setIsOpen(false);
|
|
45
|
+
setActiveSpotlight(null);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
], children: [_jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })] }));
|
|
49
|
+
};
|
|
50
|
+
export default Component;
|
|
51
|
+
//# sourceMappingURL=spotlight-in-side-nav.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-in-side-nav.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-in-side-nav.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAM5C,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5C,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEhE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAC1C,mBAAmB,CACpB,CAAC;IACF,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,EAAE;QACnC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,I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
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { Button, Spotlight, SpotlightTarget, SpotlightTour, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
|
|
24
|
+
import { FingerPrintIconOutline } from '@neo4j-ndl/react/icons';
|
|
25
|
+
const Component = () => {
|
|
26
|
+
const { themeClassName } = useNeedleTheme();
|
|
27
|
+
const { setActiveSpotlight } = useSpotlightContext();
|
|
28
|
+
return (_jsxs("div", { className: "n-flex n-justify-center n-gap-token-10", children: [_jsx(Button, { fill: "outlined", onClick: () => setActiveSpotlight(`test-target-1-${themeClassName}`), children: "Start tour" }), _jsx(SpotlightTarget, { id: `test-target-1-${themeClassName}`, hasPulse: true, borderRadius: 4, children: _jsx(Button, { onClick: () => alert('Target 1 clicked'), children: "Target 1" }) }), _jsx(SpotlightTarget, { id: `test-target-2-${themeClassName}`, hasPulse: true, borderRadius: 4, children: _jsx(Button, { onClick: () => alert('Target 2 clicked'), children: "Target 2" }) }), _jsx(SpotlightTarget, { id: `test-target-3-${themeClassName}`, hasPulse: true, borderRadius: 4, children: _jsx(Button, { onClick: () => alert('Target 3 clicked'), children: "Target 3" }) }), _jsx(SpotlightTour, { onAction: (target, action) => console.info(`Action ${action} was performed in spotlight ${target}`), spotlights: [
|
|
29
|
+
{
|
|
30
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Spotlight.Label, { children: "NEW" }), _jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })),
|
|
31
|
+
target: `test-target-1-${themeClassName}`,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Spotlight.IconWrapper, { children: _jsx(FingerPrintIconOutline, {}) }), _jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })),
|
|
35
|
+
target: `test-target-2-${themeClassName}`,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Spotlight.Image, { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjY2NjIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzMzMyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkV4YW1wbGUgSW1hZ2U8L3RleHQ+PC9zdmc+", alt: "example image" }), _jsx(Spotlight.Body, { children: "This is content" })] })),
|
|
39
|
+
target: `test-target-3-${themeClassName}`,
|
|
40
|
+
},
|
|
41
|
+
] })] }));
|
|
42
|
+
};
|
|
43
|
+
export default Component;
|
|
44
|
+
//# sourceMappingURL=spotlight-tour.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-tour.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-tour.story.tsx"],"names":[],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,MAAM,EAAE,CAAC,EAEvE,UAAU,EAAE;oBACV;wBACE,QAAQ,EAAE,CACR,8BACE,KAAC,SAAS,CAAC,KAAK,sBAAsB,EACtC,KAAC,SAAS,CAAC,MAAM,mCAAoC,EACrD,KAAC,SAAS,CAAC,IAAI,kCAAiC,IAC/C,CACJ;wBACD,MAAM,EAAE,iBAAiB,cAAc,EAAE;qBAC1C;oBACD;wBACE,QAAQ,EAAE,CACR,8BACE,KAAC,SAAS,CAAC,WAAW,cACpB,KAAC,sBAAsB,KAAG,GACJ,EACxB,KAAC,SAAS,CAAC,MAAM,mCAAoC,EACrD,KAAC,SAAS,CAAC,IAAI,kCAAiC,IAC/C,CACJ;wBACD,MAAM,EAAE,iBAAiB,cAAc,EAAE;qBAC1C;oBACD;wBACE,QAAQ,EAAE,CACR,8BACE,KAAC,SAAS,CAAC,KAAK,IACd,GAAG,EAAC,wVAAwV,EAC5V,GAAG,EAAC,eAAe,GACnB,EACF,KAAC,SAAS,CAAC,IAAI,kCAAiC,IAC/C,CACJ;wBACD,MAAM,EAAE,iBAAiB,cAAc,EAAE;qBAC1C;iBACF,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { Button, Spotlight, SpotlightTarget, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
|
|
24
|
+
import { FingerPrintIconOutline } from '@neo4j-ndl/react/icons';
|
|
25
|
+
import { useEffect } from 'react';
|
|
26
|
+
const Component = (props) => {
|
|
27
|
+
const { themeClassName } = useNeedleTheme();
|
|
28
|
+
const { setIsOpen, setActiveSpotlight } = useSpotlightContext();
|
|
29
|
+
const targetId = `test-target-${themeClassName}`;
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (props.isChromatic) {
|
|
32
|
+
setActiveSpotlight(targetId);
|
|
33
|
+
setIsOpen(true);
|
|
34
|
+
}
|
|
35
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
36
|
+
return (_jsxs("div", { className: "n-flex n-justify-center n-gap-token-10", children: [_jsx(Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), _jsx(SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", indicatorVariant: "border", children: _jsx(Button, { onClick: () => alert('Target button clicked'), fill: "text", children: "Target" }) }), _jsxs(Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
37
|
+
{
|
|
38
|
+
label: 'Close',
|
|
39
|
+
onClick: () => {
|
|
40
|
+
setIsOpen(false);
|
|
41
|
+
setActiveSpotlight(null);
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
], children: [_jsx(Spotlight.IconWrapper, { children: _jsx(FingerPrintIconOutline, {}) }), _jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })] }));
|
|
45
|
+
};
|
|
46
|
+
export default Component;
|
|
47
|
+
//# sourceMappingURL=spotlight-with-icon.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-with-icon.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-with-icon.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,eAAK,SAAS,EAAC,wCAAwC,aACrD,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,mCAE1C,EACT,KAAC,eAAe,IACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,CAAC,KAAK,CAAC,WAAW,EAC5B,YAAY,EAAE,CAAC,EACf,eAAe,EAAC,2CAA2C,EAC3D,gBAAgB,EAAC,QAAQ,YAEzB,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAC,MAAM,uBAEzD,GACO,EAClB,MAAC,SAAS,IACR,SAAS,EAAC,oBAAoB,EAC9B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO;wBACd,OAAO,EAAE,GAAG,EAAE;4BACZ,SAAS,CAAC,KAAK,CAAC,CAAC;4BACjB,kBAAkB,CAAC,IAAI,CAAC,CAAC;wBAC3B,CAAC;qBACF;iBACF,aAED,KAAC,SAAS,CAAC,WAAW,cACpB,KAAC,sBAAsB,KAAG,GACJ,EACxB,KAAC,SAAS,CAAC,MAAM,mCAAoC,EACrD,KAAC,SAAS,CAAC,IAAI,kCAAiC,IACtC,IACR,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
23
|
+
import { Button, Spotlight, SpotlightTarget, useNeedleTheme, useSpotlightContext, } from '@neo4j-ndl/react';
|
|
24
|
+
import { useEffect } from 'react';
|
|
25
|
+
const Component = (props) => {
|
|
26
|
+
const { themeClassName } = useNeedleTheme();
|
|
27
|
+
const { setIsOpen, setActiveSpotlight } = useSpotlightContext();
|
|
28
|
+
const targetId = `test-target-${themeClassName}`;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (props.isChromatic) {
|
|
31
|
+
setActiveSpotlight(targetId);
|
|
32
|
+
setIsOpen(true);
|
|
33
|
+
}
|
|
34
|
+
}, [setActiveSpotlight, setIsOpen, targetId, props.isChromatic]);
|
|
35
|
+
return (_jsxs("div", { className: "n-flex n-justify-center n-gap-token-10", children: [_jsx(Button, { onClick: () => setActiveSpotlight(targetId), children: "Activate Spotlight" }), _jsx(SpotlightTarget, { id: targetId, hasPulse: !props.isChromatic, borderRadius: 4, backgroundColor: "rgb(var(--theme-palette-neutral-bg-weak))", children: _jsx(Button, { onClick: () => alert('Target button clicked'), fill: "text", children: "Target" }) }), _jsxs(Spotlight, { placement: "bottom-end-top-end", target: targetId, actions: [
|
|
36
|
+
{
|
|
37
|
+
label: 'Close',
|
|
38
|
+
onClick: () => {
|
|
39
|
+
setIsOpen(false);
|
|
40
|
+
setActiveSpotlight(null);
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
], children: [_jsx(Spotlight.Image, { src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjY2NjIi8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCIgZm9udC1zaXplPSIxNCIgZmlsbD0iIzMzMyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkV4YW1wbGUgSW1hZ2U8L3RleHQ+PC9zdmc+", alt: "example image" }), _jsx(Spotlight.Header, { children: "This is a header" }), _jsx(Spotlight.Body, { children: "This is content" })] })] }));
|
|
44
|
+
};
|
|
45
|
+
export default Component;
|
|
46
|
+
//# sourceMappingURL=spotlight-with-image.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spotlight-with-image.story.js","sourceRoot":"","sources":["../../../../src/spotlight/stories/spotlight-with-image.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5C,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAEhE,MAAM,QAAQ,GAAG,eAAe,cAAc,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;YACtB,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAEjE,OAAO,CACL,eAAK,SAAS,EAAC,wCAAwC,aACrD,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