@zohodesk/components 1.0.0-temp-610 → 1.0.0-temp-352
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/README.md +34 -6
- package/assets/Appearance/dark/mode/darkMode.module.css +3 -3
- package/assets/Appearance/dark/themes/blue/blueDarkComponentTheme.module.css +1 -1
- package/assets/Appearance/default/mode/defaultMode.module.css +4 -4
- package/assets/Appearance/default/themes/blue/blueDefaultComponentTheme.module.css +1 -1
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +358 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/blue/bluePureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/green/greenPureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/orange/orangePureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/red/redPureDarkComponentTheme.module.css +42 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +34 -0
- package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkComponentTheme.module.css +42 -0
- package/docs/external/active-line.js +72 -0
- package/docs/external/autorefresh.js +47 -0
- package/docs/external/codemirror.js +9681 -0
- package/docs/external/css/hopscotch.css +576 -0
- package/docs/external/css/styleGuide.css +1100 -0
- package/docs/external/css.js +466 -0
- package/docs/external/designTokens.js +1 -0
- package/docs/external/foldcode.js +152 -0
- package/docs/external/format.js +129 -0
- package/docs/external/htmlmixed.js +84 -0
- package/docs/external/images/bottom.png +0 -0
- package/docs/external/images/bottombg.jpg +0 -0
- package/docs/external/images/desk.png +0 -0
- package/docs/external/images/desklogo.png +0 -0
- package/docs/external/images/menu.png +0 -0
- package/docs/external/index.html +127 -0
- package/docs/external/javascript.js +422 -0
- package/docs/external/jsx.js +148 -0
- package/docs/external/matchbrackets.js +145 -0
- package/docs/external/xml.js +322 -0
- package/docs/package.json +41 -0
- package/docs/src/index.js +1311 -0
- package/es/Accordion/docs/Accordion__Demo.docs.js +80 -0
- package/es/Animation/docs/Animation__default.docs.js +34 -0
- package/es/Animation/docs/Animation__fadeIn.docs.js +34 -0
- package/es/Animation/docs/Animation__scaleIn.docs.js +34 -0
- package/es/Animation/docs/Animation__skewIn.docs.js +34 -0
- package/es/Animation/docs/Animation__slideDown.docs.js +34 -0
- package/es/Animation/docs/Animation__slideLeft.docs.js +34 -0
- package/es/Animation/docs/Animation__zoomIn.docs.js +34 -0
- package/es/AppContainer/AppContainer.js +6 -1
- package/es/AppContainer/docs/AppContainer__default.docs.js +20 -0
- package/es/Avatar/docs/Avatar__custom.docs.js +29 -0
- package/es/Avatar/docs/Avatar__default.docs.js +29 -0
- package/es/Avatar/docs/Avatar__palette.docs.js +49 -0
- package/es/Avatar/docs/Avatar__text.docs.js +28 -0
- package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +73 -0
- package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +31 -0
- package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +50 -0
- package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +49 -0
- package/es/Button/docs/Button__custom.docs.js +771 -0
- package/es/Button/docs/Button__default.docs.js +536 -0
- package/es/Buttongroup/docs/Buttongroup__custom.docs.js +37 -0
- package/es/Buttongroup/docs/Buttongroup__footer.docs.js +33 -0
- package/es/Buttongroup/docs/Buttongroup__header.docs.js +42 -0
- package/es/Card/docs/Card__Custom.docs.js +34 -0
- package/es/Card/docs/Card__Default.docs.js +37 -0
- package/es/Card/docs/Card__Scroll.docs.js +59 -0
- package/es/CheckBox/docs/CheckBox__custom.docs.js +293 -0
- package/es/CheckBox/docs/CheckBox__default.docs.js +219 -0
- package/es/DateTime/DateTime.js +10 -5
- package/es/DateTime/DateWidget.js +10 -2
- package/es/DateTime/DateWidget.module.css +0 -4
- package/es/DateTime/docs/DateTime__default.docs.js +91 -0
- package/es/DateTime/docs/DateWidget__default.docs.js +183 -0
- package/es/DateTime/docs/timezonedata.json +1 -0
- package/es/DropBox/docs/DropBox__custom.docs.js +66 -0
- package/es/DropBox/docs/DropBox__customOrder.docs.js +92 -0
- package/es/DropBox/docs/DropBox__fixedPosition.docs.js +91 -0
- package/es/DropBox/docs/DropBox__position.docs.js +87 -0
- package/es/DropBox/docs/DropBox__size.docs.js +61 -0
- package/es/DropDown/docs/DropDownHeading__custom.docs.js +23 -0
- package/es/DropDown/docs/DropDownHeading__default.docs.js +21 -0
- package/es/Label/docs/Label__clipped.docs.js +27 -0
- package/es/Label/docs/Label__custom.docs.js +30 -0
- package/es/Label/docs/Label__palette.docs.js +42 -0
- package/es/Label/docs/Label__size.docs.js +29 -0
- package/es/Label/docs/Label__type.docs.js +37 -0
- package/es/Layout/docs/Layout__Hidden.docs.js +77 -0
- package/es/Layout/docs/Layout__default.docs.js +49 -0
- package/es/Layout/docs/Layout__four_Column.docs.js +85 -0
- package/es/Layout/docs/Layout__three_Column.docs.js +76 -0
- package/es/Layout/docs/Layout__two_Column.docs.js +69 -0
- package/es/LightNightMode/docs/AlternativeColors.docs.js +74 -0
- package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +155 -0
- package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +112 -0
- package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +91 -0
- package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +65 -0
- package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +68 -0
- package/es/ListItem/docs/ListItemWithIcon__default.docs.js +62 -0
- package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +91 -0
- package/es/ListItem/docs/ListItemWithRadio__default.docs.js +65 -0
- package/es/ListItem/docs/ListItem__custom.docs.js +114 -0
- package/es/ListItem/docs/ListItem__default.docs.js +82 -0
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +9 -6
- package/es/MultiSelect/AdvancedMultiSelect.js +8 -4
- package/es/MultiSelect/AdvancedMultiSelect.module.css +0 -3
- package/es/MultiSelect/MultiSelect.js +6 -4
- package/es/MultiSelect/MultiSelect.module.css +3 -0
- package/es/MultiSelect/MultiSelectWithAvatar.js +6 -4
- package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +125 -0
- package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +114 -0
- package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +141 -0
- package/es/MultiSelect/docs/MultiSelect__default.docs.js +161 -0
- package/es/PopOver/PopOver.js +10 -4
- package/es/PopOver/docs/PopOver__default.docs.js +32 -0
- package/es/Provider/Config.js +1 -2
- package/es/Provider/docs/Provider_Id__Class.docs.js +29 -0
- package/es/Provider/docs/Provider_Id__Function.docs.js +18 -0
- package/es/Provider/docs/Provider_Zindex__Class.docs.js +32 -0
- package/es/Provider/docs/Provider_Zindex__Function.docs.js +23 -0
- package/es/Provider.js +22 -85
- package/es/Radio/docs/Radio__custom.docs.js +245 -0
- package/es/Radio/docs/Radio__default.docs.js +169 -0
- package/es/Responsive/ResizeComponent.js +69 -14
- package/es/Responsive/docs/Responsive__Custom.docs.js +206 -0
- package/es/Responsive/docs/Responsive__default.docs.js +97 -0
- package/es/Responsive/docs/style.module.css +47 -0
- package/es/{ResponsiveDropbox/ResponsiveDropbox.js → ResponsiveDropBox/ResponsiveDropBox.js} +5 -5
- package/es/{ResponsiveDropbox/ResponsiveDropbox.module.css → ResponsiveDropBox/ResponsiveDropBox.module.css} +0 -0
- package/es/Ribbon/docs/Ribbon__custom.docs.js +386 -0
- package/es/Ribbon/docs/Ribbon__default.docs.js +342 -0
- package/es/RippleEffect/docs/RippleEffect__default.docs.js +435 -0
- package/es/Select/GroupSelect.js +7 -4
- package/es/Select/Select.js +8 -5
- package/es/Select/Select.module.css +3 -3
- package/es/Select/SelectWithAvatar.js +6 -4
- package/es/Select/SelectWithIcon.js +7 -5
- package/es/Select/docs/GroupSelect__default.docs.js +149 -0
- package/es/Select/docs/SelectWithAvatar__default.docs.js +97 -0
- package/es/Select/docs/SelectWithIcon__default.docs.js +138 -0
- package/es/Select/docs/Select__default.docs.js +288 -0
- package/es/Stencils/docs/Stencils__custom.docs.js +45 -0
- package/es/Stencils/docs/Stencils__default.docs.js +50 -0
- package/es/Switch/docs/Switch__custom.docs.js +153 -0
- package/es/Switch/docs/Switch__default.docs.js +107 -0
- package/es/Tab/Tabs.js +68 -43
- package/es/Tab/Tabs.module.css +1 -1
- package/es/Tab/docs/Tab__default.docs.js +258 -0
- package/es/Tab/docs/tabdocs.module.css +29 -0
- package/es/Tag/Tag.js +1 -1
- package/es/Tag/Tag.module.css +6 -2
- package/es/Tag/docs/Tag__custom.docs.js +368 -0
- package/es/Tag/docs/Tag__default.docs.js +323 -0
- package/es/TextBox/docs/TextBox__custom.docs.js +43 -0
- package/es/TextBox/docs/TextBox__default.docs.js +40 -0
- package/es/TextBox/docs/TextBox__size.docs.js +38 -0
- package/es/TextBox/docs/TextBox__variant.docs.js +38 -0
- package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +89 -0
- package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +61 -0
- package/es/Textarea/docs/Textarea__animated.docs.js +41 -0
- package/es/Textarea/docs/Textarea__custom.docs.js +82 -0
- package/es/Textarea/docs/Textarea__default.docs.js +76 -0
- package/es/Textarea/docs/Textarea__disabled.docs.js +29 -0
- package/es/Tooltip/Tooltip.js +40 -2
- package/es/Tooltip/docs/Tooltip__default.docs.js +371 -0
- package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +97 -0
- package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +150 -0
- package/es/a11y/FocusScope/docs/FocusScope__default.docs.js +139 -0
- package/es/beta/FocusRing/docs/FocusRing__default.docs.js +48 -0
- package/es/common/docStyle.module.css +6 -2
- package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +72 -0
- package/es/index.js +1 -1
- package/es/semantic/Button/docs/Button__default.docs.js +20 -0
- package/lib/Accordion/docs/Accordion__Demo.docs.js +126 -0
- package/lib/Animation/docs/Animation__default.docs.js +85 -0
- package/lib/Animation/docs/Animation__fadeIn.docs.js +85 -0
- package/lib/Animation/docs/Animation__scaleIn.docs.js +85 -0
- package/lib/Animation/docs/Animation__skewIn.docs.js +85 -0
- package/lib/Animation/docs/Animation__slideDown.docs.js +85 -0
- package/lib/Animation/docs/Animation__slideLeft.docs.js +85 -0
- package/lib/Animation/docs/Animation__zoomIn.docs.js +85 -0
- package/lib/AppContainer/docs/AppContainer__default.docs.js +70 -0
- package/lib/Avatar/docs/Avatar__custom.docs.js +87 -0
- package/lib/Avatar/docs/Avatar__default.docs.js +83 -0
- package/lib/Avatar/docs/Avatar__palette.docs.js +107 -0
- package/lib/Avatar/docs/Avatar__text.docs.js +86 -0
- package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +124 -0
- package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +82 -0
- package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +101 -0
- package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +100 -0
- package/lib/Button/docs/Button__custom.docs.js +826 -0
- package/lib/Button/docs/Button__default.docs.js +590 -0
- package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +89 -0
- package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +85 -0
- package/lib/Buttongroup/docs/Buttongroup__header.docs.js +98 -0
- package/lib/Card/docs/Card__Custom.docs.js +90 -0
- package/lib/Card/docs/Card__Default.docs.js +92 -0
- package/lib/Card/docs/Card__Scroll.docs.js +114 -0
- package/lib/CheckBox/docs/CheckBox__custom.docs.js +348 -0
- package/lib/CheckBox/docs/CheckBox__default.docs.js +273 -0
- package/lib/DateTime/docs/DateTime__default.docs.js +142 -0
- package/lib/DateTime/docs/DateWidget__default.docs.js +240 -0
- package/lib/DateTime/docs/timezonedata.json +1 -0
- package/lib/DropBox/docs/DropBox__custom.docs.js +122 -0
- package/lib/DropBox/docs/DropBox__customOrder.docs.js +141 -0
- package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +140 -0
- package/lib/DropBox/docs/DropBox__position.docs.js +142 -0
- package/lib/DropBox/docs/DropBox__size.docs.js +116 -0
- package/lib/DropDown/docs/DropDownHeading__custom.docs.js +73 -0
- package/lib/DropDown/docs/DropDownHeading__default.docs.js +70 -0
- package/lib/Label/docs/Label__clipped.docs.js +81 -0
- package/lib/Label/docs/Label__custom.docs.js +85 -0
- package/lib/Label/docs/Label__palette.docs.js +96 -0
- package/lib/Label/docs/Label__size.docs.js +83 -0
- package/lib/Label/docs/Label__type.docs.js +91 -0
- package/lib/Layout/docs/Layout__Hidden.docs.js +127 -0
- package/lib/Layout/docs/Layout__default.docs.js +98 -0
- package/lib/Layout/docs/Layout__four_Column.docs.js +135 -0
- package/lib/Layout/docs/Layout__three_Column.docs.js +126 -0
- package/lib/Layout/docs/Layout__two_Column.docs.js +119 -0
- package/lib/LightNightMode/docs/AlternativeColors.docs.js +131 -0
- package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +206 -0
- package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +162 -0
- package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +142 -0
- package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +115 -0
- package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +119 -0
- package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +112 -0
- package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +142 -0
- package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +115 -0
- package/lib/ListItem/docs/ListItem__custom.docs.js +164 -0
- package/lib/ListItem/docs/ListItem__default.docs.js +131 -0
- package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +177 -0
- package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +165 -0
- package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +191 -0
- package/lib/MultiSelect/docs/MultiSelect__default.docs.js +214 -0
- package/lib/PopOver/docs/PopOver__default.docs.js +86 -0
- package/lib/Provider/docs/Provider_Id__Class.docs.js +77 -0
- package/lib/Provider/docs/Provider_Id__Function.docs.js +29 -0
- package/lib/Provider/docs/Provider_Zindex__Class.docs.js +80 -0
- package/lib/Provider/docs/Provider_Zindex__Function.docs.js +34 -0
- package/lib/Radio/docs/Radio__custom.docs.js +299 -0
- package/lib/Radio/docs/Radio__default.docs.js +222 -0
- package/lib/Responsive/docs/Responsive__Custom.docs.js +272 -0
- package/lib/Responsive/docs/Responsive__default.docs.js +142 -0
- package/lib/Responsive/docs/style.module.css +56 -0
- package/lib/Ribbon/docs/Ribbon__custom.docs.js +437 -0
- package/lib/Ribbon/docs/Ribbon__default.docs.js +392 -0
- package/lib/RippleEffect/docs/RippleEffect__default.docs.js +484 -0
- package/lib/Select/docs/GroupSelect__default.docs.js +199 -0
- package/lib/Select/docs/SelectWithAvatar__default.docs.js +152 -0
- package/lib/Select/docs/SelectWithIcon__default.docs.js +190 -0
- package/lib/Select/docs/Select__default.docs.js +340 -0
- package/lib/Stencils/docs/Stencils__custom.docs.js +96 -0
- package/lib/Stencils/docs/Stencils__default.docs.js +101 -0
- package/lib/Switch/docs/Switch__custom.docs.js +203 -0
- package/lib/Switch/docs/Switch__default.docs.js +156 -0
- package/lib/Tab/docs/Tab__default.docs.js +308 -0
- package/lib/Tab/docs/tabdocs.module.css +29 -0
- package/lib/Tag/docs/Tag__custom.docs.js +423 -0
- package/lib/Tag/docs/Tag__default.docs.js +377 -0
- package/lib/TextBox/docs/TextBox__custom.docs.js +98 -0
- package/lib/TextBox/docs/TextBox__default.docs.js +95 -0
- package/lib/TextBox/docs/TextBox__size.docs.js +93 -0
- package/lib/TextBox/docs/TextBox__variant.docs.js +93 -0
- package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +145 -0
- package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +117 -0
- package/lib/Textarea/docs/Textarea__animated.docs.js +95 -0
- package/lib/Textarea/docs/Textarea__custom.docs.js +137 -0
- package/lib/Textarea/docs/Textarea__default.docs.js +130 -0
- package/lib/Textarea/docs/Textarea__disabled.docs.js +83 -0
- package/lib/Tooltip/docs/Tooltip__default.docs.js +391 -0
- package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +150 -0
- package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +206 -0
- package/lib/a11y/FocusScope/docs/FocusScope__default.docs.js +191 -0
- package/lib/beta/FocusRing/docs/FocusRing__default.docs.js +101 -0
- package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +145 -0
- package/lib/semantic/Button/docs/Button__default.docs.js +66 -0
- package/package.json +7 -7
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
CodeMirror.extendMode('css', {
|
|
3
|
+
commentStart: '/*',
|
|
4
|
+
commentEnd: '*/',
|
|
5
|
+
newlineAfterToken: function(type, content) {
|
|
6
|
+
return /^[;{}]$/.test(content);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
CodeMirror.extendMode('javascript', {
|
|
11
|
+
commentStart: '/*',
|
|
12
|
+
commentEnd: '*/',
|
|
13
|
+
// FIXME semicolons inside of for
|
|
14
|
+
newlineAfterToken: function(type, content, textAfter, state) {
|
|
15
|
+
if (this.jsonMode) {
|
|
16
|
+
return /^[\[,{]$/.test(content) || /^}/.test(textAfter);
|
|
17
|
+
} else {
|
|
18
|
+
if (content == ';' && state.lexical && state.lexical.type == ')')
|
|
19
|
+
return false;
|
|
20
|
+
return /^[;{}]$/.test(content) && !/^;/.test(textAfter);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
CodeMirror.extendMode('xml', {
|
|
26
|
+
commentStart: '<!--',
|
|
27
|
+
commentEnd: '-->',
|
|
28
|
+
newlineAfterToken: function(type, content, textAfter) {
|
|
29
|
+
return (type == 'tag' && />$/.test(content)) || /^</.test(textAfter);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Comment/uncomment the specified range
|
|
34
|
+
CodeMirror.defineExtension('commentRange', function(isComment, from, to) {
|
|
35
|
+
var cm = this,
|
|
36
|
+
curMode = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(from).state)
|
|
37
|
+
.mode;
|
|
38
|
+
cm.operation(function() {
|
|
39
|
+
if (isComment) {
|
|
40
|
+
// Comment range
|
|
41
|
+
cm.replaceRange(curMode.commentEnd, to);
|
|
42
|
+
cm.replaceRange(curMode.commentStart, from);
|
|
43
|
+
if (from.line == to.line && from.ch == to.ch)
|
|
44
|
+
// An empty comment inserted - put cursor inside
|
|
45
|
+
cm.setCursor(from.line, from.ch + curMode.commentStart.length);
|
|
46
|
+
} else {
|
|
47
|
+
// Uncomment range
|
|
48
|
+
var selText = cm.getRange(from, to);
|
|
49
|
+
var startIndex = selText.indexOf(curMode.commentStart);
|
|
50
|
+
var endIndex = selText.lastIndexOf(curMode.commentEnd);
|
|
51
|
+
if (startIndex > -1 && endIndex > -1 && endIndex > startIndex) {
|
|
52
|
+
// Take string till comment start
|
|
53
|
+
selText =
|
|
54
|
+
selText.substr(0, startIndex) +
|
|
55
|
+
// From comment start till comment end
|
|
56
|
+
selText.substring(
|
|
57
|
+
startIndex + curMode.commentStart.length,
|
|
58
|
+
endIndex
|
|
59
|
+
) +
|
|
60
|
+
// From comment end till string end
|
|
61
|
+
selText.substr(endIndex + curMode.commentEnd.length);
|
|
62
|
+
}
|
|
63
|
+
cm.replaceRange(selText, from, to);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Applies automatic mode-aware indentation to the specified range
|
|
69
|
+
CodeMirror.defineExtension('autoIndentRange', function(from, to) {
|
|
70
|
+
var cmInstance = this;
|
|
71
|
+
this.operation(function() {
|
|
72
|
+
for (var i = from.line; i <= to.line; i++) {
|
|
73
|
+
cmInstance.indentLine(i, 'smart');
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Applies automatic formatting to the specified range
|
|
79
|
+
CodeMirror.defineExtension('autoFormatRange', function(from, to) {
|
|
80
|
+
var cm = this;
|
|
81
|
+
var outer = cm.getMode(),
|
|
82
|
+
text = cm.getRange(from, to).split('\n');
|
|
83
|
+
var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state);
|
|
84
|
+
var tabSize = cm.getOption('tabSize');
|
|
85
|
+
|
|
86
|
+
var out = '',
|
|
87
|
+
lines = 0,
|
|
88
|
+
atSol = from.ch == 0;
|
|
89
|
+
function newline() {
|
|
90
|
+
out += '\n';
|
|
91
|
+
atSol = true;
|
|
92
|
+
++lines;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
for (var i = 0; i < text.length; ++i) {
|
|
96
|
+
var stream = new CodeMirror.StringStream(text[i], tabSize);
|
|
97
|
+
while (!stream.eol()) {
|
|
98
|
+
var inner = CodeMirror.innerMode(outer, state);
|
|
99
|
+
var style = outer.token(stream, state),
|
|
100
|
+
cur = stream.current();
|
|
101
|
+
stream.start = stream.pos;
|
|
102
|
+
if (!atSol || /\S/.test(cur)) {
|
|
103
|
+
out += cur;
|
|
104
|
+
atSol = false;
|
|
105
|
+
}
|
|
106
|
+
if (
|
|
107
|
+
!atSol &&
|
|
108
|
+
inner.mode.newlineAfterToken &&
|
|
109
|
+
inner.mode.newlineAfterToken(
|
|
110
|
+
style,
|
|
111
|
+
cur,
|
|
112
|
+
stream.string.slice(stream.pos) || text[i + 1] || '',
|
|
113
|
+
inner.state
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
newline();
|
|
117
|
+
}
|
|
118
|
+
if (!stream.pos && outer.blankLine) outer.blankLine(state);
|
|
119
|
+
if (!atSol) newline();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
cm.operation(function() {
|
|
123
|
+
cm.replaceRange(out, from, to);
|
|
124
|
+
for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur)
|
|
125
|
+
cm.indentLine(cur, 'smart');
|
|
126
|
+
cm.setSelection(from, cm.getCursor(false));
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
})();
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
CodeMirror.defineMode("htmlmixed", function(config) {
|
|
2
|
+
var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
|
|
3
|
+
var jsMode = CodeMirror.getMode(config, "javascript");
|
|
4
|
+
var cssMode = CodeMirror.getMode(config, "css");
|
|
5
|
+
|
|
6
|
+
function html(stream, state) {
|
|
7
|
+
var style = htmlMode.token(stream, state.htmlState);
|
|
8
|
+
if (/(?:^|\s)tag(?:\s|$)/.test(style) && stream.current() == ">" && state.htmlState.context) {
|
|
9
|
+
if (/^script$/i.test(state.htmlState.context.tagName)) {
|
|
10
|
+
state.token = javascript;
|
|
11
|
+
state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));
|
|
12
|
+
}
|
|
13
|
+
else if (/^style$/i.test(state.htmlState.context.tagName)) {
|
|
14
|
+
state.token = css;
|
|
15
|
+
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return style;
|
|
19
|
+
}
|
|
20
|
+
function maybeBackup(stream, pat, style) {
|
|
21
|
+
var cur = stream.current();
|
|
22
|
+
var close = cur.search(pat), m;
|
|
23
|
+
if (close > -1) stream.backUp(cur.length - close);
|
|
24
|
+
else if (m = cur.match(/<\/?$/)) {
|
|
25
|
+
stream.backUp(cur.length);
|
|
26
|
+
if (!stream.match(pat, false)) stream.match(cur[0]);
|
|
27
|
+
}
|
|
28
|
+
return style;
|
|
29
|
+
}
|
|
30
|
+
function javascript(stream, state) {
|
|
31
|
+
if (stream.match(/^<\/\s*script\s*>/i, false)) {
|
|
32
|
+
state.token = html;
|
|
33
|
+
state.localState = null;
|
|
34
|
+
return html(stream, state);
|
|
35
|
+
}
|
|
36
|
+
return maybeBackup(stream, /<\/\s*script\s*>/,
|
|
37
|
+
jsMode.token(stream, state.localState));
|
|
38
|
+
}
|
|
39
|
+
function css(stream, state) {
|
|
40
|
+
if (stream.match(/^<\/\s*style\s*>/i, false)) {
|
|
41
|
+
state.token = html;
|
|
42
|
+
state.localState = null;
|
|
43
|
+
return html(stream, state);
|
|
44
|
+
}
|
|
45
|
+
return maybeBackup(stream, /<\/\s*style\s*>/,
|
|
46
|
+
cssMode.token(stream, state.localState));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
startState: function() {
|
|
51
|
+
var state = htmlMode.startState();
|
|
52
|
+
return {token: html, localState: null, mode: "html", htmlState: state};
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
copyState: function(state) {
|
|
56
|
+
if (state.localState)
|
|
57
|
+
var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState);
|
|
58
|
+
return {token: state.token, localState: local, mode: state.mode,
|
|
59
|
+
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
token: function(stream, state) {
|
|
63
|
+
return state.token(stream, state);
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
indent: function(state, textAfter) {
|
|
67
|
+
if (state.token == html || /^\s*<\//.test(textAfter))
|
|
68
|
+
return htmlMode.indent(state.htmlState, textAfter);
|
|
69
|
+
else if (state.token == javascript)
|
|
70
|
+
return jsMode.indent(state.localState, textAfter);
|
|
71
|
+
else
|
|
72
|
+
return cssMode.indent(state.localState, textAfter);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
electricChars: "/{}:",
|
|
76
|
+
|
|
77
|
+
innerMode: function(state) {
|
|
78
|
+
var mode = state.token == html ? htmlMode : state.token == javascript ? jsMode : cssMode;
|
|
79
|
+
return {state: state.localState || state.htmlState, mode: mode};
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}, "xml", "javascript", "css");
|
|
83
|
+
|
|
84
|
+
CodeMirror.defineMIME("text/html", "htmlmixed");
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<link href="./images/desklogo.png" type="IMAGE/X-ICON" rel="SHORTCUT ICON">
|
|
7
|
+
|
|
8
|
+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
9
|
+
<title>Zoho Desk - Style Quide</title>
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="/docs/css/main.css">
|
|
11
|
+
|
|
12
|
+
<script src="./codemirror.js"></script>
|
|
13
|
+
<script src="./autorefresh.js"></script>
|
|
14
|
+
<script src="./xml.js"></script>
|
|
15
|
+
<script src="./htmlmixed.js"></script>
|
|
16
|
+
<script src="./jsx.js"></script>
|
|
17
|
+
<script src="./format.js"></script>
|
|
18
|
+
<script src="./active-line.js"></script>
|
|
19
|
+
<script src="./matchbrackets.js"></script>
|
|
20
|
+
<script src="https://cdn.jsdelivr.net/npm/prettier@1.16.4/standalone.js"></script>
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/prettier@1.16.4/parser-html.js"></script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script src="./designTokens.js"></script>
|
|
25
|
+
<script src='/docs/js/vendor.js'></script>
|
|
26
|
+
<script src='/docs/js/main.js'></script>
|
|
27
|
+
<link rel="stylesheet" type="text/css" href="./css/styleGuide.css">
|
|
28
|
+
<link rel='manifest' href='/docs/js/manifest.json'>
|
|
29
|
+
|
|
30
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
31
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
32
|
+
<meta name="apple-mobile-web-app-title" content="Zoho Desk Components">
|
|
33
|
+
|
|
34
|
+
<link rel="stylesheet" type="text/css" href="./css/hopscotch.css">
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
function process(str) {
|
|
40
|
+
var div = document.createElement('div');
|
|
41
|
+
div.innerHTML = str.trim();
|
|
42
|
+
|
|
43
|
+
return format(div, 0).innerHTML;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function format(node, level) {
|
|
47
|
+
var indentBefore = new Array(level++ + 1).join(' '),
|
|
48
|
+
indentAfter = new Array(level - 1).join(' '),
|
|
49
|
+
textNode;
|
|
50
|
+
|
|
51
|
+
for (var i = 0; i < node.children.length; i++) {
|
|
52
|
+
textNode = document.createTextNode('\n' + indentBefore);
|
|
53
|
+
node.insertBefore(textNode, node.children[i]);
|
|
54
|
+
|
|
55
|
+
format(node.children[i], level);
|
|
56
|
+
|
|
57
|
+
if (node.lastElementChild == node.children[i]) {
|
|
58
|
+
textNode = document.createTextNode('\n' + indentAfter);
|
|
59
|
+
node.appendChild(textNode);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return node;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function selectText(containerid) {
|
|
66
|
+
if (document.selection) {
|
|
67
|
+
// IE
|
|
68
|
+
var range = document.body.createTextRange();
|
|
69
|
+
range.moveToElementText(document.getElementById(containerid));
|
|
70
|
+
range.select();
|
|
71
|
+
document.execCommand('copy');
|
|
72
|
+
} else if (window.getSelection) {
|
|
73
|
+
var range = document.createRange();
|
|
74
|
+
range.selectNode(document.getElementById(containerid));
|
|
75
|
+
window.getSelection().removeAllRanges();
|
|
76
|
+
window.getSelection().addRange(range);
|
|
77
|
+
document.execCommand('copy');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
</head>
|
|
83
|
+
<body>
|
|
84
|
+
<div class='hideSVG'>
|
|
85
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
86
|
+
<defs>
|
|
87
|
+
<symbol id="icon-search" viewBox="0 0 32 32">
|
|
88
|
+
<path d="M31.008 27.231l-7.58-6.447c-0.784-0.705-1.622-1.029-2.299-0.998 1.789-2.096 2.87-4.815 2.87-7.787 0-6.627-5.373-12-12-12s-12 5.373-12 12 5.373 12 12 12c2.972 0 5.691-1.081 7.787-2.87-0.031 0.677 0.293 1.515 0.998 2.299l6.447 7.58c1.104 1.226 2.907 1.33 4.007 0.23s0.997-2.903-0.23-4.007zM12 20c-4.418 0-8-3.582-8-8s3.582-8 8-8 8 3.582 8 8-3.582 8-8 8z"></path>
|
|
89
|
+
</symbol>
|
|
90
|
+
<defs>
|
|
91
|
+
<symbol id="icon-copy" viewBox="0 0 500 500">
|
|
92
|
+
<path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124
|
|
93
|
+
C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124
|
|
94
|
+
c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/>
|
|
95
|
+
<path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227
|
|
96
|
+
c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6
|
|
97
|
+
V38.6C439.65,17.3,422.35,0,401.05,0z"/>
|
|
98
|
+
</symbol>
|
|
99
|
+
<symbol id="icon-desk" viewBox="0 0 24 32" >
|
|
100
|
+
<path d="M23.7,3.8l-4,22.1c-0.3,1.4-1.4,2.4-2.9,2.4H4.6c-0.2,0-0.5,0.2-0.6,0.2l-3.4,2.7c-0.3,0.2-0.6,0-0.6-0.3l3.5-18.7
|
|
101
|
+
C3.8,10.9,5,9.8,6.4,9.8h7.5c0.6,0,1.1,0.5,1,1.1l-0.3,1.8c0,0.5-0.5,0.8-1,0.8H7.8c-0.5,0-1,0.3-1,0.8l-1.6,9.3
|
|
102
|
+
c-0.2,0.6,0.3,1.1,1,1.1h9.3c0.5,0,1-0.3,1-0.8l3-16.6c0.2-0.6-0.3-1.1-1-1.1h-1.4c-0.6,0-1.1-0.5-1-1.1l0.6-3.5
|
|
103
|
+
c0.2-0.5,0.5-0.8,1-0.8H21C22.6,0.5,24,2.1,23.7,3.8z"/>
|
|
104
|
+
</symbol>
|
|
105
|
+
<symbol id="icon-rtl" viewBox="0 0 1000 1000" >
|
|
106
|
+
<g transform="matrix(1 0 0 -1 0 1638)">
|
|
107
|
+
<path d="M809.6,1628H371.3c-28.6,0-55.3-5.4-80.4-16.1c-25-10.7-46.9-25.5-65.5-44.3c-18.6-18.8-33.4-40.7-44.3-65.8s-16.4-51.6-16.4-79.9c0-28.6,5.5-55.3,16.4-80.4c10.9-25,25.7-46.9,44.3-65.8s40.5-33.6,65.5-44.3c25-10.7,51.8-16.1,80.4-16.1h51.4V983.1c0-7.1,2.5-13.1,7.6-18.1s11.1-7.6,18.1-7.6c7.4,0,13.6,2.5,18.6,7.6c5,5,7.6,11.1,7.6,18.1v593.5h154.7V983.1c0-7.1,2.5-13.1,7.6-18.1s11.1-7.6,18.1-7.6c7.1,0,13.1,2.5,18.1,7.6s7.6,11.1,7.6,18.1v593.5h129c7.1,0,13.1,2.5,18.1,7.6s7.6,11.1,7.6,18.1c0,7.1-2.5,13.1-7.6,18.1S816.7,1628,809.6,1628L809.6,1628z M422.7,1266.7h-51.4c-21.5,0-41.7,4.1-60.5,12.3c-18.8,8.2-35.2,19.3-49.1,33.3c-13.9,13.9-24.9,30.3-33,49.1c-8.1,18.8-12.1,39-12.1,60.5c0,21.2,4,41.1,12.1,60c8.1,18.8,19.1,35.2,33,49.1c13.9,13.9,30.3,25,49.1,33.3c18.8,8.2,39,12.3,60.5,12.3h51.4V1266.7L422.7,1266.7z M758.2,802.7H278.6l59.5,59c5,5,7.6,11.2,7.6,18.4c0,7.2-2.5,13.4-7.6,18.4c-5,5-11.2,7.6-18.4,7.6c-7.2,0-13.4-2.5-18.4-7.6L197.9,795.1c-5-5-7.6-11.2-7.6-18.4c0-7.2,2.5-13.4,7.6-18.4l103.3-102.8c2.7-2.7,5.6-4.6,8.8-5.8c3.2-1.2,6.3-1.8,9.3-1.8c3.4,0,6.6,0.6,9.8,1.8c3.2,1.2,6.1,3.1,8.8,5.8c5,5,7.6,11.1,7.6,18.1c0,7.1-2.5,13.1-7.6,18.1l-59.5,59h479.7c7.1,0,13.1,2.5,18.1,7.6c5,5,7.6,11.3,7.6,18.6c0,7.1-2.5,13.1-7.6,18.1C771.3,800.2,765.3,802.7,758.2,802.7L758.2,802.7z"/>
|
|
108
|
+
</g>
|
|
109
|
+
</symbol>
|
|
110
|
+
</svg>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
<div id='react'></div>
|
|
117
|
+
|
|
118
|
+
<script src="./js/main.js"></script>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</body>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
</html>
|