@progress/kendo-themes-html 5.0.0-alpha.3 → 5.0.0-beta.3

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 (83) hide show
  1. package/lib/jsx-runtime.js +48 -3
  2. package/package.json +7 -7
  3. package/src/autocomplete/autocomplete.jsx +4 -4
  4. package/src/avatar/README.md +21 -0
  5. package/src/avatar/avatar.jsx +113 -0
  6. package/src/avatar/index.js +1 -0
  7. package/src/button/button.jsx +7 -7
  8. package/src/checkbox/checkbox.jsx +3 -3
  9. package/src/chip/README.md +47 -0
  10. package/src/chip/chip-actions.jsx +80 -0
  11. package/src/chip/chip-avatar.jsx +13 -0
  12. package/src/chip/chip-list.jsx +84 -0
  13. package/src/chip/chip.jsx +180 -0
  14. package/src/chip/index.js +4 -0
  15. package/src/colorpicker/README.md +24 -15
  16. package/src/colorpicker/color-preview.jsx +33 -22
  17. package/src/colorpicker/colorpicker.jsx +12 -13
  18. package/src/combobox/combobox.jsx +9 -11
  19. package/src/{component.js → component/component.jsx} +4 -2
  20. package/src/component/index.js +1 -0
  21. package/src/dateinput/dateinput.jsx +9 -11
  22. package/src/datepicker/datepicker.jsx +9 -11
  23. package/src/datetimepicker/datetimepicker.jsx +9 -11
  24. package/src/dropdownbutton/README.md +60 -0
  25. package/src/dropdownbutton/dropdownbutton.jsx +145 -0
  26. package/src/dropdownbutton/index.js +1 -0
  27. package/src/dropdownlist/dropdownlist.jsx +13 -12
  28. package/src/fab/README.md +19 -0
  29. package/src/fab/fab.jsx +154 -0
  30. package/src/fab/index.js +1 -0
  31. package/src/icon/icon.jsx +1 -1
  32. package/src/index.js +47 -4
  33. package/src/input/input-clear-value.jsx +1 -1
  34. package/src/input/input-inner-input.jsx +1 -1
  35. package/src/input/input-inner-span.jsx +1 -1
  36. package/src/input/input-inner-textarea.jsx +1 -1
  37. package/src/input/input-prefix.jsx +1 -1
  38. package/src/input/input-suffix.jsx +1 -1
  39. package/src/input/input.jsx +4 -4
  40. package/src/input/picker.jsx +6 -6
  41. package/src/list/README.md +107 -0
  42. package/src/list/index.js +5 -0
  43. package/src/list/list-content.jsx +95 -0
  44. package/src/list/list-group-item.jsx +66 -0
  45. package/src/list/list-header.jsx +67 -0
  46. package/src/list/list-item.jsx +117 -0
  47. package/src/list/list.jsx +182 -0
  48. package/src/maskedtextbox/maskedtextbox.jsx +11 -14
  49. package/src/menu/README.md +40 -0
  50. package/src/menu/index.js +3 -0
  51. package/src/menu/menu-item-content.jsx +48 -0
  52. package/src/menu/menu-item.jsx +174 -0
  53. package/src/menu/menu-list.jsx +74 -0
  54. package/src/menulist/menulist.jsx +67 -0
  55. package/src/multiselect/README.md +37 -0
  56. package/src/multiselect/index.js +2 -0
  57. package/src/multiselect/multiselect-chip-list.jsx +55 -0
  58. package/src/multiselect/multiselect.jsx +189 -0
  59. package/src/nodata/index.js +1 -0
  60. package/src/nodata/nodata.jsx +64 -0
  61. package/src/numerictextbox/numerictextbox.jsx +5 -5
  62. package/src/popup/README.md +15 -0
  63. package/src/popup/index.js +1 -0
  64. package/src/popup/popup.jsx +80 -0
  65. package/src/radio/radio.jsx +2 -2
  66. package/src/searchbar/searchbar.jsx +1 -1
  67. package/src/searchbox/searchbox.jsx +4 -4
  68. package/src/spinbutton/spinbutton.jsx +9 -3
  69. package/src/splitbutton/README.md +76 -0
  70. package/src/splitbutton/index.js +1 -0
  71. package/src/splitbutton/splitbutton.jsx +152 -0
  72. package/src/switch/README.md +3 -3
  73. package/src/switch/switch.jsx +6 -6
  74. package/src/textarea/textarea.jsx +4 -4
  75. package/src/textbox/textbox.jsx +4 -4
  76. package/src/timepicker/timepicker.jsx +9 -11
  77. package/src/treeview/README.md +0 -0
  78. package/src/treeview/index.js +4 -0
  79. package/src/treeview/treeview-group.jsx +70 -0
  80. package/src/treeview/treeview-item.jsx +142 -0
  81. package/src/treeview/treeview-leaf.jsx +99 -0
  82. package/src/treeview/treeview.jsx +125 -0
  83. package/utils/styles.js +23 -5
