newspack-components 2.2.0 → 3.0.0-alpha.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 (197) hide show
  1. package/dist/cjs/action-card/index.js +3 -4
  2. package/dist/cjs/autocomplete-tokenfield/index.js +52 -15
  3. package/dist/cjs/autocomplete-tokenfield/style.scss +11 -5
  4. package/dist/cjs/autocomplete-with-suggestions/index.js +45 -57
  5. package/dist/cjs/autocomplete-with-suggestions/style.scss +1 -9
  6. package/dist/cjs/button/index.js +8 -9
  7. package/dist/cjs/button-card/index.js +1 -2
  8. package/dist/cjs/card/index.js +1 -2
  9. package/dist/cjs/category-autocomplete/index.js +4 -8
  10. package/dist/cjs/color-picker/index.js +7 -9
  11. package/dist/cjs/consts.js +2 -7
  12. package/dist/cjs/custom-select-control/index.js +1 -2
  13. package/dist/cjs/footer/index.js +24 -29
  14. package/dist/cjs/form-token-field/index.js +1 -2
  15. package/dist/cjs/global-notices/index.js +1 -2
  16. package/dist/cjs/grid/index.js +14 -31
  17. package/dist/cjs/handoff/index.js +7 -8
  18. package/dist/cjs/hooks/index.js +2 -3
  19. package/dist/cjs/hooks/useObjectState.js +1 -2
  20. package/dist/cjs/hooks/useOnClickOutside.js +1 -2
  21. package/dist/cjs/hooks/usePrompt.js +1 -4
  22. package/dist/cjs/image-upload/index.js +5 -6
  23. package/dist/cjs/index.js +0 -14
  24. package/dist/cjs/info-button/index.js +1 -2
  25. package/dist/cjs/modal/index.js +1 -2
  26. package/dist/cjs/newspack-icon/index.js +1 -2
  27. package/dist/cjs/newspack-logo/index.js +1 -2
  28. package/dist/cjs/notice/index.js +2 -3
  29. package/dist/cjs/patrons-logo/index.js +4 -5
  30. package/dist/cjs/plugin-installer/index.js +9 -13
  31. package/dist/cjs/plugin-settings/SettingsSection.js +2 -4
  32. package/dist/cjs/plugin-settings/index.js +2 -3
  33. package/dist/cjs/plugin-toggle/index.js +16 -20
  34. package/dist/cjs/popover/index.js +1 -2
  35. package/dist/cjs/position-control/index.js +22 -23
  36. package/dist/cjs/progress-bar/index.js +1 -2
  37. package/dist/cjs/progress-bar/index.test.js +4 -5
  38. package/dist/cjs/proxied-imports/router.js +1 -2
  39. package/dist/cjs/radio-control/index.js +1 -2
  40. package/dist/cjs/section-header/index.js +13 -14
  41. package/dist/cjs/section-header/style.scss +4 -0
  42. package/dist/cjs/select-control/ButtonGroupControl.js +10 -12
  43. package/dist/cjs/select-control/GroupedSelectControl.js +21 -25
  44. package/dist/cjs/select-control/index.js +1 -2
  45. package/dist/cjs/settings/MinMaxSetting.js +17 -15
  46. package/dist/cjs/settings/SettingsCard.js +10 -12
  47. package/dist/cjs/settings/SettingsSection.js +20 -24
  48. package/dist/cjs/settings/index.js +2 -3
  49. package/dist/cjs/settings/style.scss +14 -1
  50. package/dist/cjs/sortable-newsletter-list-control/index.js +134 -0
  51. package/dist/cjs/sortable-newsletter-list-control/style.scss +45 -0
  52. package/dist/cjs/steps-list/index.js +1 -2
  53. package/dist/cjs/steps-list-item/index.js +1 -2
  54. package/dist/cjs/style-card/index.js +6 -7
  55. package/dist/cjs/style.scss +13 -1
  56. package/dist/cjs/tabbed-navigation/index.js +11 -14
  57. package/dist/cjs/text-control/index.js +32 -42
  58. package/dist/cjs/utils/index.js +15 -19
  59. package/dist/cjs/waiting/index.js +1 -2
  60. package/dist/cjs/web-preview/index.js +7 -8
  61. package/dist/cjs/with-wizard/index.js +6 -7
  62. package/dist/cjs/with-wizard-screen/index.js +20 -24
  63. package/dist/cjs/wizard/components/WizardError.js +7 -9
  64. package/dist/cjs/wizard/index.js +16 -21
  65. package/dist/cjs/wizard/store/index.js +36 -37
  66. package/dist/cjs/wizard/store/utils.js +1 -4
  67. package/dist/esm/action-card/index.js +3 -4
  68. package/dist/esm/autocomplete-tokenfield/index.js +52 -15
  69. package/dist/esm/autocomplete-tokenfield/style.scss +11 -5
  70. package/dist/esm/autocomplete-with-suggestions/index.js +46 -59
  71. package/dist/esm/autocomplete-with-suggestions/style.scss +1 -9
  72. package/dist/esm/button/index.js +7 -7
  73. package/dist/esm/button-card/index.js +1 -2
  74. package/dist/esm/category-autocomplete/index.js +4 -8
  75. package/dist/esm/color-picker/index.js +7 -9
  76. package/dist/esm/consts.js +0 -2
  77. package/dist/esm/footer/index.js +24 -29
  78. package/dist/esm/form-token-field/index.js +1 -2
  79. package/dist/esm/grid/index.js +13 -29
  80. package/dist/esm/handoff/index.js +7 -8
  81. package/dist/esm/hooks/useObjectState.js +1 -2
  82. package/dist/esm/hooks/useObjectState.test.js +1 -2
  83. package/dist/esm/hooks/usePrompt.js +1 -4
  84. package/dist/esm/image-upload/index.js +5 -7
  85. package/dist/esm/index.js +0 -2
  86. package/dist/esm/notice/index.js +2 -3
  87. package/dist/esm/patrons-logo/index.js +4 -5
  88. package/dist/esm/plugin-installer/index.js +9 -14
  89. package/dist/esm/plugin-settings/SettingsSection.js +2 -4
  90. package/dist/esm/plugin-settings/index.js +2 -3
  91. package/dist/esm/plugin-toggle/index.js +16 -20
  92. package/dist/esm/position-control/index.js +23 -25
  93. package/dist/esm/progress-bar/index.js +1 -2
  94. package/dist/esm/progress-bar/index.test.js +4 -5
  95. package/dist/esm/section-header/index.js +13 -14
  96. package/dist/esm/section-header/style.scss +4 -0
  97. package/dist/esm/select-control/ButtonGroupControl.js +9 -10
  98. package/dist/esm/select-control/GroupedSelectControl.js +22 -27
  99. package/dist/esm/settings/MinMaxSetting.js +17 -16
  100. package/dist/esm/settings/SettingsCard.js +9 -10
  101. package/dist/esm/settings/SettingsSection.js +20 -24
  102. package/dist/esm/settings/style.scss +14 -1
  103. package/dist/esm/sortable-newsletter-list-control/index.js +128 -0
  104. package/dist/esm/sortable-newsletter-list-control/style.scss +45 -0
  105. package/dist/esm/steps-list-item/index.js +1 -2
  106. package/dist/esm/style-card/index.js +6 -7
  107. package/dist/esm/style.scss +13 -1
  108. package/dist/esm/tabbed-navigation/index.js +11 -14
  109. package/dist/esm/text-control/index.js +32 -41
  110. package/dist/esm/utils/index.js +13 -16
  111. package/dist/esm/web-preview/index.js +7 -8
  112. package/dist/esm/with-wizard/index.js +7 -9
  113. package/dist/esm/with-wizard-screen/index.js +21 -27
  114. package/dist/esm/wizard/components/WizardError.js +7 -9
  115. package/dist/esm/wizard/index.js +16 -22
  116. package/dist/esm/wizard/store/index.js +35 -35
  117. package/dist/esm/wizard/store/utils.js +1 -4
  118. package/package.json +7 -8
  119. package/shared/js/button-props.js +3 -1
  120. package/shared/scss/_colors.scss +15 -0
  121. package/shared/scss/_mixins.scss +12 -0
  122. package/src/autocomplete-tokenfield/index.js +48 -15
  123. package/src/autocomplete-tokenfield/style.scss +11 -5
  124. package/src/autocomplete-with-suggestions/index.js +17 -22
  125. package/src/autocomplete-with-suggestions/style.scss +1 -9
  126. package/src/button/{index.js → index.tsx} +12 -5
  127. package/src/consts.js +0 -2
  128. package/src/footer/index.js +7 -7
  129. package/src/grid/index.tsx +34 -0
  130. package/src/handoff/index.js +7 -6
  131. package/src/hooks/{index.js → index.ts} +1 -1
  132. package/src/hooks/{usePrompt.js → usePrompt.ts} +4 -8
  133. package/src/image-upload/index.js +4 -4
  134. package/src/index.js +0 -2
  135. package/src/notice/index.js +1 -1
  136. package/src/patrons-logo/index.js +4 -1
  137. package/src/plugin-installer/index.js +7 -7
  138. package/src/plugin-settings/index.js +1 -1
  139. package/src/plugin-toggle/index.js +7 -5
  140. package/src/position-control/index.js +13 -13
  141. package/src/section-header/index.js +3 -3
  142. package/src/section-header/style.scss +4 -0
  143. package/src/select-control/GroupedSelectControl.js +1 -1
  144. package/src/settings/MinMaxSetting.js +8 -6
  145. package/src/settings/style.scss +14 -1
  146. package/src/sortable-newsletter-list-control/index.js +137 -0
  147. package/src/sortable-newsletter-list-control/style.scss +45 -0
  148. package/src/style-card/index.js +11 -5
  149. package/src/style.scss +13 -1
  150. package/src/tabbed-navigation/index.js +1 -1
  151. package/src/text-control/index.tsx +65 -0
  152. package/src/web-preview/index.js +6 -6
  153. package/src/with-wizard/index.js +4 -4
  154. package/src/with-wizard-screen/index.js +1 -1
  155. package/src/wizard/components/WizardError.js +1 -1
  156. package/src/wizard/index.js +3 -3
  157. package/src/wizard/store/index.js +9 -2
  158. package/dist/cjs/accordion/index.js +0 -46
  159. package/dist/cjs/accordion/style.scss +0 -27
  160. package/dist/cjs/button-group/index.js +0 -57
  161. package/dist/cjs/button-group/style.scss +0 -73
  162. package/dist/cjs/checkbox-control/index.js +0 -63
  163. package/dist/cjs/checkbox-control/style.scss +0 -78
  164. package/dist/cjs/date-range-picker/index.js +0 -41
  165. package/dist/cjs/date-range-picker/style.scss +0 -148
  166. package/dist/cjs/preview-box/index.js +0 -36
  167. package/dist/cjs/preview-box/style.scss +0 -18
  168. package/dist/cjs/textarea-control/index.js +0 -54
  169. package/dist/cjs/textarea-control/style.scss +0 -76
  170. package/dist/cjs/toggle-control/index.js +0 -58
  171. package/dist/cjs/toggle-control/style.scss +0 -74
  172. package/dist/cjs/toggle-group/index.js +0 -71
  173. package/dist/cjs/toggle-group/style.scss +0 -28
  174. package/dist/cjs/wizard/style.scss +0 -148
  175. package/dist/esm/accordion/index.js +0 -38
  176. package/dist/esm/accordion/style.scss +0 -27
  177. package/dist/esm/button-group/index.js +0 -43
  178. package/dist/esm/button-group/style.scss +0 -73
  179. package/dist/esm/checkbox-control/index.js +0 -49
  180. package/dist/esm/checkbox-control/style.scss +0 -78
  181. package/dist/esm/date-range-picker/index.js +0 -32
  182. package/dist/esm/date-range-picker/style.scss +0 -148
  183. package/dist/esm/preview-box/index.js +0 -30
  184. package/dist/esm/preview-box/style.scss +0 -18
  185. package/dist/esm/textarea-control/index.js +0 -40
  186. package/dist/esm/textarea-control/style.scss +0 -76
  187. package/dist/esm/toggle-control/index.js +0 -44
  188. package/dist/esm/toggle-control/style.scss +0 -74
  189. package/dist/esm/toggle-group/index.js +0 -58
  190. package/dist/esm/toggle-group/style.scss +0 -28
  191. package/dist/esm/wizard/style.scss +0 -148
  192. package/src/accordion/index.js +0 -32
  193. package/src/accordion/style.scss +0 -27
  194. package/src/date-range-picker/index.js +0 -31
  195. package/src/date-range-picker/style.scss +0 -148
  196. package/src/grid/index.js +0 -44
  197. package/src/text-control/index.js +0 -56
