@toptal/picasso-outlined-input 1.1.5 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist-package/src/OutlinedInput/OutlinedInput.d.ts +1 -48
  2. package/dist-package/src/OutlinedInput/OutlinedInput.d.ts.map +1 -1
  3. package/dist-package/src/OutlinedInput/OutlinedInput.js +58 -35
  4. package/dist-package/src/OutlinedInput/OutlinedInput.js.map +1 -1
  5. package/dist-package/src/OutlinedInput/index.d.ts +2 -1
  6. package/dist-package/src/OutlinedInput/index.d.ts.map +1 -1
  7. package/dist-package/src/OutlinedInput/stylesInput.d.ts +24 -0
  8. package/dist-package/src/OutlinedInput/stylesInput.d.ts.map +1 -0
  9. package/dist-package/src/OutlinedInput/stylesInput.js +60 -0
  10. package/dist-package/src/OutlinedInput/stylesInput.js.map +1 -0
  11. package/dist-package/src/OutlinedInput/stylesRoot.d.ts +66 -0
  12. package/dist-package/src/OutlinedInput/stylesRoot.d.ts.map +1 -0
  13. package/dist-package/src/OutlinedInput/stylesRoot.js +142 -0
  14. package/dist-package/src/OutlinedInput/stylesRoot.js.map +1 -0
  15. package/dist-package/src/OutlinedInput/types.d.ts +62 -0
  16. package/dist-package/src/OutlinedInput/types.d.ts.map +1 -0
  17. package/dist-package/src/OutlinedInput/types.js +2 -0
  18. package/dist-package/src/OutlinedInput/types.js.map +1 -0
  19. package/dist-package/src/OutlinedInput/utils.d.ts +2 -0
  20. package/dist-package/src/OutlinedInput/utils.d.ts.map +1 -0
  21. package/dist-package/src/OutlinedInput/utils.js +2 -0
  22. package/dist-package/src/OutlinedInput/utils.js.map +1 -0
  23. package/package.json +11 -10
  24. package/src/OutlinedInput/OutlinedInput.tsx +95 -129
  25. package/src/OutlinedInput/index.ts +2 -1
  26. package/src/OutlinedInput/stylesInput.test.ts +152 -0
  27. package/src/OutlinedInput/stylesInput.ts +87 -0
  28. package/src/OutlinedInput/stylesRoot.test.ts +195 -0
  29. package/src/OutlinedInput/stylesRoot.ts +217 -0
  30. package/src/OutlinedInput/types.ts +87 -0
  31. package/src/OutlinedInput/utils.ts +2 -0
  32. package/dist-package/src/OutlinedInput/styles.d.ts +0 -4
  33. package/dist-package/src/OutlinedInput/styles.d.ts.map +0 -1
  34. package/dist-package/src/OutlinedInput/styles.js +0 -157
  35. package/dist-package/src/OutlinedInput/styles.js.map +0 -1
  36. package/dist-package/src/styles.d.ts +0 -2
  37. package/dist-package/src/styles.d.ts.map +0 -1
  38. package/dist-package/src/styles.js +0 -2
  39. package/dist-package/src/styles.js.map +0 -1
  40. package/src/OutlinedInput/styles.ts +0 -183
  41. package/src/styles.ts +0 -1
