@pie-lib/config-ui 13.1.0-beta.9 → 14.0.0-next.36

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 (167) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +11 -0
  2. package/dist/alert-dialog.d.ts +44 -0
  3. package/dist/alert-dialog.js +47 -0
  4. package/dist/checkbox.d.ts +34 -0
  5. package/dist/checkbox.js +57 -0
  6. package/dist/choice-configuration/feedback-menu.d.ts +32 -0
  7. package/dist/choice-configuration/feedback-menu.js +85 -0
  8. package/dist/choice-configuration/index.d.ts +62 -0
  9. package/dist/choice-configuration/index.js +240 -0
  10. package/dist/choice-utils.d.ts +21 -0
  11. package/dist/choice-utils.js +15 -0
  12. package/dist/feedback-config/feedback-selector.d.ts +33 -0
  13. package/dist/feedback-config/feedback-selector.js +92 -0
  14. package/dist/feedback-config/group.d.ts +21 -0
  15. package/dist/feedback-config/group.js +33 -0
  16. package/dist/feedback-config/index.d.ts +48 -0
  17. package/dist/feedback-config/index.js +96 -0
  18. package/dist/form-section.d.ts +25 -0
  19. package/dist/form-section.js +25 -0
  20. package/dist/fraction-to-number.d.ts +7 -0
  21. package/dist/fraction-to-number.js +9 -0
  22. package/dist/help.d.ts +41 -0
  23. package/dist/help.js +62 -0
  24. package/dist/index.d.ts +31 -0
  25. package/dist/index.js +34 -0
  26. package/dist/input.d.ts +29 -0
  27. package/dist/input.js +65 -0
  28. package/dist/inputs.d.ts +63 -0
  29. package/dist/inputs.js +70 -0
  30. package/dist/langs.d.ts +41 -0
  31. package/dist/langs.js +76 -0
  32. package/dist/layout/config-layout.d.ts +10 -0
  33. package/dist/layout/config-layout.js +75 -0
  34. package/dist/layout/index.d.ts +11 -0
  35. package/dist/layout/index.js +10 -0
  36. package/dist/layout/layout-contents.d.ts +21 -0
  37. package/dist/layout/layout-contents.js +70 -0
  38. package/dist/layout/settings-box.d.ts +19 -0
  39. package/dist/layout/settings-box.js +32 -0
  40. package/dist/mui-box/index.d.ts +21 -0
  41. package/dist/mui-box/index.js +47 -0
  42. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js +12 -0
  43. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +7 -0
  44. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
  45. package/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +8 -0
  46. package/dist/node_modules/.bun/react-measure@2.5.2_6dbf9a050bc9aadb/node_modules/react-measure/dist/index.esm.js +122 -0
  47. package/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js +276 -0
  48. package/dist/number-text-field-custom.d.ts +51 -0
  49. package/dist/number-text-field-custom.js +192 -0
  50. package/dist/number-text-field.d.ts +47 -0
  51. package/dist/number-text-field.js +122 -0
  52. package/dist/radio-with-label.d.ts +25 -0
  53. package/dist/radio-with-label.js +27 -0
  54. package/dist/settings/display-size.d.ts +26 -0
  55. package/dist/settings/display-size.js +45 -0
  56. package/dist/settings/index.d.ts +45 -0
  57. package/dist/settings/index.js +63 -0
  58. package/dist/settings/panel.d.ts +27 -0
  59. package/dist/settings/panel.js +201 -0
  60. package/dist/settings/settings-radio-label.d.ts +25 -0
  61. package/dist/settings/settings-radio-label.js +29 -0
  62. package/dist/settings/toggle.d.ts +25 -0
  63. package/dist/settings/toggle.js +33 -0
  64. package/dist/tabs/index.d.ts +22 -0
  65. package/dist/tabs/index.js +39 -0
  66. package/dist/tags-input/index.d.ts +21 -0
  67. package/dist/tags-input/index.js +83 -0
  68. package/dist/two-choice.d.ts +43 -0
  69. package/dist/two-choice.js +79 -0
  70. package/dist/with-stateful-model.d.ts +42 -0
  71. package/dist/with-stateful-model.js +32 -0
  72. package/package.json +31 -19
  73. package/CHANGELOG.json +0 -32
  74. package/CHANGELOG.md +0 -2419
  75. package/lib/alert-dialog.js +0 -68
  76. package/lib/alert-dialog.js.map +0 -1
  77. package/lib/checkbox.js +0 -84
  78. package/lib/checkbox.js.map +0 -1
  79. package/lib/choice-configuration/feedback-menu.js +0 -129
  80. package/lib/choice-configuration/feedback-menu.js.map +0 -1
  81. package/lib/choice-configuration/index.js +0 -381
  82. package/lib/choice-configuration/index.js.map +0 -1
  83. package/lib/choice-utils.js +0 -42
  84. package/lib/choice-utils.js.map +0 -1
  85. package/lib/feedback-config/feedback-selector.js +0 -155
  86. package/lib/feedback-config/feedback-selector.js.map +0 -1
  87. package/lib/feedback-config/group.js +0 -61
  88. package/lib/feedback-config/group.js.map +0 -1
  89. package/lib/feedback-config/index.js +0 -146
  90. package/lib/feedback-config/index.js.map +0 -1
  91. package/lib/form-section.js +0 -44
  92. package/lib/form-section.js.map +0 -1
  93. package/lib/help.js +0 -106
  94. package/lib/help.js.map +0 -1
  95. package/lib/index.js +0 -186
  96. package/lib/index.js.map +0 -1
  97. package/lib/input.js +0 -106
  98. package/lib/input.js.map +0 -1
  99. package/lib/inputs.js +0 -105
  100. package/lib/inputs.js.map +0 -1
  101. package/lib/langs.js +0 -136
  102. package/lib/langs.js.map +0 -1
  103. package/lib/layout/config-layout.js +0 -137
  104. package/lib/layout/config-layout.js.map +0 -1
  105. package/lib/layout/index.js +0 -21
  106. package/lib/layout/index.js.map +0 -1
  107. package/lib/layout/layout-contents.js +0 -160
  108. package/lib/layout/layout-contents.js.map +0 -1
  109. package/lib/layout/settings-box.js +0 -57
  110. package/lib/layout/settings-box.js.map +0 -1
  111. package/lib/mui-box/index.js +0 -63
  112. package/lib/mui-box/index.js.map +0 -1
  113. package/lib/number-text-field-custom.js +0 -376
  114. package/lib/number-text-field-custom.js.map +0 -1
  115. package/lib/number-text-field.js +0 -229
  116. package/lib/number-text-field.js.map +0 -1
  117. package/lib/radio-with-label.js +0 -48
  118. package/lib/radio-with-label.js.map +0 -1
  119. package/lib/settings/display-size.js +0 -61
  120. package/lib/settings/display-size.js.map +0 -1
  121. package/lib/settings/index.js +0 -110
  122. package/lib/settings/index.js.map +0 -1
  123. package/lib/settings/panel.js +0 -392
  124. package/lib/settings/panel.js.map +0 -1
  125. package/lib/settings/settings-radio-label.js +0 -51
  126. package/lib/settings/settings-radio-label.js.map +0 -1
  127. package/lib/settings/toggle.js +0 -63
  128. package/lib/settings/toggle.js.map +0 -1
  129. package/lib/tabs/index.js +0 -75
  130. package/lib/tabs/index.js.map +0 -1
  131. package/lib/tags-input/index.js +0 -149
  132. package/lib/tags-input/index.js.map +0 -1
  133. package/lib/two-choice.js +0 -136
  134. package/lib/two-choice.js.map +0 -1
  135. package/lib/with-stateful-model.js +0 -61
  136. package/lib/with-stateful-model.js.map +0 -1
  137. package/src/alert-dialog.jsx +0 -75
  138. package/src/checkbox.jsx +0 -61
  139. package/src/choice-configuration/feedback-menu.jsx +0 -96
  140. package/src/choice-configuration/index.jsx +0 -357
  141. package/src/choice-utils.js +0 -30
  142. package/src/feedback-config/feedback-selector.jsx +0 -112
  143. package/src/feedback-config/group.jsx +0 -51
  144. package/src/feedback-config/index.jsx +0 -111
  145. package/src/form-section.jsx +0 -31
  146. package/src/help.jsx +0 -79
  147. package/src/index.js +0 -55
  148. package/src/input.jsx +0 -72
  149. package/src/inputs.jsx +0 -69
  150. package/src/langs.jsx +0 -111
  151. package/src/layout/config-layout.jsx +0 -103
  152. package/src/layout/index.js +0 -4
  153. package/src/layout/layout-contents.jsx +0 -117
  154. package/src/layout/settings-box.jsx +0 -32
  155. package/src/mui-box/index.jsx +0 -56
  156. package/src/number-text-field-custom.jsx +0 -333
  157. package/src/number-text-field.jsx +0 -215
  158. package/src/radio-with-label.jsx +0 -30
  159. package/src/settings/display-size.jsx +0 -53
  160. package/src/settings/index.js +0 -83
  161. package/src/settings/panel.jsx +0 -333
  162. package/src/settings/settings-radio-label.jsx +0 -32
  163. package/src/settings/toggle.jsx +0 -46
  164. package/src/tabs/index.jsx +0 -47
  165. package/src/tags-input/index.jsx +0 -116
  166. package/src/two-choice.jsx +0 -90
  167. package/src/with-stateful-model.jsx +0 -36
