freemium-ui 1.0.114
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/0001-chore-Adding-popper-support-to-dropdown.patch +304 -0
- package/README.md +70 -0
- package/lib/index.cjs.js +19399 -0
- package/lib/index.esm.js +19335 -0
- package/lib/types/components/Alert/Alert.d.ts +17 -0
- package/lib/types/components/Alert/Alert.stories.d.ts +1 -0
- package/lib/types/components/Alert/index.d.ts +1 -0
- package/lib/types/components/BoxedRadio/BoxedRadio.stories.d.ts +1 -0
- package/lib/types/components/BoxedRadio/boxedRadio.d.ts +8 -0
- package/lib/types/components/BoxedRadio/boxedRadioContext.d.ts +7 -0
- package/lib/types/components/BoxedRadio/boxedRadioGroup.d.ts +2 -0
- package/lib/types/components/BoxedRadio/index.d.ts +2 -0
- package/lib/types/components/Button/Buttons.d.ts +132 -0
- package/lib/types/components/Button/Buttons.stories.d.ts +1 -0
- package/lib/types/components/Button/index.d.ts +1 -0
- package/lib/types/components/ButtonDropdown/ButtonDropdown.d.ts +19 -0
- package/lib/types/components/ButtonDropdown/ButtonDropdown.stories.d.ts +1 -0
- package/lib/types/components/ButtonDropdown/index.d.ts +1 -0
- package/lib/types/components/Checkbox/Checkbox.d.ts +17 -0
- package/lib/types/components/Checkbox/Checkbox.stories.d.ts +1 -0
- package/lib/types/components/Checkbox/index.d.ts +1 -0
- package/lib/types/components/Confirmation/Confirmation.d.ts +30 -0
- package/lib/types/components/Confirmation/Confirmation.stories.d.ts +1 -0
- package/lib/types/components/Confirmation/index.d.ts +2 -0
- package/lib/types/components/Confirmation/useConfirmation.d.ts +28 -0
- package/lib/types/components/CssBaseLine/index.d.ts +1 -0
- package/lib/types/components/DatePicker/DatePicker.d.ts +95 -0
- package/lib/types/components/DatePicker/DatePicker.stories.d.ts +1 -0
- package/lib/types/components/DatePicker/index.d.ts +1 -0
- package/lib/types/components/DateRangePicker/DateRangePicker.d.ts +106 -0
- package/lib/types/components/DateRangePicker/DateRangePicker.stories.d.ts +1 -0
- package/lib/types/components/DateRangePicker/index.d.ts +1 -0
- package/lib/types/components/Drawer/Drawer.d.ts +77 -0
- package/lib/types/components/Drawer/Drawer.stories.d.ts +1 -0
- package/lib/types/components/Drawer/index.d.ts +2 -0
- package/lib/types/components/Drawer/styles.d.ts +2 -0
- package/lib/types/components/Dropdown/Dropdown.stories.d.ts +1 -0
- package/lib/types/components/Dropdown/DropdownButton.d.ts +14 -0
- package/lib/types/components/Dropdown/DropdownInput.d.ts +4 -0
- package/lib/types/components/Dropdown/DropdownMenu.d.ts +4 -0
- package/lib/types/components/Dropdown/index.d.ts +199 -0
- package/lib/types/components/Icons/Icons.d.ts +101 -0
- package/lib/types/components/Icons/index.d.ts +1 -0
- package/lib/types/components/Input/Input.d.ts +48 -0
- package/lib/types/components/Input/Input.stories.d.ts +1 -0
- package/lib/types/components/Input/index.d.ts +1 -0
- package/lib/types/components/Loader/index.d.ts +1 -0
- package/lib/types/components/Loader/loader.d.ts +8 -0
- package/lib/types/components/Loader/loader.stories.d.ts +1 -0
- package/lib/types/components/Menu/Menu.d.ts +108 -0
- package/lib/types/components/Menu/Menu.stories.d.ts +1 -0
- package/lib/types/components/Menu/index.d.ts +1 -0
- package/lib/types/components/Modal/Modal.d.ts +59 -0
- package/lib/types/components/Modal/Modal.stories.d.ts +1 -0
- package/lib/types/components/Modal/index.d.ts +3 -0
- package/lib/types/components/Modal/styles.d.ts +11 -0
- package/lib/types/components/Modal/use-modal.d.ts +28 -0
- package/lib/types/components/MultiSelectDropdown/MultiSelectDropdown.d.ts +154 -0
- package/lib/types/components/MultiSelectDropdown/MultiSelectDropdown.stories.d.ts +1 -0
- package/lib/types/components/MultiSelectDropdown/index.d.ts +1 -0
- package/lib/types/components/Popover/Popover.d.ts +91 -0
- package/lib/types/components/Popover/Popover.stories.d.ts +1 -0
- package/lib/types/components/Popover/index.d.ts +1 -0
- package/lib/types/components/Radio/Radio.d.ts +13 -0
- package/lib/types/components/Radio/Radio.stories.d.ts +1 -0
- package/lib/types/components/Radio/index.d.ts +1 -0
- package/lib/types/components/Table/Table.d.ts +155 -0
- package/lib/types/components/Table/Table.stories.d.ts +1 -0
- package/lib/types/components/Table/index.d.ts +1 -0
- package/lib/types/components/Tabs/Tabs.d.ts +88 -0
- package/lib/types/components/Tabs/Tabs.stories.d.ts +1 -0
- package/lib/types/components/Tabs/index.d.ts +1 -0
- package/lib/types/components/Tag/Tag.d.ts +25 -0
- package/lib/types/components/Tag/Tag.stories.d.ts +1 -0
- package/lib/types/components/Tag/index.d.ts +1 -0
- package/lib/types/components/ThemeProvider/index.d.ts +12 -0
- package/lib/types/components/Toast/Toast.d.ts +14 -0
- package/lib/types/components/Toast/index.d.ts +3 -0
- package/lib/types/components/Toggle/Toggle.d.ts +15 -0
- package/lib/types/components/Toggle/Toggle.stories.d.ts +1 -0
- package/lib/types/components/Toggle/index.d.ts +1 -0
- package/lib/types/components/Tooltip/Tooltip.d.ts +15 -0
- package/lib/types/components/Tooltip/index.d.ts +1 -0
- package/lib/types/components/Tooltip/tooltip-old.d.ts +14 -0
- package/lib/types/components/Tooltip/tooltip.stories.d.ts +1 -0
- package/lib/types/components/Transition/Transition.d.ts +122 -0
- package/lib/types/components/Transition/fade.d.ts +105 -0
- package/lib/types/components/Transition/index.d.ts +4 -0
- package/lib/types/components/Transition/slide-fade.d.ts +121 -0
- package/lib/types/components/Transition/slide.d.ts +119 -0
- package/lib/types/components/UiProvider/UiProvider.d.ts +2 -0
- package/lib/types/components/UiProvider/index.d.ts +1 -0
- package/lib/types/components/use-toasts/index.d.ts +1 -0
- package/lib/types/components/use-toasts/toast-container.d.ts +8 -0
- package/lib/types/components/use-toasts/toast-item.d.ts +15 -0
- package/lib/types/components/use-toasts/use-toast.d.ts +15 -0
- package/lib/types/components/use-toasts/use-toasts.stories.d.ts +1 -0
- package/lib/types/index.d.ts +28 -0
- package/lib/types/theme/default/colors.d.ts +3 -0
- package/lib/types/theme/default/index.d.ts +7 -0
- package/lib/types/theme/default/palette.d.ts +3 -0
- package/lib/types/theme/default/typography.d.ts +3 -0
- package/lib/types/theme/freshstatus/colors.d.ts +3 -0
- package/lib/types/theme/freshstatus/index.d.ts +7 -0
- package/lib/types/theme/freshstatus/palette.d.ts +3 -0
- package/lib/types/theme/freshstatus/typography.d.ts +3 -0
- package/lib/types/theme/index.d.ts +352 -0
- package/lib/types/theme/shared.d.ts +2 -0
- package/lib/types/utils/date.d.ts +7 -0
- package/lib/types/utils/index.d.ts +1 -0
- package/lib/types/utils/use-current-state.d.ts +4 -0
- package/lib/types/utils/use-portal.d.ts +2 -0
- package/lib/types/utils/use-ssr.d.ts +6 -0
- package/lib/types/utils/use-ui-context.d.ts +11 -0
- package/lib/types/utils/with-defaults.d.ts +3 -0
- package/package.json +107 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
From 69099ea79a290dd13fc4f05c6d1a22e0db151168 Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: codejets <mukeshkr@freshdesk.com>
|
|
3
|
+
Date: Wed, 30 Dec 2020 11:43:00 +0530
|
|
4
|
+
Subject: [PATCH] chore: Adding popper support to dropdown
|
|
5
|
+
|
|
6
|
+
This will remove the interaction from the dropdown and we can add that later
|
|
7
|
+
---
|
|
8
|
+
package.json | 1 +
|
|
9
|
+
src/components/Dropdown/Dropdown.stories.tsx | 2 +-
|
|
10
|
+
src/components/Dropdown/DropdownMenu.tsx | 94 +++++++++-----------
|
|
11
|
+
src/components/Dropdown/index.tsx | 71 ++++++++++++---
|
|
12
|
+
yarn.lock | 22 ++++-
|
|
13
|
+
5 files changed, 124 insertions(+), 66 deletions(-)
|
|
14
|
+
|
|
15
|
+
diff --git a/package.json b/package.json
|
|
16
|
+
index 1deb9b7..3fb95db 100644
|
|
17
|
+
--- a/package.json
|
|
18
|
+
+++ b/package.json
|
|
19
|
+
@@ -47,6 +47,7 @@
|
|
20
|
+
"react": ">=16.13.1",
|
|
21
|
+
"react-dates": "^21.8.0",
|
|
22
|
+
"react-dom": ">=16.13.1",
|
|
23
|
+
+ "react-popper": "1.3.3",
|
|
24
|
+
"react-table": "^7.2.1",
|
|
25
|
+
"react-tippy": "^1.4.0",
|
|
26
|
+
"react-transition-group": "^4.4.1",
|
|
27
|
+
diff --git a/src/components/Dropdown/Dropdown.stories.tsx b/src/components/Dropdown/Dropdown.stories.tsx
|
|
28
|
+
index 440bf74..37deb73 100644
|
|
29
|
+
--- a/src/components/Dropdown/Dropdown.stories.tsx
|
|
30
|
+
+++ b/src/components/Dropdown/Dropdown.stories.tsx
|
|
31
|
+
@@ -12,7 +12,7 @@ import {Dropdown} from './'
|
|
32
|
+
const stories = storiesOf('Dropdown', module)
|
|
33
|
+
stories.addDecorator(withKnobs)
|
|
34
|
+
stories.addDecorator((story) => {
|
|
35
|
+
- return <div style={{margin: '200px'}}>{story()}</div>
|
|
36
|
+
+ return <div style={{margin: '250px 200px 250px'}}>{story()}</div>
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const allHouses = [
|
|
40
|
+
diff --git a/src/components/Dropdown/DropdownMenu.tsx b/src/components/Dropdown/DropdownMenu.tsx
|
|
41
|
+
index f69b8c4..9333baf 100644
|
|
42
|
+
--- a/src/components/Dropdown/DropdownMenu.tsx
|
|
43
|
+
+++ b/src/components/Dropdown/DropdownMenu.tsx
|
|
44
|
+
@@ -129,56 +129,50 @@ const DropdownMenu = withDownshift(
|
|
45
|
+
return null
|
|
46
|
+
}
|
|
47
|
+
return (
|
|
48
|
+
- <SlideFade initialOffset="-20px" timeout={200} in={isOpen} unmountOnExit>
|
|
49
|
+
- {(styles: React.CSSProperties) => (
|
|
50
|
+
- <div
|
|
51
|
+
- style={{
|
|
52
|
+
- position: 'absolute',
|
|
53
|
+
- width: '100%',
|
|
54
|
+
- zIndex: 1000,
|
|
55
|
+
- ...styles,
|
|
56
|
+
- }}
|
|
57
|
+
- >
|
|
58
|
+
- <StyledMenuContainer
|
|
59
|
+
- {...getMenuProps({
|
|
60
|
+
- onClick: (event: React.MouseEvent<HTMLElement>) => {
|
|
61
|
+
- event.stopPropagation()
|
|
62
|
+
- },
|
|
63
|
+
- })}
|
|
64
|
+
- overrideStyles={overrideStyles}
|
|
65
|
+
- >
|
|
66
|
+
- {allItems.map((item, index) => {
|
|
67
|
+
- const canHighlightSelectedIndex =
|
|
68
|
+
- allItems.indexOf(selectedItem) === index
|
|
69
|
+
- return (
|
|
70
|
+
- <StyledMenuItem
|
|
71
|
+
- {...getItemProps({
|
|
72
|
+
- item,
|
|
73
|
+
- key: index,
|
|
74
|
+
- disabled: item.disabled,
|
|
75
|
+
- })}
|
|
76
|
+
- key={index}
|
|
77
|
+
- isSelectedIndex={canHighlightSelectedIndex}
|
|
78
|
+
- canHighlight={highlightedIndex === index}
|
|
79
|
+
- disabled={item.disabled}
|
|
80
|
+
- >
|
|
81
|
+
- <Flex justifyContent="space-between" alignItems="center">
|
|
82
|
+
- <Box width="90%" style={{wordBreak: 'break-word'}}>
|
|
83
|
+
- {itemComponent
|
|
84
|
+
- ? itemComponent(item)
|
|
85
|
+
- : itemToString(item)}
|
|
86
|
+
- </Box>
|
|
87
|
+
- {canHighlightSelectedIndex ? (
|
|
88
|
+
- <Icons glyph="check" size={12} viewBox="0 0 8 8" />
|
|
89
|
+
- ) : null}
|
|
90
|
+
- </Flex>
|
|
91
|
+
- </StyledMenuItem>
|
|
92
|
+
- )
|
|
93
|
+
- })}
|
|
94
|
+
- </StyledMenuContainer>
|
|
95
|
+
- </div>
|
|
96
|
+
- )}
|
|
97
|
+
- </SlideFade>
|
|
98
|
+
+ <div
|
|
99
|
+
+ style={{
|
|
100
|
+
+ width: '100%',
|
|
101
|
+
+ zIndex: 1000,
|
|
102
|
+
+ position: 'relative',
|
|
103
|
+
+ display: isOpen ? 'block' : 'none',
|
|
104
|
+
+ }}
|
|
105
|
+
+ >
|
|
106
|
+
+ <StyledMenuContainer
|
|
107
|
+
+ {...getMenuProps({
|
|
108
|
+
+ onClick: (event: React.MouseEvent<HTMLElement>) => {
|
|
109
|
+
+ event.stopPropagation()
|
|
110
|
+
+ },
|
|
111
|
+
+ })}
|
|
112
|
+
+ overrideStyles={overrideStyles}
|
|
113
|
+
+ >
|
|
114
|
+
+ {allItems.map((item, index) => {
|
|
115
|
+
+ const canHighlightSelectedIndex =
|
|
116
|
+
+ allItems.indexOf(selectedItem) === index
|
|
117
|
+
+ return (
|
|
118
|
+
+ <StyledMenuItem
|
|
119
|
+
+ {...getItemProps({
|
|
120
|
+
+ item,
|
|
121
|
+
+ key: index,
|
|
122
|
+
+ disabled: item.disabled,
|
|
123
|
+
+ })}
|
|
124
|
+
+ key={index}
|
|
125
|
+
+ isSelectedIndex={canHighlightSelectedIndex}
|
|
126
|
+
+ canHighlight={highlightedIndex === index}
|
|
127
|
+
+ disabled={item.disabled}
|
|
128
|
+
+ >
|
|
129
|
+
+ <Flex justifyContent="space-between" alignItems="center">
|
|
130
|
+
+ <Box width="90%" style={{wordBreak: 'break-word'}}>
|
|
131
|
+
+ {itemComponent ? itemComponent(item) : itemToString(item)}
|
|
132
|
+
+ </Box>
|
|
133
|
+
+ {canHighlightSelectedIndex ? (
|
|
134
|
+
+ <Icons glyph="check" size={12} viewBox="0 0 8 8" />
|
|
135
|
+
+ ) : null}
|
|
136
|
+
+ </Flex>
|
|
137
|
+
+ </StyledMenuItem>
|
|
138
|
+
+ )
|
|
139
|
+
+ })}
|
|
140
|
+
+ </StyledMenuContainer>
|
|
141
|
+
+ </div>
|
|
142
|
+
)
|
|
143
|
+
},
|
|
144
|
+
)
|
|
145
|
+
diff --git a/src/components/Dropdown/index.tsx b/src/components/Dropdown/index.tsx
|
|
146
|
+
index 6f160cc..d3262f3 100644
|
|
147
|
+
--- a/src/components/Dropdown/index.tsx
|
|
148
|
+
+++ b/src/components/Dropdown/index.tsx
|
|
149
|
+
@@ -2,6 +2,7 @@ import React from 'react'
|
|
150
|
+
import Downshift from 'downshift'
|
|
151
|
+
import hoistNonReactStatics from 'hoist-non-react-statics'
|
|
152
|
+
import styled from 'styled-components'
|
|
153
|
+
+import {Manager, Reference, Popper} from 'react-popper'
|
|
154
|
+
|
|
155
|
+
import DropdownButton from './DropdownButton'
|
|
156
|
+
import DropdownMenu from './DropdownMenu'
|
|
157
|
+
@@ -54,6 +55,16 @@ export const DROPDOWN_TYPES = {
|
|
158
|
+
|
|
159
|
+
const DownshiftContext = React.createContext<any>(null)
|
|
160
|
+
|
|
161
|
+
+class DropdownWrapper extends React.Component<{scheduleUpdate: any}> {
|
|
162
|
+
+ componentDidUpdate() {
|
|
163
|
+
+ this.props.scheduleUpdate()
|
|
164
|
+
+ }
|
|
165
|
+
+
|
|
166
|
+
+ render() {
|
|
167
|
+
+ return this.props.children
|
|
168
|
+
+ }
|
|
169
|
+
+}
|
|
170
|
+
+
|
|
171
|
+
export function withDownshift(Component: any) {
|
|
172
|
+
function Wrapper(props: any, ref: any) {
|
|
173
|
+
return (
|
|
174
|
+
@@ -86,6 +97,13 @@ type DropdownProps = {
|
|
175
|
+
onChange?: (value: any) => any
|
|
176
|
+
itemToString?: (a: any) => any
|
|
177
|
+
type?: 'button' | 'input'
|
|
178
|
+
+ defaultPlacement?:
|
|
179
|
+
+ | 'top'
|
|
180
|
+
+ | 'top-start'
|
|
181
|
+
+ | 'top-end'
|
|
182
|
+
+ | 'bottom-start'
|
|
183
|
+
+ | 'bottom'
|
|
184
|
+
+ | 'bottom-end'
|
|
185
|
+
filterKey?: string
|
|
186
|
+
label?: string
|
|
187
|
+
width?: string
|
|
188
|
+
@@ -114,6 +132,7 @@ export const Dropdown = (props: DropdownProps) => {
|
|
189
|
+
width = '100%',
|
|
190
|
+
disabled,
|
|
191
|
+
isRequired,
|
|
192
|
+
+ defaultPlacement,
|
|
193
|
+
overrideButtonStyles,
|
|
194
|
+
overrideContainerStyles,
|
|
195
|
+
...rest
|
|
196
|
+
@@ -158,20 +177,44 @@ export const Dropdown = (props: DropdownProps) => {
|
|
197
|
+
children
|
|
198
|
+
) : (
|
|
199
|
+
<>
|
|
200
|
+
- {DROPDOWN_TYPES.BUTTON === type && (
|
|
201
|
+
- <DropdownButton
|
|
202
|
+
- disabled={disabled}
|
|
203
|
+
- overrideStyles={overrideButtonStyles}
|
|
204
|
+
- placeholder={placeholder}
|
|
205
|
+
- />
|
|
206
|
+
- )}
|
|
207
|
+
- {DROPDOWN_TYPES.INPUT === type && (
|
|
208
|
+
- <DropdownInput placeholder={placeholder} />
|
|
209
|
+
- )}
|
|
210
|
+
- <DropdownMenu
|
|
211
|
+
- itemComponent={itemComponent}
|
|
212
|
+
- overrideStyles={overrideContainerStyles}
|
|
213
|
+
- />
|
|
214
|
+
+ <Manager>
|
|
215
|
+
+ <Reference>
|
|
216
|
+
+ {({ref}) => (
|
|
217
|
+
+ <div ref={ref}>
|
|
218
|
+
+ {DROPDOWN_TYPES.BUTTON === type && (
|
|
219
|
+
+ <DropdownButton
|
|
220
|
+
+ disabled={disabled}
|
|
221
|
+
+ overrideStyles={overrideButtonStyles}
|
|
222
|
+
+ placeholder={placeholder}
|
|
223
|
+
+ />
|
|
224
|
+
+ )}
|
|
225
|
+
+ {DROPDOWN_TYPES.INPUT === type && (
|
|
226
|
+
+ <DropdownInput placeholder={placeholder} />
|
|
227
|
+
+ )}
|
|
228
|
+
+ </div>
|
|
229
|
+
+ )}
|
|
230
|
+
+ </Reference>
|
|
231
|
+
+
|
|
232
|
+
+ <Popper placement={defaultPlacement || 'top'}>
|
|
233
|
+
+ {({ref, style, scheduleUpdate}) => (
|
|
234
|
+
+ <DropdownWrapper scheduleUpdate={scheduleUpdate}>
|
|
235
|
+
+ <div
|
|
236
|
+
+ ref={ref}
|
|
237
|
+
+ style={{
|
|
238
|
+
+ position: 'absolute',
|
|
239
|
+
+ width: '100%',
|
|
240
|
+
+ ...style,
|
|
241
|
+
+ }}
|
|
242
|
+
+ >
|
|
243
|
+
+ <DropdownMenu
|
|
244
|
+
+ itemComponent={itemComponent}
|
|
245
|
+
+ overrideStyles={overrideContainerStyles}
|
|
246
|
+
+ />
|
|
247
|
+
+ </div>
|
|
248
|
+
+ </DropdownWrapper>
|
|
249
|
+
+ )}
|
|
250
|
+
+ </Popper>
|
|
251
|
+
+ </Manager>
|
|
252
|
+
</>
|
|
253
|
+
)}
|
|
254
|
+
</DownshiftContext.Provider>
|
|
255
|
+
diff --git a/yarn.lock b/yarn.lock
|
|
256
|
+
index 519b93f..3c5f856 100644
|
|
257
|
+
--- a/yarn.lock
|
|
258
|
+
+++ b/yarn.lock
|
|
259
|
+
@@ -5123,6 +5123,14 @@ create-react-context@0.3.0, create-react-context@^0.3.0:
|
|
260
|
+
gud "^1.0.0"
|
|
261
|
+
warning "^4.0.3"
|
|
262
|
+
|
|
263
|
+
+create-react-context@<=0.2.2:
|
|
264
|
+
+ version "0.2.2"
|
|
265
|
+
+ resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca"
|
|
266
|
+
+ integrity sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A==
|
|
267
|
+
+ dependencies:
|
|
268
|
+
+ fbjs "^0.8.0"
|
|
269
|
+
+ gud "^1.0.0"
|
|
270
|
+
+
|
|
271
|
+
cross-spawn@6.0.5, cross-spawn@^6.0.0:
|
|
272
|
+
version "6.0.5"
|
|
273
|
+
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
|
|
274
|
+
@@ -6426,7 +6434,7 @@ fb-watchman@^2.0.0:
|
|
275
|
+
dependencies:
|
|
276
|
+
bser "2.1.1"
|
|
277
|
+
|
|
278
|
+
-fbjs@^0.8.4:
|
|
279
|
+
+fbjs@^0.8.0, fbjs@^0.8.4:
|
|
280
|
+
version "0.8.17"
|
|
281
|
+
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
|
|
282
|
+
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
|
|
283
|
+
@@ -11140,6 +11148,18 @@ react-popper-tooltip@^2.8.3:
|
|
284
|
+
"@babel/runtime" "^7.9.2"
|
|
285
|
+
react-popper "^1.3.7"
|
|
286
|
+
|
|
287
|
+
+react-popper@1.3.3:
|
|
288
|
+
+ version "1.3.3"
|
|
289
|
+
+ resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-1.3.3.tgz#2c6cef7515a991256b4f0536cd4bdcb58a7b6af6"
|
|
290
|
+
+ integrity sha512-ynMZBPkXONPc5K4P5yFWgZx5JGAUIP3pGGLNs58cfAPgK67olx7fmLp+AdpZ0+GoQ+ieFDa/z4cdV6u7sioH6w==
|
|
291
|
+
+ dependencies:
|
|
292
|
+
+ "@babel/runtime" "^7.1.2"
|
|
293
|
+
+ create-react-context "<=0.2.2"
|
|
294
|
+
+ popper.js "^1.14.4"
|
|
295
|
+
+ prop-types "^15.6.1"
|
|
296
|
+
+ typed-styles "^0.0.7"
|
|
297
|
+
+ warning "^4.0.2"
|
|
298
|
+
+
|
|
299
|
+
react-popper@^1.3.7:
|
|
300
|
+
version "1.3.7"
|
|
301
|
+
resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-1.3.7.tgz#f6a3471362ef1f0d10a4963673789de1baca2324"
|
|
302
|
+
--
|
|
303
|
+
2.20.1 (Apple Git-117)
|
|
304
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<h1 align="center">Freemium Ui</h1>
|
|
2
|
+
|
|
3
|
+
## [DEMO](https://freemium-ui.netlify.app)
|
|
4
|
+
|
|
5
|
+
[React](https://reactjs.org/) based light weight ui components based on [Styled Components](https://styled-components.com/)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Peer Dependencies to be installed
|
|
10
|
+
```
|
|
11
|
+
npm install styled-components
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Install the package
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
npm install @freshdesk/freemium-ui
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Please note that `@next` will only point to pre-releases; to get the latest stable release use `@latest` instead.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Here is a quick example to get you started, **it's all you need**:
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
import React from 'react';
|
|
29
|
+
import ReactDOM from 'react-dom';
|
|
30
|
+
import { Button } from 'freemium-ui';
|
|
31
|
+
|
|
32
|
+
function App() {
|
|
33
|
+
return (
|
|
34
|
+
<Button>
|
|
35
|
+
Freemium Button
|
|
36
|
+
</Button>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ReactDOM.render(<App />, document.querySelector('#app'));
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Contribution
|
|
44
|
+
|
|
45
|
+
Install Dependencies
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
npm install
|
|
49
|
+
```
|
|
50
|
+
Start the app using storybook
|
|
51
|
+
```
|
|
52
|
+
npm run storybook
|
|
53
|
+
```
|
|
54
|
+
Build Freemium Ui Core Components
|
|
55
|
+
```
|
|
56
|
+
npm run build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Generate a PAT with `admin:org`, `write:packages`, `read:packages`, `delete:packages`
|
|
60
|
+
|
|
61
|
+
Authenticate to npm github package
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
npm login --registry=https://registry.npmjs.org/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Publish the package to npm
|
|
68
|
+
```
|
|
69
|
+
npm publish
|
|
70
|
+
```
|