@@ -1,183 +0,0 @@
1
- import type { Theme } from '@material-ui/core/styles'
2
- import { createStyles } from '@material-ui/core/styles'
3
- import { darken, outline, alpha } from '@toptal/picasso-shared'
4
- import { PicassoProvider } from '@toptal/picasso-provider'
5
-
6
- PicassoProvider.override(
7
- ({ palette, sizes: { input, borderRadius } }: Theme) => ({
8
- MuiOutlinedInput: {
9
- root: {
10
- width: input.width,
11
- color: palette.common.black,
12
-
13
- '& $notchedOutline': {
14
- borderColor: palette.grey.light2,
15
- borderRadius: borderRadius.small,
16
- top: 0,
17
- '& legend': {
18
- height: 0,
19
- },
20
- },
21
-
22
- '&$focused': {
23
- '& $notchedOutline': {
24
- borderWidth: '1px',
25
- borderColor: palette.blue.main,
26
- ...outline(palette.primary.main),
27
- },
28
- },
29
-
30
- '&$disabled': {
31
- '& $notchedOutline': {
32
- borderColor: palette.grey.lighter2,
33
- },
34
- backgroundColor: palette.grey.lighter,
35
- color: palette.grey.main,
36
- },
37
-
38
- '&:hover:not($disabled)': {
39
- '&:not($error)&:not($focused) $notchedOutline': {
40
- borderColor: palette.grey.main2,
41
- },
42
- },
43
- },
44
- input: {
45
- display: 'flex',
46
- alignItems: 'center',
47
- boxSizing: 'border-box',
48
- height: '100%',
49
- padding: 0,
50
- border: 'none',
51
-
52
- '&::placeholder': {
53
- color: palette.grey.main2,
54
- opacity: 1,
55
- },
56
-
57
- '&$disabled': {
58
- color: palette.grey.main2,
59
- // On Safari the text gets a bit lighter as if it had some transparency applied to it
60
- // We need this webkit-specific property to achieve the exact font color
61
- '-webkit-text-fill-color': palette.grey.main2,
62
- '&::placeholder': {
63
- color: palette.grey.main2,
64
- opacity: 1,
65
- },
66
- },
67
- },
68
- inputMultiline: {
69
- padding: 0,
70
- },
71
- multiline: {
72
- padding: 0,
73
- },
74
- error: {
75
- backgroundColor: 'transparent',
76
- color: palette.common.black,
77
- '&$focused': {
78
- '& $notchedOutline': {
79
- borderWidth: '1px',
80
- borderColor: palette.red.main,
81
- ...outline(palette.red.main),
82
- },
83
- },
84
- },
85
- },
86
- })
87
- )
88
-
89
- export default ({ palette, sizes: { input } }: Theme) =>
90
- createStyles({
91
- root: {
92
- cursor: 'inherit',
93
- gap: '0.25rem 0.5rem',
94
-
95
- '&:hover': {
96
- '& $resetButtonDirty': {
97
- visibility: 'visible',
98
- },
99
- '& $notchedOutline$notchedOutlineDark': {
100
- ...outline(palette.common.white),
101
- },
102
- },
103
- '&$focused': {
104
- '& $notchedOutline$notchedOutlineDark': {
105
- ...outline(palette.common.white),
106
- },
107
- },
108
- '&$error': {
109
- backgroundColor: palette.common.white,
110
- },
111
- },
112
- hidden: {
113
- display: 'none',
114
- },
115
-
116
- rootSmall: {
117
- padding: '0.25rem 0.625rem',
118
- height: '1.5rem',
119
- },
120
- rootMedium: {
121
- padding: input.padding,
122
- height: input.height,
123
- },
124
- rootLarge: {
125
- padding: '0.75rem',
126
- height: '3rem',
127
- },
128
- rootFull: {
129
- width: '100%',
130
- },
131
- rootShrink: {
132
- width: 'auto',
133
- },
134
- rootAuto: {},
135
- focused: {},
136
- input: {
137
- cursor: 'inherit',
138
-
139
- '&:focus + $resetButtonDirty': {
140
- visibility: 'visible',
141
- },
142
- },
143
- inputSmall: {
144
- fontSize: '0.75rem',
145
- lineHeight: '1rem',
146
- },
147
- inputMedium: {
148
- fontSize: '0.875rem',
149
- lineHeight: '1rem',
150
- },
151
- inputLarge: {
152
- fontSize: '1rem',
153
- lineHeight: '1rem',
154
- },
155
- inputMultiline: {},
156
- resetButton: {
157
- visibility: 'hidden',
158
- },
159
- resetButtonDirty: {},
160
- rootDark: {
161
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
162
- backgroundColor: `${darken(palette.blue.darker!, 0.5)} !important`,
163
- },
164
- notchedOutline: {},
165
- notchedOutlineDark: {
166
- border: 'none',
167
- },
168
- inputDark: {
169
- color: palette.common.white,
170
- '&::placeholder': {
171
- color: palette.common.white,
172
- opacity: 0.64,
173
- },
174
- },
175
- highlightAutofill: {
176
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
177
- backgroundColor: alpha(palette.yellow.lighter!, 0.6),
178
- },
179
- horizontalLayout: {
180
- width: '100%',
181
- },
182
- error: {},
183
- })
package/src/styles.ts DELETED
@@ -1 +0,0 @@
1
- import {} from './OutlinedInput/styles'