@@ -1,38 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useState } from '@wordpress/element';
5
- import { Icon, chevronRight } from '@wordpress/icons';
6
-
7
- /**
8
- * External dependencies
9
- */
10
- import classNames from 'classnames';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import './style.scss';
16
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
17
- import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
18
- const Accordion = _ref => {
19
- let {
20
- children,
21
- title
22
- } = _ref;
23
- const [isOpen, setIsOpen] = useState(false);
24
- return _jsxs("details", {
25
- className: classNames('newspack-accordion', {
26
- 'newspack-accordion--is-open': isOpen
27
- }),
28
- children: [_jsxs("summary", {
29
- onClick: () => setIsOpen(!isOpen),
30
- children: [title, _jsx(Icon, {
31
- className: "newspack-accordion__icon",
32
- icon: chevronRight,
33
- size: 24
34
- })]
35
- }), children]
36
- });
37
- };
38
- export default Accordion;
@@ -1,27 +0,0 @@
1
- @use '~@wordpress/base-styles/colors' as wp-colors;
2
-
3
- .newspack-accordion {
4
- border: 1px solid wp-colors.$gray-300;
5
-
6
- &__icon {
7
- transition: transform 200ms ease-out;
8
- transform: rotate( 90deg );
9
- }
10
-
11
- &--is-open {
12
- .newspack-accordion {
13
- &__icon {
14
- transform: rotate( -90deg );
15
- }
16
- }
17
- }
18
- summary {
19
- padding: 16px 32px;
20
- display: flex;
21
- align-items: center;
22
- justify-content: space-between;
23
- cursor: pointer;
24
- font-size: 14px;
25
- font-weight: bold;
26
- }
27
- }
@@ -1,43 +0,0 @@
1
- /**
2
- * WordPress dependencies.
3
- */
4
- import { Component } from '@wordpress/element';
5
- import { ButtonGroup as BaseComponent } from '@wordpress/components';
6
- /**
7
- * Internal dependencies
8
- */
9
-
10
- import './style.scss';
11
- /**
12
- * External dependencies
13
- */
14
-
15
- import classnames from 'classnames';
16
- /**
17
- * Button Group.
18
- */
19
-
20
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
21
-
22
- class ButtonGroup extends Component {
23
- /**
24
- * Render.
25
- */
26
- render() {
27
- const {
28
- className,
29
- noMargin,
30
- ...otherProps
31
- } = this.props;
32
- const classes = classnames('newspack-button-group', {
33
- 'newspack-button-group--no-margin': noMargin
34
- }, className);
35
- return _jsx(BaseComponent, {
36
- className: classes,
37
- ...otherProps
38
- });
39
- }
40
-
41
- }
42
-
43
- export default ButtonGroup;
@@ -1,73 +0,0 @@
1
- /**
2
- * Button Group
3
- */
4
-
5
- @import '../../../shared/scss/colors';
6
- @import '~@wordpress/base-styles/colors';
7
-
8
- .newspack-button-group {
9
- display: block;
10
- &:not( .newspack-button-group--no-margin ) {
11
- margin: 32px 0;
12
- }
13
-
14
- .newspack-button {
15
- padding: 11px 17px !important;
16
- &:active,
17
- &:focus,
18
- &:hover,
19
- &.is-pressed {
20
- position: relative;
21
- }
22
-
23
- &.is-pressed {
24
- position: relative;
25
- z-index: 2;
26
- background-color: white !important;
27
- color: $gray-900 !important;
28
- border: none !important;
29
- &:focus {
30
- box-shadow: 0 0 0 1px white, 0 0 0 2px $primary-500 !important;
31
- }
32
- &:active,
33
- &:hover {
34
- background: $gray-100 !important;
35
- color: $primary-500 !important;
36
- }
37
- &::after {
38
- content: '';
39
- position: absolute;
40
- top: 0;
41
- left: 0;
42
- width: calc( 100% - 6px );
43
- height: calc( 100% - 6px );
44
- border: 3px solid $primary-500;
45
- }
46
- }
47
- }
48
- }
49
-
50
- body[class*='admin-color-'] {
51
- .newspack-button-group {
52
- .newspack-button {
53
- border-radius: 0;
54
- box-shadow: none;
55
-
56
- &:first-child {
57
- &,
58
- &::after {
59
- border-bottom-left-radius: 3px;
60
- border-top-left-radius: 3px;
61
- }
62
- }
63
-
64
- &:last-child {
65
- &,
66
- &::after {
67
- border-bottom-right-radius: 3px;
68
- border-top-right-radius: 3px;
69
- }
70
- }
71
- }
72
- }
73
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * Checkbox Control
3
- */
4
-
5
- /**
6
- * WordPress dependencies
7
- */
8
- import { Component } from '@wordpress/element';
9
- import { CheckboxControl as BaseComponent } from '@wordpress/components';
10
- /**
11
- * Internal dependencies
12
- */
13
-
14
- import { InfoButton } from '../';
15
- import './style.scss';
16
- /**
17
- * External dependencies
18
- */
19
-
20
- import classnames from 'classnames';
21
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
22
- import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
23
-
24
- class CheckboxControl extends Component {
25
- /**
26
- * Render.
27
- */
28
- render() {
29
- const {
30
- className,
31
- checked,
32
- tooltip,
33
- ...otherProps
34
- } = this.props;
35
- const classes = classnames('newspack-checkbox-control', className);
36
- return _jsxs("div", {
37
- className: classes,
38
- children: [_jsx(BaseComponent, {
39
- checked: Boolean(checked),
40
- ...otherProps
41
- }), tooltip && _jsx(InfoButton, {
42
- text: tooltip
43
- })]
44
- });
45
- }
46
-
47
- }
48
-
49
- export default CheckboxControl;
@@ -1,78 +0,0 @@
1
- /**
2
- * Checkbox styles.
3
- */
4
-
5
- @import '../../../shared/scss/colors';
6
- @import '~@wordpress/base-styles/colors';
7
-
8
- .newspack-checkbox-control {
9
- color: $gray-700;
10
- display: flex;
11
- font-size: 14px;
12
- line-height: 24px;
13
- margin: 32px 0;
14
-
15
- label {
16
- color: inherit;
17
- font-size: inherit;
18
- line-height: inherit;
19
- margin: 0;
20
- }
21
-
22
- .components-checkbox-control__input-container {
23
- display: block;
24
- margin: 0;
25
- margin-right: 8px;
26
-
27
- @media screen and ( min-width: 600px ) {
28
- margin-bottom: 2px;
29
- margin-top: 2px;
30
- }
31
- }
32
-
33
- .components-checkbox-control__input[type='checkbox'] {
34
- margin: 0;
35
-
36
- &:checked {
37
- background-color: $primary-500;
38
- border-color: $primary-500;
39
- }
40
-
41
- &:focus {
42
- border-color: $primary-500;
43
- box-shadow: 0 0 0 2px white, 0 0 0 3.5px $primary-500;
44
- }
45
- }
46
-
47
- .components-base-control__help {
48
- color: inherit;
49
- font-size: inherit;
50
- font-style: italic;
51
- line-height: inherit;
52
- margin: 0;
53
- margin-left: 28px;
54
- }
55
-
56
- // Multiple Checkbox Controls
57
-
58
- & + & {
59
- margin-top: -16px;
60
- }
61
-
62
- // Reset
63
-
64
- .components-base-control {
65
- font-size: inherit;
66
- line-height: inherit;
67
- }
68
-
69
- .components-base-control__field {
70
- display: flex;
71
- margin: 0;
72
- }
73
-
74
- .components-base-control__label {
75
- display: block;
76
- margin: 0;
77
- }
78
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * External dependencies.
3
- */
4
- import { default as ReactDateRangePicker } from 'react-daterange-picker';
5
- import origMoment from 'moment';
6
- import { extendMoment } from 'moment-range';
7
- import 'react-daterange-picker/dist/css/react-calendar.css';
8
-
9
- /**
10
- * Internal dependencies.
11
- */
12
- import './style.scss';
13
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
14
- const moment = extendMoment(origMoment);
15
- const DateRangePicker = _ref => {
16
- let {
17
- start,
18
- end,
19
- onChange
20
- } = _ref;
21
- return _jsx(ReactDateRangePicker, {
22
- value: moment.range(moment(start), moment(end)),
23
- firstOfWeek: 1,
24
- onSelect: range => {
25
- onChange({
26
- start: range.start._d,
27
- end: range.end._d
28
- });
29
- }
30
- });
31
- };
32
- export default DateRangePicker;
@@ -1,148 +0,0 @@
1
- @use '../../../shared/scss/colors';
2
- @use '~@wordpress/base-styles/colors' as wp-colors;
3
-
4
- .DateRangePicker {
5
- margin: 32px 0;
6
- max-width: 296px;
7
- width: 100%;
8
-
9
- &__PaginationArrow {
10
- background: transparent 50% 50% no-repeat;
11
- background-size: 24px 24px;
12
- border-radius: 3px;
13
- height: 36px;
14
- transition: background-image 125ms ease-in-out;
15
- width: 36px;
16
-
17
- &--previous {
18
- background-image: url( 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" fill="%231e1e1e"/%3E%3C/svg%3E' );
19
- left: 0;
20
-
21
- &:hover {
22
- background-image: url( 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" fill="%2336f"/%3E%3C/svg%3E' );
23
- }
24
- }
25
-
26
- &--next {
27
- background-image: url( 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" fill="%231e1e1e"/%3E%3C/svg%3E' );
28
- right: 0;
29
-
30
- &:hover {
31
- background-image: url( 'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" fill="%2336f"/%3E%3C/svg%3E' );
32
- }
33
- }
34
-
35
- &:hover {
36
- background-color: transparent;
37
- }
38
- }
39
-
40
- &__PaginationArrowIcon {
41
- display: none;
42
- }
43
-
44
- &__Month {
45
- margin: 0;
46
- width: inherit;
47
- }
48
-
49
- &__MonthHeader {
50
- color: wp-colors.$gray-900;
51
- font-size: 17px;
52
- height: auto;
53
- line-height: 24px;
54
- padding: 6px 44px;
55
- }
56
-
57
- &__WeekdayHeading,
58
- &__Date {
59
- font-size: 14px;
60
- line-height: 24px;
61
- padding: 6px 0;
62
- }
63
-
64
- &__WeekdayHeading {
65
- border-bottom-color: wp-colors.$gray-300;
66
- color: wp-colors.$gray-900;
67
-
68
- abbr[title] {
69
- color: inherit;
70
- }
71
- }
72
-
73
- &__MonthDates {
74
- border: 0;
75
- border-spacing: 0;
76
- }
77
-
78
- &__Date {
79
- border-color: wp-colors.$gray-300;
80
- border-bottom-width: 1px;
81
-
82
- &--weekend {
83
- background-color: wp-colors.$gray-100;
84
- }
85
-
86
- &--otherMonth {
87
- color: wp-colors.$gray-200;
88
- opacity: 1;
89
- }
90
-
91
- &--is-disabled {
92
- color: wp-colors.$gray-100;
93
- cursor: not-allowed;
94
- }
95
-
96
- &--is-highlighted {
97
- color: white;
98
- }
99
- }
100
-
101
- &__CalendarSelection,
102
- &__CalendarHighlight {
103
- border-color: colors.$primary-500;
104
- bottom: 4px;
105
- top: 4px;
106
-
107
- &--inOtherMonth {
108
- opacity: 1;
109
- }
110
-
111
- &--start {
112
- border-bottom-left-radius: 3px;
113
- border-top-left-radius: 3px;
114
- left: 4px;
115
- }
116
-
117
- &--end {
118
- border-bottom-right-radius: 3px;
119
- border-top-right-radius: 3px;
120
- right: 4px;
121
- }
122
-
123
- &--single {
124
- border: none;
125
- border-radius: 3px;
126
- left: 4px;
127
- right: 4px;
128
- }
129
- }
130
-
131
- &__CalendarSelection {
132
- background-color: colors.$primary-500;
133
- }
134
-
135
- &__CalendarHighlight {
136
- background: colors.$primary-500;
137
- border: none;
138
- bottom: 0;
139
- top: 0;
140
-
141
- &--single {
142
- border: none;
143
- border-radius: 0;
144
- left: 0;
145
- right: 0;
146
- }
147
- }
148
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ as alias__ } from '@wordpress/i18n';
5
- /**
6
- * Internal dependencies
7
- */
8
-
9
- const __ = alias__;
10
- import './style.scss';
11
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
12
- import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
13
-
14
- const PreviewBox = _ref => {
15
- let {
16
- children
17
- } = _ref;
18
- return _jsxs("div", {
19
- className: "newspack-preview-box",
20
- children: [_jsx("div", {
21
- className: "newspack-preview-box__label",
22
- children: __('Preview', 'newspack')
23
- }), _jsx("div", {
24
- className: "newspack-preview-box__content",
25
- children: children
26
- })]
27
- });
28
- };
29
-
30
- export default PreviewBox;
@@ -1,18 +0,0 @@
1
- @import '../../../shared/scss/colors';
2
- @import '~@wordpress/base-styles/colors';
3
-
4
- .newspack-preview-box {
5
- margin: 32px 0;
6
-
7
- &__label {
8
- color: $gray-900;
9
- font-weight: bold;
10
- }
11
-
12
- &__content {
13
- background: $gray-100;
14
- border: 1px solid $gray-300;
15
- border-radius: 3px;
16
- padding: 11px 8px;
17
- }
18
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * Textarea Control
3
- */
4
-
5
- /**
6
- * WordPress dependencies
7
- */
8
- import { TextareaControl as BaseComponent } from '@wordpress/components';
9
- import { Component } from '@wordpress/element';
10
- /**
11
- * Internal dependencies
12
- */
13
-
14
- import './style.scss';
15
- /**
16
- * External dependencies
17
- */
18
-
19
- import classnames from 'classnames';
20
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
21
-
22
- class TextareaControl extends Component {
23
- /**
24
- * Render.
25
- */
26
- render() {
27
- const {
28
- className,
29
- ...otherProps
30
- } = this.props;
31
- const classes = classnames('newspack-textarea-control', className);
32
- return _jsx(BaseComponent, {
33
- className: classes,
34
- ...otherProps
35
- });
36
- }
37
-
38
- }
39
-
40
- export default TextareaControl;
@@ -1,76 +0,0 @@
1
- /**
2
- * Textarea Control
3
- */
4
-
5
- @import '../../../shared/scss/colors';
6
- @import '~@wordpress/base-styles/colors';
7
-
8
- .newspack-textarea-control {
9
- color: $gray-700;
10
- font-size: 14px;
11
- line-height: 24px;
12
- margin: 32px 0;
13
-
14
- label {
15
- color: $gray-900;
16
- font-size: 14px;
17
- font-weight: bold;
18
- line-height: 24px;
19
- margin: 0;
20
- }
21
-
22
- textarea {
23
- background: white;
24
- border: 1px solid $gray-300;
25
- border-radius: 3px;
26
- box-shadow: none;
27
- color: inherit;
28
- display: block;
29
- font-size: 16px;
30
- line-height: inherit;
31
- margin: 0;
32
- min-height: 48px;
33
- padding: 11px 8px;
34
- transition: border-color 125ms ease-in-out, box-shadow 125ms ease-in-out;
35
- width: 100%;
36
-
37
- @media screen and ( min-width: 768px ) {
38
- font-size: 14px;
39
- }
40
-
41
- &:focus {
42
- border-color: $primary-500;
43
- box-shadow: inset 0 0 0 2px $primary-500;
44
- }
45
-
46
- &:disabled,
47
- &.disabled {
48
- background: $gray-100;
49
- color: $gray-600;
50
- cursor: not-allowed;
51
- }
52
- }
53
-
54
- // Multiple Textarea Controls
55
-
56
- & + & {
57
- margin-bottom: 32px;
58
- margin-top: -24px;
59
- }
60
-
61
- // Multiple Controls
62
-
63
- + .newspack-select-control,
64
- + .newspack-text-control {
65
- margin-bottom: 32px;
66
- margin-top: -24px;
67
- }
68
-
69
- // Reset
70
-
71
- .components-base-control__field,
72
- .components-base-control__label {
73
- display: block;
74
- margin: 0;
75
- }
76
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * Toggle Control
3
- */
4
-
5
- /**
6
- * WordPress dependencies
7
- */
8
- import { ToggleControl as BaseComponent } from '@wordpress/components';
9
- import { Component } from '@wordpress/element';
10
- /**
11
- * Internal dependencies
12
- */
13
-
14
- import './style.scss';
15
- /**
16
- * External dependencies
17
- */
18
-
19
- import classNames from 'classnames';
20
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
21
-
22
- class ToggleControl extends Component {
23
- /**
24
- * Render.
25
- */
26
- render() {
27
- const {
28
- className,
29
- isDark,
30
- checked,
31
- ...otherProps
32
- } = this.props;
33
- const classes = classNames('newspack-toggle-control', isDark && 'newspack-toggle-control--is-dark', // NOTE: disabled prop is handled in more recent Gutenberg versions. This special handling can be removed once that's in Core.
34
- otherProps.disabled && 'newspack-toggle-control--is-disabled', className);
35
- return _jsx(BaseComponent, {
36
- className: classes,
37
- checked: Boolean(checked),
38
- ...otherProps
39
- });
40
- }
41
-
42
- }
43
-
44
- export default ToggleControl;