@@ -31,11 +31,25 @@ const attrMap = {
31
31
  showclearbutton: 'showClearButton',
32
32
  clearbutton: 'clearButton',
33
33
 
34
+ showcheckbox: 'showCheckbox',
35
+
34
36
  // Switch
35
37
  onlabel: 'onLabel',
36
38
  offlabel: 'offLabel',
37
39
  trackrounded: 'trackRounded',
38
- thumbrounded: 'thumbRounded'
40
+ thumbrounded: 'thumbRounded',
41
+
42
+ // Chip
43
+ showavatar: 'showAvatar',
44
+
45
+ // Hierarchy
46
+ haschildren: 'hasChildren',
47
+
48
+ // Treeview
49
+ leafclassname: 'leafClassName',
50
+
51
+ // Template
52
+ contenttemplate: 'contentTemplate'
39
53
  };
40
54
 
41
55
  const booleanAttr = new Set([
@@ -62,10 +76,34 @@ const booleanAttr = new Set([
62
76
  'showIcon',
63
77
  'showClearButton',
64
78
  'showSpinButton',
79
+ 'showArrow',
80
+
81
+ 'showCheckbox',
82
+
83
+ 'virtualization',
84
+ 'root',
85
+
86
+ 'open',
87
+ 'expanded',
88
+ 'hasChildren',
89
+
90
+ 'showArrow',
91
+
92
+ 'showAvatar',
65
93
 
66
94
  'aria'
67
95
  ]);
68
96
 
97
+ const nullAttr = new Set([
98
+ 'size',
99
+ 'rounded',
100
+ 'fillMode',
101
+ 'themeColor',
102
+
103
+ 'trackRounded',
104
+ 'thumbRounded'
105
+ ]);
106
+
69
107
  const skipAttr = new Set([
70
108
  'is',
71
109
  'aria',
@@ -144,6 +182,10 @@ function attrToProps( attributes ) {
144
182
  attrName = attrMap[attrName];
145
183
  }
146
184
 
185
+ // Set props as is
186
+ props[ attrName ] = attrValue;
187
+
188
+ // Ensure boolean value
147
189
  if (booleanAttr.has(attrName) && typeof attrValue === 'string') {
148
190
  switch (attrValue) {
149
191
  case '':
@@ -154,8 +196,11 @@ function attrToProps( attributes ) {
154
196
  props[ attrName ] = false;
155
197
  break;
156
198
  }
157
- } else {
158
- props[ attrName ] = attrValue;
199
+ }
200
+
201
+ // Ensure null value
202
+ if (nullAttr.has(attrName) && attrValue === 'null') {
203
+ props[ attrName ] = null;
159
204
  }
160
205
  });
161
206
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-themes-html",
3
3
  "description": "A collection of HTML helpers used for developing Kendo UI themes",
4
- "version": "5.0.0-alpha.3",
4
+ "version": "5.0.0-beta.3",
5
5
  "author": "Progress",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
@@ -34,13 +34,13 @@
34
34
  "dev": "rollup -cw"
35
35
  },
36
36
  "devDependencies": {
37
- "@babel/core": "^7.16.0",
38
- "@babel/preset-env": "^7.16.0",
39
- "@babel/preset-react": "^7.16.0",
37
+ "@babel/core": "^7.16.7",
38
+ "@babel/preset-env": "^7.16.7",
39
+ "@babel/preset-react": "^7.16.7",
40
40
  "@rollup/plugin-babel": "^5.3.0",
41
41
  "@rollup/plugin-commonjs": "^21.0.1",
42
- "@rollup/plugin-node-resolve": "^13.0.6",
43
- "rollup": "^2.59.0"
42
+ "@rollup/plugin-node-resolve": "^13.1.2",
43
+ "rollup": "^2.62.0"
44
44
  },
45
- "gitHead": "44890fccabb05b608e86a044ab565349b6d789d1"
45
+ "gitHead": "a508e10c60c1c14b569a908ef7f8584cf449a421"
46
46
  }
@@ -1,4 +1,4 @@
1
- import { globalDefaultProps } from '../component';
1
+ import { globalDefaultProps } from '../component/index';
2
2
  import { Input, InputStatic, InputInnerInputStatic } from '../input/index';
3
3
  import { InputValidationIconStatic, InputLoadingIconStatic, InputClearValueStatic } from '../input/index';
4
4
 
@@ -138,10 +138,10 @@ AutocompleteStatic.propTypes = {
138
138
  prefix: typeof '#fragment',
139
139
  suffix: typeof '#fragment',
140
140
 
141
- size: typeof [ 'none', 'small', 'medium', 'large' ],
142
- rounded: typeof [ 'none', 'small', 'medium', 'large', 'pill' ],
141
+ size: typeof [ null, 'small', 'medium', 'large' ],
142
+ rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
143
143
 
144
- fillMode: typeof [ 'none', 'solid', 'flat', 'outline' ],
144
+ fillMode: typeof [ null, 'solid', 'flat', 'outline' ],
145
145
 
146
146
  hover: typeof false,
147
147
  focus: typeof false,
@@ -0,0 +1,21 @@
1
+ ```html
2
+ <!-- default rendering -->
3
+ <div class="k-avatar k-avatar-md k-rounded-circle k-avatar-solid k-avatar-solid-primary">
4
+ <span class="k-avatar-image">
5
+ <img src="../../assets/avatar.jpg" class="">
6
+ </span>
7
+ </div>
8
+
9
+ <!-- canonical rendering -->
10
+ <div class="
11
+ k-avatar
12
+ k-avatar-{size}
13
+ k-rounded-{rounded}
14
+ k-avatar-{fillMode}
15
+ k-avatar-{fillMode}-{themeColor}
16
+ ">
17
+ <span class="k-avatar-{type}">
18
+ {content}
19
+ </span>
20
+ </div>
21
+ ```
@@ -0,0 +1,113 @@
1
+ import * as styles from '../../utils/styles';
2
+ import { Component, globalDefaultProps } from '../component/index';
3
+
4
+ class Avatar extends Component {
5
+ render() {
6
+ return <AvatarStatic {...this.props} />;
7
+ }
8
+ }
9
+
10
+ function AvatarStatic(props) {
11
+ const {
12
+ className: ownClassName,
13
+
14
+ children,
15
+
16
+ type,
17
+
18
+ size,
19
+ rounded,
20
+ bordered,
21
+
22
+ fillMode,
23
+ themeColor,
24
+
25
+ aria,
26
+ legacy,
27
+
28
+ ...htmlAttributes
29
+ } = props;
30
+
31
+ let avatarClasses = [
32
+ ownClassName,
33
+ 'k-avatar',
34
+ styles.sizeClass( size, 'k-avatar' ),
35
+ styles.roundedClass( rounded ),
36
+ styles.fillModeClass( fillMode, 'k-avatar' ),
37
+ styles.themeColorClass( fillMode, themeColor, 'k-avatar' ),
38
+ styles.borderedClass( bordered, 'k-avatar' ),
39
+ ];
40
+
41
+ let ariaAttr = aria
42
+ ? {}
43
+ : {};
44
+
45
+ if (legacy) {
46
+
47
+ let legacyClasses = [
48
+ ownClassName,
49
+ 'k-avatar',
50
+ `k-avatar-${themeColor}`,
51
+ {
52
+ 'k-avatar-circle': rounded === 'full',
53
+ 'k-avatar-rounded': rounded !== 'full' && rounded !== null
54
+ },
55
+ styles.sizeClass( size, 'k-avatar' ),
56
+ styles.fillModeClass( fillMode, 'k-avatar' ),
57
+ styles.borderedClass( bordered, 'k-avatar' ),
58
+ ];
59
+
60
+ return (
61
+ <span className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
62
+ <span className={`k-avatar-${type}`}>
63
+ {children}
64
+ </span>
65
+ </span>
66
+ );
67
+ }
68
+
69
+ return (
70
+ <span className={avatarClasses} {...ariaAttr} {...htmlAttributes}>
71
+ <span className={`k-avatar-${type}`}>
72
+ {children}
73
+ </span>
74
+ </span>
75
+ );
76
+ }
77
+
78
+ AvatarStatic.defaultProps = {
79
+ ...globalDefaultProps,
80
+
81
+ className: '',
82
+ children: [],
83
+
84
+ type: '',
85
+
86
+ size: 'medium',
87
+ rounded: 'full',
88
+ bordered: false,
89
+
90
+ fillMode: 'solid',
91
+ themeColor: 'primary'
92
+ };
93
+
94
+ AvatarStatic.propTypes = {
95
+ className: typeof '',
96
+ children: typeof [],
97
+
98
+ type: typeof '',
99
+
100
+ size: typeof [ null, 'small', 'medium', 'large' ],
101
+ rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
102
+ bordered: typeof false,
103
+
104
+ fillMode: typeof [ null, 'solid', 'outline' ],
105
+ themeColor: typeof [ null, 'primary' ],
106
+
107
+ aria: typeof false,
108
+ legacy: typeof false,
109
+
110
+ htmlAttributes: typeof []
111
+ };
112
+
113
+ export { Avatar, AvatarStatic };
@@ -0,0 +1 @@
1
+ export * from './avatar.jsx';
@@ -1,5 +1,5 @@
1
1
  import * as styles from '../../utils/styles';
2
- import { Component, globalDefaultProps } from '../component';
2
+ import { Component, globalDefaultProps } from '../component/index';
3
3
  import { IconStatic } from '../icon/index';
4
4
 
5
5
  class Button extends Component {
@@ -87,7 +87,7 @@ function ButtonStatic(props) {
87
87
  if (legacy) {
88
88
  return (
89
89
  <button type={type} className={legacyClasses} {...ariaAttr} {...htmlAttributes}>
90
- <IconStatic name={icon} />
90
+ <IconStatic className="k-button-icon" name={icon} />
91
91
  { text }
92
92
  </button>
93
93
  );
@@ -124,12 +124,12 @@ ButtonStatic.propTypes = {
124
124
 
125
125
  type: typeof [ 'button', 'submit', 'reset' ],
126
126
 
127
- size: typeof [ 'none', 'small', 'medium', 'large' ],
128
- rounded: typeof [ 'none', '0', 'small', 'medium', 'large', 'pill', 'circle' ],
129
- shape: typeof [ 'none', 'rectangle', 'square' ],
127
+ size: typeof [ null, 'small', 'medium', 'large' ],
128
+ rounded: typeof [ null, 'small', 'medium', 'large', 'full' ],
129
+ shape: typeof [ null, 'rectangle', 'square' ],
130
130
 
131
- fillMode: typeof [ 'none', 'solid', 'flat', 'outline', 'link' ],
132
- themeColor: typeof [ 'none', 'surface', 'base', 'primary' ],
131
+ fillMode: typeof [ null, 'solid', 'flat', 'outline', 'link' ],
132
+ themeColor: typeof [ null, 'surface', 'base', 'primary' ],
133
133
 
134
134
  hover: typeof false,
135
135
  focus: typeof false,
@@ -1,5 +1,5 @@
1
1
  import * as styles from '../../utils/styles';
2
- import { Component, globalDefaultProps } from '../component';
2
+ import { Component, globalDefaultProps } from '../component/index';
3
3
 
4
4
  class Checkbox extends Component {
5
5
  render() {
@@ -103,8 +103,8 @@ CheckboxStatic.propTypes = {
103
103
  checked: typeof false,
104
104
  indeterminate: typeof false,
105
105
 
106
- size: typeof [ 'none', 'small', 'medium', 'large' ],
107
- rounded: typeof [ 'none', 'small', 'medium', 'large' ],
106
+ size: typeof [ null, 'small', 'medium', 'large' ],
107
+ rounded: typeof [ null, 'small', 'medium', 'large' ],
108
108
 
109
109
  hover: typeof false,
110
110
  focus: typeof false,
@@ -0,0 +1,47 @@
1
+ ## Chip
2
+
3
+ ```html
4
+ <!-- default rendering -->
5
+ <div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">
6
+ <span class="k-chip-text">Chip Text</span>
7
+ </div>
8
+
9
+ <!-- canonical rendering -->
10
+ <div class="
11
+ k-chip
12
+ k-chip-${size}
13
+ k-rounded-${rounded}
14
+ k-chip-${fillMode}
15
+ k-chip-${fillMode}-${themeColor}
16
+
17
+ ${disabled && 'k-disabled'}>
18
+ {icon !== '' && <span class="k-chip-icon k-icon k-i-${icon}"></span>}
19
+ {avatar !== '' && <span class="k-chip-avatar k-avatar"></span>}
20
+ <span className="k-chip-content">
21
+ { children.length
22
+ ? children
23
+ : text &&
24
+ <span className="k-chip-label">{text}</span>}
25
+ </span>
26
+ {removable && <span class="k-chip-icon k-icon k-i-${removeIcon}"></span>}
27
+ </div>
28
+ ```
29
+
30
+ ## ChipList
31
+
32
+ ```html
33
+ <!-- default rendering -->
34
+ <div class="k-chip-list k-chip-list-md">
35
+ <div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">...</div>
36
+ <div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">...</div>
37
+ <div class="k-chip k-chip-md k-rounded-full k-chip-solid k-chip-solid-base">...</div>
38
+ </div>
39
+
40
+ <!-- canonical rendering -->
41
+ <div class="
42
+ k-chip-list
43
+ k-chip-${size}">
44
+ <div class="k-chip" {...props}>...</div>
45
+ <div class="k-chip" {...props}>...</div>
46
+ </div>
47
+ ```
@@ -0,0 +1,80 @@
1
+ import { Component, globalDefaultProps } from '../component/index';
2
+ import { IconStatic } from '../icon/index';
3
+
4
+ function transformActions(actions) {
5
+ let newActions = [];
6
+
7
+ actions.forEach(action => {
8
+ if (action === 'more') {
9
+ newActions.push(
10
+ <span className="k-chip-action k-chip-more-action">
11
+ <IconStatic name="more-vertical" />
12
+ </span>
13
+ );
14
+
15
+ return;
16
+ }
17
+
18
+ if (action === 'remove') {
19
+ newActions.push(
20
+ <span className="k-chip-action k-chip-remove-action">
21
+ <IconStatic name="x-circle" />
22
+ </span>
23
+ );
24
+
25
+ return;
26
+ }
27
+
28
+ newActions.push(
29
+ <span className={`k-chip-action k-chip-${action}-action`}>
30
+ <IconStatic name={action} />
31
+ </span>
32
+ );
33
+ });
34
+
35
+ return newActions;
36
+ }
37
+
38
+ class ChipActions extends Component {
39
+ render() {
40
+ return <ChipActionsStatic {...this.props} />;
41
+ }
42
+ }
43
+
44
+ function ChipActionsStatic(props) {
45
+
46
+ const {
47
+ actions
48
+ } = props;
49
+
50
+ if (actions.length === 0) {
51
+ return <></>;
52
+ }
53
+
54
+ return (
55
+ <span className="k-chip-actions">
56
+ {transformActions( actions )}
57
+ </span>
58
+ );
59
+
60
+ }
61
+
62
+ ChipActionsStatic.defaultProps = {
63
+ ...globalDefaultProps,
64
+
65
+ actions: []
66
+ };
67
+
68
+ ChipActionsStatic.propTypes = {
69
+ className: typeof '',
70
+ children: typeof [],
71
+
72
+ actions: typeof [],
73
+
74
+ aria: typeof false,
75
+ legacy: typeof false,
76
+
77
+ htmlAttributes: typeof []
78
+ };
79
+
80
+ export { ChipActions, ChipActionsStatic };
@@ -0,0 +1,13 @@
1
+ import { AvatarStatic } from '../avatar/index';
2
+
3
+ function ChipAvatarStatic() {
4
+
5
+ return (
6
+ <AvatarStatic className="k-chip-avatar" type="image">
7
+ <img src="../../assets/avatar.jpg"/>
8
+ </AvatarStatic>
9
+ );
10
+
11
+ }
12
+
13
+ export { ChipAvatarStatic };
@@ -0,0 +1,84 @@
1
+
2
+ import * as styles from '../../utils/styles';
3
+ import { Component, globalDefaultProps } from '../component/index';
4
+
5
+ class ChipList extends Component {
6
+ render() {
7
+ return <ChipListStatic {...this.props} />;
8
+ }
9
+ }
10
+
11
+ function ChipListStatic(props) {
12
+ const {
13
+ className: ownClassName,
14
+
15
+ children,
16
+
17
+ size,
18
+
19
+ selection,
20
+
21
+ aria,
22
+ legacy,
23
+
24
+ ...htmlAttributes
25
+ } = props;
26
+
27
+ let listClasses = [
28
+ ownClassName,
29
+ 'k-chip-list',
30
+ styles.sizeClass( size, 'k-chip-list' ),
31
+ {
32
+ 'k-selection-single': selection === 'single',
33
+ 'k-selection-multiple': selection === 'multiple'
34
+ }
35
+ ];
36
+
37
+
38
+ let legacyListClasses = [
39
+ ownClassName,
40
+ 'k-chip-list'
41
+ ];
42
+
43
+ let ariaAttr = aria
44
+ ? {}
45
+ : {};
46
+
47
+ if (legacy) {
48
+ return (
49
+ <div className={legacyListClasses} {...ariaAttr} {...htmlAttributes}>
50
+ {children}
51
+ </div>
52
+ );
53
+ }
54
+
55
+ return (
56
+ <div className={listClasses} {...ariaAttr} {...htmlAttributes}>
57
+ {children}
58
+ </div>
59
+ );
60
+ }
61
+
62
+ ChipListStatic.defaultProps = {
63
+ ...globalDefaultProps,
64
+
65
+ size: 'medium',
66
+
67
+ selection: 'none'
68
+ };
69
+
70
+ ChipListStatic.propTypes = {
71
+ className: typeof '',
72
+ children: typeof [],
73
+
74
+ size: typeof [ null, 'small', 'medium', 'large' ],
75
+
76
+ selection: typeof [ null, 'single', 'multiple' ],
77
+
78
+ aria: typeof false,
79
+ legacy: typeof false,
80
+
81
+ htmlAttributes: typeof []
82
+ };
83
+
84
+ export { ChipList, ChipListStatic };