@@ -1,32 +0,0 @@
1
- import FormControlLabel from '@mui/material/FormControlLabel';
2
- import Radio from '@mui/material/Radio';
3
- import React from 'react';
4
- import PropTypes from 'prop-types';
5
- import { styled } from '@mui/material/styles';
6
- import { color } from '@pie-lib/render-ui';
7
-
8
- const StyledFormControlLabel = styled(FormControlLabel)(({ theme }) => ({
9
- '& .MuiFormControlLabel-label': {
10
- color: 'rgba(0, 0, 0, 0.89)',
11
- fontSize: theme.typography.fontSize - 2,
12
- left: '-5px',
13
- position: 'relative',
14
- },
15
- }));
16
-
17
- const StyledRadio = styled(Radio)(() => ({
18
- color: `${color.tertiary()} !important`,
19
- }));
20
-
21
- const SettingsRadioLabel = ({ label, value, checked, onChange }) => (
22
- <StyledFormControlLabel value={value} control={<StyledRadio checked={checked} onChange={onChange} />} label={label} />
23
- );
24
-
25
- SettingsRadioLabel.propTypes = {
26
- label: PropTypes.string,
27
- value: PropTypes.string,
28
- checked: PropTypes.bool,
29
- onChange: PropTypes.func,
30
- };
31
-
32
- export default SettingsRadioLabel;
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import InputLabel from '@mui/material/InputLabel';
4
- import { styled } from '@mui/material/styles';
5
- import Switch from '@mui/material/Switch';
6
- import { color } from '@pie-lib/render-ui';
7
-
8
- const StyledToggle = styled('div')(() => ({
9
- display: 'flex',
10
- width: '100%',
11
- justifyContent: 'space-between',
12
- }));
13
-
14
- const StyledInputLabel = styled(InputLabel)(({ theme }) => ({
15
- color: 'rgba(0, 0, 0, 0.89)',
16
- fontSize: theme.typography.fontSize,
17
- paddingTop: theme.spacing(2),
18
- }));
19
-
20
- const StyledSwitch = styled(Switch)(({ checked }) => ({
21
- '&.Mui-checked .MuiSwitch-thumb': {
22
- color: `${color.tertiary()} !important`,
23
- },
24
- '&.Mui-checked .MuiSwitch-track': {
25
- backgroundColor: `${color.tertiaryLight()} !important`,
26
- },
27
- '& .MuiSwitch-track': {
28
- backgroundColor: checked ? `${color.tertiaryLight()} !important` : undefined,
29
- },
30
- }));
31
-
32
- const Toggle = ({ checked, disabled, label, toggle }) => (
33
- <StyledToggle>
34
- <StyledInputLabel>{label}</StyledInputLabel>
35
- <StyledSwitch checked={checked} disabled={disabled} onChange={(e) => toggle(e.target.checked)} />
36
- </StyledToggle>
37
- );
38
-
39
- Toggle.propTypes = {
40
- checked: PropTypes.bool,
41
- disabled: PropTypes.bool,
42
- label: PropTypes.string.isRequired,
43
- toggle: PropTypes.func.isRequired,
44
- };
45
-
46
- export default Toggle;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
-
3
- import MuiTabs from '@mui/material/Tabs';
4
- import MuiTab from '@mui/material/Tab';
5
- import PropTypes from 'prop-types';
6
- import { styled } from '@mui/material/styles';
7
-
8
- const StyledMuiTab = styled(MuiTab)(() => ({}));
9
-
10
- export class Tabs extends React.Component {
11
- static propTypes = {
12
- className: PropTypes.string,
13
- contentClassName: PropTypes.string,
14
- contentStyle: PropTypes.object,
15
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
16
- };
17
-
18
- constructor(props) {
19
- super(props);
20
- this.state = { value: 0 };
21
- }
22
-
23
- handleChange = (event, value) => {
24
- this.setState({ value });
25
- };
26
-
27
- render() {
28
- const { value } = this.state;
29
- const { children, className, contentClassName, contentStyle = {} } = this.props;
30
-
31
- return (
32
- <div className={className}>
33
- <MuiTabs indicatorColor="primary" value={value} onChange={this.handleChange}>
34
- {React.Children.map(children, (c, index) =>
35
- c && c.props.title ? <StyledMuiTab key={index} label={c.props.title} /> : null,
36
- )}
37
- </MuiTabs>
38
-
39
- <div className={contentClassName} style={contentStyle}>
40
- {children[value]}
41
- </div>
42
- </div>
43
- );
44
- }
45
- }
46
-
47
- export default Tabs;
@@ -1,116 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { styled } from '@mui/material/styles';
4
- import { uniq } from 'lodash-es';
5
- import Chip from '@mui/material/Chip';
6
- import MuiBox from '../mui-box';
7
-
8
- const ENTER = 13;
9
-
10
- const StyledChip = styled(Chip)(() => ({
11
- padding: '0px',
12
- margin: '1px',
13
- }));
14
-
15
- const Tag = ({ label, onDelete }) => <StyledChip label={label} onDelete={onDelete} />;
16
-
17
- Tag.propTypes = {
18
- label: PropTypes.string.isRequired,
19
- onDelete: PropTypes.func.isRequired,
20
- };
21
-
22
- const StyledTagsInput = styled('div')(({ theme }) => ({
23
- border: `0px solid ${theme.palette.background.paper}`,
24
- display: 'flex',
25
- flexWrap: 'wrap',
26
- }));
27
-
28
- const StyledInput = styled('input')(({ theme }) => ({
29
- padding: '2px',
30
- margin: '1px',
31
- minWidth: '30px',
32
- width: '100%',
33
- flex: '1',
34
- border: `0px solid ${theme.palette.background.paper}`,
35
- height: '28px',
36
- fontSize: theme.typography.fontSize,
37
- fontFamily: theme.typography.fontFamily,
38
- outline: 'none',
39
- '&:focus': {
40
- outline: 'none',
41
- },
42
- }));
43
-
44
- export class TagsInput extends React.Component {
45
- static propTypes = {
46
- tags: PropTypes.arrayOf(PropTypes.string).isRequired,
47
- onChange: PropTypes.func.isRequired,
48
- };
49
-
50
- constructor(props) {
51
- super(props);
52
- this.state = {
53
- value: '',
54
- focused: false,
55
- };
56
-
57
- this.onKeyDown = (event) => {
58
- if (event.keyCode === ENTER && this.state.value !== '') {
59
- const tag = this.state.value.trim();
60
- const newTags = uniq(this.props.tags.concat([tag]));
61
-
62
- if (newTags.length !== this.props.tags.length) {
63
- this.props.onChange(newTags);
64
- this.setState({ value: '' });
65
- }
66
- }
67
- };
68
-
69
- this.onChange = (event) => {
70
- this.setState({ value: event.target.value });
71
- };
72
-
73
- this.deleteTag = (tag) => {
74
- const { tags } = this.props;
75
-
76
- const tagIndex = tags.indexOf(tag);
77
- if (tagIndex !== -1) {
78
- tags.splice(tagIndex, 1);
79
- this.props.onChange(tags);
80
- this.input.focus();
81
- }
82
- };
83
- }
84
-
85
- onFocus = () => {
86
- this.setState({ focused: true });
87
- };
88
-
89
- onBlur = () => {
90
- this.setState({ focused: false });
91
- };
92
-
93
- render() {
94
- const { tags } = this.props;
95
- return (
96
- <MuiBox focused={this.state.focused}>
97
- <StyledTagsInput>
98
- {(tags || []).map((t, index) => (
99
- <Tag key={index} label={t} onDelete={() => this.deleteTag(t)} />
100
- ))}
101
- <StyledInput
102
- ref={(r) => (this.input = r)}
103
- onKeyDown={this.onKeyDown}
104
- onChange={this.onChange}
105
- value={this.state.value}
106
- onFocus={this.onFocus}
107
- onBlur={this.onBlur}
108
- type="text"
109
- />
110
- </StyledTagsInput>
111
- </MuiBox>
112
- );
113
- }
114
- }
115
-
116
- export default TagsInput;
@@ -1,90 +0,0 @@
1
- import { InputContainer } from '@pie-lib/render-ui';
2
- import PropTypes from 'prop-types';
3
- import RadioWithLabel from './radio-with-label';
4
- import React from 'react';
5
- import { styled } from '@mui/material/styles';
6
-
7
- const StyledGroup = styled('div')(({ theme, direction }) => ({
8
- display: 'flex',
9
- flexWrap: 'wrap',
10
- paddingLeft: 0,
11
- marginTop: theme.spacing(1),
12
- ...(direction === 'vertical' && {
13
- flexDirection: 'column',
14
- }),
15
- }));
16
-
17
- class NChoice extends React.Component {
18
- static propTypes = {
19
- header: PropTypes.string.isRequired,
20
- className: PropTypes.string,
21
- customLabel: PropTypes.func,
22
- opts: PropTypes.array.isRequired,
23
- value: PropTypes.string,
24
- onChange: PropTypes.func.isRequired,
25
- direction: PropTypes.oneOf(['horizontal', 'vertical']),
26
- };
27
-
28
- handleChange = (event) => {
29
- this.props.onChange(event.currentTarget.value);
30
- };
31
-
32
- render() {
33
- const { header, className, customLabel, opts, value, direction } = this.props;
34
-
35
- const preppedOpts = opts.map((o) => {
36
- return typeof o === 'string' ? { label: o, value: o } : o;
37
- });
38
- const LabelComponent = customLabel || RadioWithLabel;
39
-
40
- return (
41
- <InputContainer label={header} className={className}>
42
- <StyledGroup direction={direction}>
43
- {preppedOpts.map((o, index) => (
44
- <LabelComponent
45
- value={o.value}
46
- key={index}
47
- checked={o.value === value}
48
- onChange={this.handleChange}
49
- label={o.label}
50
- />
51
- ))}
52
- </StyledGroup>
53
- </InputContainer>
54
- );
55
- }
56
- }
57
-
58
- export { NChoice };
59
-
60
- const labelValue = PropTypes.shape({ label: PropTypes.string, value: PropTypes.string });
61
-
62
- class TwoChoice extends React.Component {
63
- static propTypes = {
64
- header: PropTypes.string.isRequired,
65
- value: PropTypes.string.isRequired,
66
- onChange: PropTypes.func.isRequired,
67
- one: PropTypes.oneOfType([labelValue, PropTypes.string]),
68
- two: PropTypes.oneOfType([labelValue, PropTypes.string]),
69
- className: PropTypes.string,
70
- customLabel: PropTypes.func,
71
- };
72
-
73
- render() {
74
- const { one, two, header, className, customLabel, value, onChange } = this.props;
75
- const opts = [one, two];
76
-
77
- return (
78
- <NChoice
79
- customLabel={customLabel}
80
- header={header}
81
- className={className}
82
- opts={opts}
83
- value={value}
84
- onChange={onChange}
85
- />
86
- );
87
- }
88
- }
89
-
90
- export default TwoChoice;
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- const withStatefulModel = (Component) => {
5
- class Stateful extends React.Component {
6
- static propTypes = {
7
- model: PropTypes.object.isRequired,
8
- onChange: PropTypes.func.isRequired,
9
- };
10
-
11
- constructor(props) {
12
- super(props);
13
- this.state = {
14
- model: props.model,
15
- };
16
- }
17
-
18
- UNSAFE_componentWillReceiveProps(props) {
19
- this.setState({ model: props.model });
20
- }
21
-
22
- onChange = (model) => {
23
- this.setState({ model }, () => {
24
- this.props.onChange(this.state.model);
25
- });
26
- };
27
-
28
- render() {
29
- return <Component model={this.state.model} onChange={this.onChange} />;
30
- }
31
- }
32
-
33
- return Stateful;
34
- };
35
-
36
- export default withStatefulModel;