docks_theme_api 1.0.2
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.
- checksums.yaml +15 -0
- data/.babelrc +4 -0
- data/.editorconfig +8 -0
- data/.eslintrc +115 -0
- data/.gitignore +24 -0
- data/.rubocop.yml +20 -0
- data/.travis.yml +16 -0
- data/Gemfile +4 -0
- data/README.md +5 -0
- data/Rakefile +3 -0
- data/assets/images/icons.svg +63 -0
- data/assets/scripts/coffeescript/pattern_library_helpers.coffee +8 -0
- data/assets/scripts/javascript/pattern_library_helpers.js +11 -0
- data/assets/scripts/pattern_library.js +10380 -0
- data/assets/scripts/pattern_library_demo.js +0 -0
- data/assets/styles/less/pattern-library-helpers.less +103 -0
- data/assets/styles/pattern-library-demo.css +1882 -0
- data/assets/styles/pattern-library.css +1882 -0
- data/assets/styles/sass/pattern-library-helpers.sass +90 -0
- data/assets/styles/scss/pattern-library-helpers.scss +99 -0
- data/assets/styles/stylus/pattern-library-helpers.styl +90 -0
- data/assets/templates/erb/demo.erb +26 -0
- data/assets/templates/erb/layouts/demo.erb +17 -0
- data/assets/templates/erb/layouts/pattern.erb +76 -0
- data/assets/templates/erb/partials/sidebar.erb +124 -0
- data/assets/templates/erb/partials/symbols/class.erb +1 -0
- data/assets/templates/erb/partials/symbols/demo.erb +40 -0
- data/assets/templates/erb/partials/symbols/factory.erb +70 -0
- data/assets/templates/erb/partials/symbols/function.erb +103 -0
- data/assets/templates/erb/partials/symbols/mixin.erb +62 -0
- data/assets/templates/erb/partials/symbols/variable.erb +59 -0
- data/assets/templates/erb/pattern.erb +102 -0
- data/assets/templates/haml/demo.haml +14 -0
- data/assets/templates/haml/layouts/demo.haml +6 -0
- data/assets/templates/haml/layouts/pattern.haml +38 -0
- data/assets/templates/haml/partials/sidebar.haml +68 -0
- data/assets/templates/haml/partials/symbols/class.haml +1 -0
- data/assets/templates/haml/partials/symbols/demo.haml +23 -0
- data/assets/templates/haml/partials/symbols/factory.haml +38 -0
- data/assets/templates/haml/partials/symbols/function.haml +54 -0
- data/assets/templates/haml/partials/symbols/mixin.haml +31 -0
- data/assets/templates/haml/partials/symbols/variable.haml +22 -0
- data/assets/templates/haml/pattern.haml +54 -0
- data/assets/templates/slim/demo.slim +24 -0
- data/assets/templates/slim/layouts/demo.slim +5 -0
- data/assets/templates/slim/layouts/pattern.slim +48 -0
- data/assets/templates/slim/partials/sidebar.slim +112 -0
- data/assets/templates/slim/partials/symbols/class.slim +1 -0
- data/assets/templates/slim/partials/symbols/demo.slim +30 -0
- data/assets/templates/slim/partials/symbols/factory.slim +57 -0
- data/assets/templates/slim/partials/symbols/function.slim +81 -0
- data/assets/templates/slim/partials/symbols/mixin.slim +45 -0
- data/assets/templates/slim/partials/symbols/variable.slim +35 -0
- data/assets/templates/slim/pattern.slim +63 -0
- data/docks_config.rb +32 -0
- data/docks_theme_api.gemspec +37 -0
- data/gulpfile.js +88 -0
- data/karma.conf.js +6 -0
- data/lib/docks_theme_api/components/base_component.rb +99 -0
- data/lib/docks_theme_api/components/code_block_component.rb +10 -0
- data/lib/docks_theme_api/components/popover_component.rb +15 -0
- data/lib/docks_theme_api/components/table_component.rb +34 -0
- data/lib/docks_theme_api/components/tablist_component.rb +11 -0
- data/lib/docks_theme_api/components.rb +21 -0
- data/lib/docks_theme_api/helpers/ui_helper.rb +69 -0
- data/lib/docks_theme_api/theme.rb +21 -0
- data/lib/docks_theme_api.rb +1 -0
- data/package.json +60 -0
- data/source/behaviors/filterable/filterable.coffee +353 -0
- data/source/behaviors/filterable/filterable.js +0 -0
- data/source/behaviors/filterable/filterable.scss +34 -0
- data/source/behaviors/filterable/package.json +3 -0
- data/source/behaviors/index.js +0 -0
- data/source/components/avatar/avatar.erb +20 -0
- data/source/components/avatar/avatar.js +142 -0
- data/source/components/avatar/avatar.scss +200 -0
- data/source/components/avatar/avatar_container.erb +13 -0
- data/source/components/avatar/package.json +3 -0
- data/source/components/avatar/spec/avatar_spec.js +81 -0
- data/source/components/badge/badge.scss +158 -0
- data/source/components/button/button.scss +213 -0
- data/source/components/card/card.scss +32 -0
- data/source/components/code_block/code-block.scss +353 -0
- data/source/components/code_block/code_block.erb +95 -0
- data/source/components/code_block/code_block.js +444 -0
- data/source/components/code_block/package.json +3 -0
- data/source/components/code_block/spec/code_block_spec.js +10 -0
- data/source/components/demo/demo.js +244 -0
- data/source/components/demo/demo.scss +90 -0
- data/source/components/demo/package.json +3 -0
- data/source/components/exploded/exploded.erb +25 -0
- data/source/components/exploded/exploded.js +694 -0
- data/source/components/exploded/exploded.scss +166 -0
- data/source/components/exploded/package.json +3 -0
- data/source/components/field/field.js +24 -0
- data/source/components/field/field.scss +101 -0
- data/source/components/field/package.json +3 -0
- data/source/components/header/header.scss +33 -0
- data/source/components/iframe/iframe.erb +12 -0
- data/source/components/iframe/iframe.js +381 -0
- data/source/components/iframe/package.json +3 -0
- data/source/components/index.js +37 -0
- data/source/components/inline_group/inline-group.scss +14 -0
- data/source/components/internal_link/internal_link.js +49 -0
- data/source/components/internal_link/package.json +3 -0
- data/source/components/list/list.scss +230 -0
- data/source/components/modal/modal.coffee +84 -0
- data/source/components/modal/modal.erb +19 -0
- data/source/components/modal/modal.js +0 -0
- data/source/components/modal/modal.scss +57 -0
- data/source/components/modal/package.json +3 -0
- data/source/components/notice/notice.scss +48 -0
- data/source/components/popover/package.json +3 -0
- data/source/components/popover/popover.coffee +562 -0
- data/source/components/popover/popover.erb +21 -0
- data/source/components/popover/popover.js +0 -0
- data/source/components/popover/popover.scss +139 -0
- data/source/components/range/range.scss +78 -0
- data/source/components/resizable/package.json +3 -0
- data/source/components/resizable/resizable.erb +30 -0
- data/source/components/resizable/resizable.js +250 -0
- data/source/components/resizable/resizable.scss +245 -0
- data/source/components/resizable/size_buttons.js +249 -0
- data/source/components/scroll_container/package.json +3 -0
- data/source/components/scroll_container/scroll-container.scss +4 -0
- data/source/components/scroll_container/scroll_container.js +24 -0
- data/source/components/section/section.scss +99 -0
- data/source/components/select/package.json +3 -0
- data/source/components/select/select.erb +21 -0
- data/source/components/select/select.js +35 -0
- data/source/components/select/select.scss +163 -0
- data/source/components/table/package.json +3 -0
- data/source/components/table/table.erb +16 -0
- data/source/components/table/table.js +351 -0
- data/source/components/table/table.scss +236 -0
- data/source/components/tablist/package.json +3 -0
- data/source/components/tablist/tablist.erb +13 -0
- data/source/components/tablist/tablist.js +246 -0
- data/source/components/tablist/tablist.scss +191 -0
- data/source/components/tablist/tablist_panel.erb +14 -0
- data/source/components/tablist/tablist_tab.erb +20 -0
- data/source/components/toggle/package.json +3 -0
- data/source/components/toggle/toggle.erb +11 -0
- data/source/components/toggle/toggle.js +211 -0
- data/source/components/toggle/toggle_container.erb +30 -0
- data/source/components/vertical_spacer/vertical-spacer.scss +3 -0
- data/source/components/vertical_stack/vertical-stack.scss +19 -0
- data/source/components/xray/package.json +3 -0
- data/source/components/xray/xray.erb +50 -0
- data/source/components/xray/xray.js +123 -0
- data/source/components/xray/xray.scss +79 -0
- data/source/foundation/app/app.js +15 -0
- data/source/foundation/app/package.json +3 -0
- data/source/pattern-library-demo.scss +13 -0
- data/source/pattern-library.scss +13 -0
- data/source/pattern_library.js +8 -0
- data/source/pattern_library_demo.js +8 -0
- data/source/structures/index.js +11 -0
- data/source/structures/sidebar/package.json +3 -0
- data/source/structures/sidebar/sidebar.js +69 -0
- data/source/structures/sidebar/sidebar.scss +79 -0
- data/source/utilities/builder/builder.js +138 -0
- data/source/utilities/builder/package.json +3 -0
- data/source/utilities/client/client.js +7 -0
- data/source/utilities/client/package.json +3 -0
- data/source/utilities/colors/colors.scss +112 -0
- data/source/utilities/defaults/defaults.scss +38 -0
- data/source/utilities/dom_cache/dom_cache.js +24 -0
- data/source/utilities/dom_cache/package.json +3 -0
- data/source/utilities/events/events.js +25 -0
- data/source/utilities/events/package.json +3 -0
- data/source/utilities/font_sizes/font-sizes.scss +85 -0
- data/source/utilities/foundation/a11y.scss +10 -0
- data/source/utilities/foundation/base.scss +29 -0
- data/source/utilities/foundation/icon.scss +114 -0
- data/source/utilities/foundation/layout.scss +67 -0
- data/source/utilities/foundation/page.scss +39 -0
- data/source/utilities/foundation/type.scss +208 -0
- data/source/utilities/functions/functions.scss +127 -0
- data/source/utilities/keycodes/keycodes.js +23 -0
- data/source/utilities/keycodes/package.json +3 -0
- data/source/utilities/markup/markup.js +90 -0
- data/source/utilities/markup/package.json +3 -0
- data/source/utilities/media/media.scss +172 -0
- data/source/utilities/mixins/mixins.scss +89 -0
- data/source/utilities/naming_convention/naming_convention.js +3 -0
- data/source/utilities/naming_convention/package.json +3 -0
- data/source/utilities/numbers/numbers.js +14 -0
- data/source/utilities/numbers/package.json +3 -0
- data/source/utilities/painting/package.json +3 -0
- data/source/utilities/painting/painting.js +7 -0
- data/source/utilities/pattern/package.json +3 -0
- data/source/utilities/pattern/pattern.js +50 -0
- data/source/utilities/query_string/package.json +3 -0
- data/source/utilities/query_string/query_string.js +24 -0
- data/source/utilities/template/package.json +3 -0
- data/source/utilities/template/template.js +10 -0
- data/source/utilities/text_range/package.json +3 -0
- data/source/utilities/text_range/text_range.js +30 -0
- data/source/utilities/ui_events/package.json +3 -0
- data/source/utilities/ui_events/ui_events.js +85 -0
- data/source/utilities/variables/variables.scss +18 -0
- data/source/utilities/z_indexes/z-indexes.scss +88 -0
- data/source/vendor/array_includes.js +28 -0
- data/source/vendor/highlight.js +1142 -0
- data/source/vendor/index.js +1 -0
- data/source/vendor/matrix.js +399 -0
- data/source/vendor/query_string.js +66 -0
- data/spec/assets/.eslintrc +9 -0
- data/spec/assets/spec_fixture.js +33 -0
- data/spec/assets/spec_helper.js +19 -0
- data/spec/lib/components/base_component_spec.rb +156 -0
- data/spec/lib/components_spec.rb +30 -0
- data/spec/lib/helpers/ui_helper_spec.rb +62 -0
- data/spec/lib/theme_spec.rb +25 -0
- data/spec/spec_helper.rb +15 -0
- data/tasks/gulp/.eslintrc +6 -0
- data/tasks/gulp/browser_sync.js +8 -0
- data/tasks/gulp/code_quality/scripts.js +10 -0
- data/tasks/gulp/config/index.js +116 -0
- data/tasks/gulp/minify/scripts.js +13 -0
- data/tasks/gulp/minify/styles.js +13 -0
- data/tasks/gulp/pattern_library/index.js +5 -0
- data/tasks/gulp/pattern_library/scripts.js +10 -0
- data/tasks/gulp/pattern_library/styles.js +10 -0
- data/tasks/gulp/scripts.js +8 -0
- data/tasks/gulp/spec/scripts.js +11 -0
- data/tasks/gulp/styles.js +17 -0
- data/tasks/gulp/utilities/babel/relative_require.js +22 -0
- data/tasks/gulp/utilities/babel/spec_helper.js +20 -0
- data/tasks/gulp/utilities/browserify_bundler.js +22 -0
- data/tasks/gulp/utilities/handle_errors.js +13 -0
- data/tasks/gulp/watch.js +9 -0
- data/tasks/rake/rspec.rake +7 -0
- data/tasks/rake/rubocop.rake +8 -0
- data/tasks/rake/templates.rake +50 -0
- metadata +470 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// ___ ___ _____ ___
|
|
2
|
+
// /__/\ / /\ / /::\ ___ / /\
|
|
3
|
+
// | |::\ / /:/_ / /:/\:\ / /\ / /::\
|
|
4
|
+
// | |:|:\ / /:/ /\ / /:/ \:\ / /:/ / /:/\:\
|
|
5
|
+
// __|__|:|\:\ / /:/ /:/_/__/:/ \__\:/__/::\ / /:/~/::\
|
|
6
|
+
// /__/::::| \:\/__/:/ /:/ /\ \:\ / /:|__\/\:\__/__/:/ /:/\:\
|
|
7
|
+
// \ \:\~~\__\/\ \:\/:/ /:/\ \:\ /:/ \ \:\/\ \:\/:/__\/
|
|
8
|
+
// \ \:\ \ \::/ /:/ \ \:\/:/ \__\::/\ \::/
|
|
9
|
+
// \ \:\ \ \:\/:/ \ \::/ /__/:/ \ \:\
|
|
10
|
+
// \ \:\ \ \::/ \__\/ \__\/ \ \:\
|
|
11
|
+
// \__\/ \__\/ \__\/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
$BREAKPOINTS: (
|
|
16
|
+
small: 25rem,
|
|
17
|
+
medium: 37.5rem,
|
|
18
|
+
large: 50rem
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
$BREAKPOINT_INCREMENTS: (
|
|
22
|
+
rem: 0.0625rem,
|
|
23
|
+
em: 0.0625em,
|
|
24
|
+
px: 1px,
|
|
25
|
+
vw: 1vw
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@function breakpoint-value-for($breakpoint) {
|
|
31
|
+
@return map-get($BREAKPOINTS, $breakpoint);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@function breakpoint-clean-value($point) {
|
|
35
|
+
@if type-of($point) == number {
|
|
36
|
+
@return $point;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@return breakpoint-value-for($point);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@function breakpoint-increment-for($value) {
|
|
43
|
+
@return map-get($BREAKPOINT_INCREMENTS, unit($value));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@function breakpoint-default-inclusivity($value, $default) {
|
|
47
|
+
$inclusivity: null;
|
|
48
|
+
@if length($value) > 1 { $inclusivity: nth($value, 2); }
|
|
49
|
+
|
|
50
|
+
@if $inclusivity {
|
|
51
|
+
@return $inclusivity == inclusive;
|
|
52
|
+
} @else {
|
|
53
|
+
@return $default;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@function breakpoint-adjusted-for-inclusivity($value, $min-or-max, $inclusive: false) {
|
|
58
|
+
$value: breakpoint-clean-value($value);
|
|
59
|
+
|
|
60
|
+
@if not $inclusive {
|
|
61
|
+
@if $min-or-max == min {
|
|
62
|
+
$value: $value + breakpoint-increment-for($value);
|
|
63
|
+
} @else {
|
|
64
|
+
$value: $value - breakpoint-increment-for($value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@return "(#{$min-or-max}-width: #{$value})";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@function breakpoint-retinize-media-query($media-query) {
|
|
72
|
+
@return "#{$media-query} and (-webkit-min-device-pixel-ratio: 2), #{$media-query} and (min-resolution: 192dpi)";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@mixin breakpoint-after($point) {
|
|
80
|
+
@media screen and #{breakpoint-adjusted-for-inclusivity($point, min)} {
|
|
81
|
+
@content;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@mixin after($point) { @include breakpoint-after($point) { @content; } }
|
|
86
|
+
|
|
87
|
+
@mixin breakpoint-before($point) {
|
|
88
|
+
@media screen and #{breakpoint-adjusted-for-inclusivity($point, max)} {
|
|
89
|
+
@content;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@mixin before($point) { @include breakpoint-before($point) { @content; } }
|
|
94
|
+
|
|
95
|
+
@mixin breakpoint($after: null, $before: null, $from: null, $to: null, $until: null, $retina: false) {
|
|
96
|
+
$min-width: null;
|
|
97
|
+
$max-width: null;
|
|
98
|
+
$min-inclusive: null;
|
|
99
|
+
$max-inclusive: null;
|
|
100
|
+
|
|
101
|
+
// $after defaults to exclusive
|
|
102
|
+
@if $after {
|
|
103
|
+
$min-width: nth($after, 1);
|
|
104
|
+
$min-inclusive: breakpoint-default-inclusivity($after, false);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// $from defaults to inclusive
|
|
108
|
+
@if $from {
|
|
109
|
+
$min-width: nth($from, 1);
|
|
110
|
+
$min-inclusive: breakpoint-default-inclusivity($from, true);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// $before defaults to exclusive
|
|
114
|
+
@if $before {
|
|
115
|
+
$max-width: nth($before, 1);
|
|
116
|
+
$max-inclusive: breakpoint-default-inclusivity($before, false);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// $to defaults to inclusive
|
|
120
|
+
@if $to {
|
|
121
|
+
$max-width: nth($to, 1);
|
|
122
|
+
$max-inclusive: breakpoint-default-inclusivity($to, true);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// $until defaults to exclusive
|
|
126
|
+
@if $until {
|
|
127
|
+
$max-width: nth($until, 1);
|
|
128
|
+
$max-inclusive: breakpoint-default-inclusivity($until, false);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@if $max-width { $max-width: breakpoint-adjusted-for-inclusivity($max-width, max, $max-inclusive); }
|
|
132
|
+
@if $min-width { $min-width: breakpoint-adjusted-for-inclusivity($min-width, min, $min-inclusive); }
|
|
133
|
+
|
|
134
|
+
$media-query: "screen";
|
|
135
|
+
@if $min-width { $media-query: $media-query + " and #{$min-width}"; }
|
|
136
|
+
@if $max-width { $media-query: $media-query + " and #{$max-width}"; }
|
|
137
|
+
@if $retina { $media-query: breakpoint-retinize-media-query($media-query); }
|
|
138
|
+
|
|
139
|
+
@media #{$media-query} {
|
|
140
|
+
@content;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@mixin print() {
|
|
147
|
+
@media print { @content; }
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
@mixin retina() {
|
|
153
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { @content; }
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
@each $breakpoint, $width in $BREAKPOINTS {
|
|
159
|
+
.media__helpers--hide-before-#{$breakpoint} {
|
|
160
|
+
@include before($width) { display: none; }
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.media__helpers--hide-after-#{$breakpoint} {
|
|
164
|
+
@include after($width) { display: none; }
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.media__helpers--show-after-#{$breakpoint} {
|
|
168
|
+
display: none;
|
|
169
|
+
|
|
170
|
+
@include after($width) { display: block; }
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// ___ ___ ___
|
|
2
|
+
// /__/\ ___ /__/| ___ /__/\
|
|
3
|
+
// | |::\ / /\ | |:| / /\ \ \:\
|
|
4
|
+
// | |:|:\ / /:/ | |:| / /:/ \ \:\
|
|
5
|
+
// __|__|:|\:\/__/::\ __|__|:| /__/::\ _____\__\:\
|
|
6
|
+
// /__/::::| \:\__\/\:\_/__/::::\___\__\/\:\__/__/::::::::\
|
|
7
|
+
// \ \:\~~\__\/ \ \:\/\ ~\~~\::::/ \ \:\/\ \:\~~\~~\/
|
|
8
|
+
// \ \:\ \__\::/ |~~|:|~~ \__\::/\ \:\ ~~~
|
|
9
|
+
// \ \:\ /__/:/ | |:| /__/:/ \ \:\
|
|
10
|
+
// \ \:\ \__\/ | |:| \__\/ \ \:\
|
|
11
|
+
// \__\/ |__|/ \__\/
|
|
12
|
+
//
|
|
13
|
+
// Mixins are used to include common functionality in components.
|
|
14
|
+
// Use these over placeholders even when no variables are required:
|
|
15
|
+
// `@extends` is more trouble than it's worth, and proper compression
|
|
16
|
+
// mostly solves the problem of duplicated markup from mixins.
|
|
17
|
+
|
|
18
|
+
// ___ ___ ___ ___ _ ___ __
|
|
19
|
+
// | \_ _/ __| _ \ | /_\ \ / /
|
|
20
|
+
// | |) | |\__ \ _/ |__ / _ \ V /
|
|
21
|
+
// |___/___|___/_| |____/_/ \_\_|
|
|
22
|
+
//
|
|
23
|
+
// =========================================================
|
|
24
|
+
// Placeholders providing common display/ positioning patterns.
|
|
25
|
+
|
|
26
|
+
@mixin composite-layer {
|
|
27
|
+
backface-visibility: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin clearfix {
|
|
31
|
+
&:after {
|
|
32
|
+
content: "";
|
|
33
|
+
display: table;
|
|
34
|
+
clear: both;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin center {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 50%; left: 50%;
|
|
41
|
+
transform: translate(-50%, -50%);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@mixin cover-all {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: 0; left: 0;
|
|
47
|
+
width: 100%; height: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin remove-browser-styling {
|
|
51
|
+
-webkit-appearance: none;
|
|
52
|
+
-moz-appearance: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// _____ ___ _ _ ___ _ _
|
|
58
|
+
// |_ _/ _ \| | | |/ __| || |
|
|
59
|
+
// | || (_) | |_| | (__| __ |
|
|
60
|
+
// |_| \___/ \___/ \___|_||_|
|
|
61
|
+
//
|
|
62
|
+
// ======================================================
|
|
63
|
+
// Placeholders to help with touch devices.
|
|
64
|
+
|
|
65
|
+
@mixin touch-scroll {
|
|
66
|
+
overflow: auto;
|
|
67
|
+
-webkit-overflow-scrolling: touch;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
// _______ _____ ___
|
|
73
|
+
// |_ _\ \ / / _ \ __|
|
|
74
|
+
// | | \ V /| _/ _|
|
|
75
|
+
// |_| |_| |_| |___|
|
|
76
|
+
//
|
|
77
|
+
// ======================================================
|
|
78
|
+
// Placholders to add nice features to text content.
|
|
79
|
+
|
|
80
|
+
@mixin word-wrap {
|
|
81
|
+
word-break: break-word;
|
|
82
|
+
hyphens: auto;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@mixin ellipsis {
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var Matrix, between;
|
|
2
|
+
|
|
3
|
+
between = (point, min, max, options = {}) => {
|
|
4
|
+
var min_condition = options.include_min ? (point >= min) : (point > min),
|
|
5
|
+
max_condition = options.include_max ? (point <= max) : (point < max);
|
|
6
|
+
return min_condition && max_condition;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Matrix = (...args) => {
|
|
10
|
+
var MatrixClass = window.WebKitCSSMatrix || window.MSCSSMatrix || window.CSSMatrix;
|
|
11
|
+
return new MatrixClass(...args);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { Matrix, between };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var Pattern, pattern, result_types, find_variation;
|
|
2
|
+
|
|
3
|
+
pattern = window.pattern;
|
|
4
|
+
delete window.pattern;
|
|
5
|
+
|
|
6
|
+
result_types = ["style", "script"];
|
|
7
|
+
|
|
8
|
+
find_variation = (component, symbol) => {
|
|
9
|
+
var variation;
|
|
10
|
+
|
|
11
|
+
for(variation of (component.state || []).concat(component.variant || [])) {
|
|
12
|
+
if(symbol.include(variation.name)) { return variation; }
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
Pattern = {
|
|
17
|
+
find(symbol, options = {}) {
|
|
18
|
+
var result_type, result, variation, subcomponent;
|
|
19
|
+
|
|
20
|
+
if(!pattern) { return false; }
|
|
21
|
+
|
|
22
|
+
symbol = symbol.split(/\s+/);
|
|
23
|
+
|
|
24
|
+
for(result_type of result_types) {
|
|
25
|
+
for(result of pattern[result_type]) {
|
|
26
|
+
if(symbol.include(result.name)) { return result; }
|
|
27
|
+
|
|
28
|
+
if(options.search_variations || options.search_all) {
|
|
29
|
+
variation = find_variation(result, symbol);
|
|
30
|
+
if(variation) { return variation; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if(options.search_subcomponents || options.search_all) {
|
|
34
|
+
for(subcomponent of (result.subcomponent || [])) {
|
|
35
|
+
if(symbol.include(subcomponent.name)) { return subcomponent; }
|
|
36
|
+
|
|
37
|
+
variation = find_variation(result, symbol);
|
|
38
|
+
if(variation) { return variation; }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return false;
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
__pattern__: pattern
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default Pattern;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import query_string from "~vendor/query_string";
|
|
2
|
+
|
|
3
|
+
var QueryString, location, query;
|
|
4
|
+
|
|
5
|
+
location = () => { return window.location; };
|
|
6
|
+
query = () => { return query_string.parse(location().search); };
|
|
7
|
+
|
|
8
|
+
QueryString = {
|
|
9
|
+
get(key) {
|
|
10
|
+
return query()[key];
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
set(key, value) {
|
|
14
|
+
var current_query = query(),
|
|
15
|
+
new_url;
|
|
16
|
+
|
|
17
|
+
current_query[key] = value;
|
|
18
|
+
new_url = `${location.protocol}//${location.host}${location.pathname}?${query_string.stringify(query)}`;
|
|
19
|
+
window.history.replaceState({ path: new_url }, document.title, new_url);
|
|
20
|
+
return current_query;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default QueryString;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var TextRange, select_all;
|
|
2
|
+
|
|
3
|
+
TextRange = (target) => {
|
|
4
|
+
return {
|
|
5
|
+
select_all() { select_all(target); }
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default TextRange;
|
|
10
|
+
|
|
11
|
+
select_all = (() => {
|
|
12
|
+
if(window.getSelection) {
|
|
13
|
+
return (target) => {
|
|
14
|
+
var selection, range;
|
|
15
|
+
|
|
16
|
+
selection = window.getSelection();
|
|
17
|
+
selection.removeAllRanges();
|
|
18
|
+
|
|
19
|
+
range = document.createRange();
|
|
20
|
+
range.selectNodeContents(target);
|
|
21
|
+
selection.addRange(range);
|
|
22
|
+
};
|
|
23
|
+
} else {
|
|
24
|
+
return (target) => {
|
|
25
|
+
var range = document.body.createTextRange();
|
|
26
|
+
range.moveToElementText(target);
|
|
27
|
+
range.select();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
})();
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// TODO
|
|
2
|
+
|
|
3
|
+
const DRAG_THRESHOLD = 5;
|
|
4
|
+
|
|
5
|
+
var UIEvents, coordinates;
|
|
6
|
+
|
|
7
|
+
coordinates = (event) => {
|
|
8
|
+
var touches = event.touches;
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
x: touches ? touches[0].x : event.pageX,
|
|
12
|
+
y: touches ? touches[0].y : event.pageY
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
coordinates.distance_between = (before, after) => {
|
|
17
|
+
var delta_x = Math.abs(after.x - before.x),
|
|
18
|
+
delta_y = Math.abs(after.y - before.y);
|
|
19
|
+
|
|
20
|
+
return Math.sqrt(delta_x * delta_x + delta_y * delta_y);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
UIEvents = {
|
|
24
|
+
get transition_end() {
|
|
25
|
+
var transitions, transition, element, event_name;
|
|
26
|
+
|
|
27
|
+
transitions = {
|
|
28
|
+
WebkitTransition: "webkitTransitionEnd",
|
|
29
|
+
MozTransition: "transitionend",
|
|
30
|
+
OTransition: "otransitionend",
|
|
31
|
+
transition: "transitionend"
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
element = document.createElement("div");
|
|
35
|
+
event_name = null;
|
|
36
|
+
|
|
37
|
+
for(transition in transitions) {
|
|
38
|
+
if(element.style[transition] !== undefined) {
|
|
39
|
+
event_name = transitions[transition];
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Object.defineProperty(UIEvents, "transition_end", { value: event_name });
|
|
45
|
+
return event_name;
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
drag: {
|
|
49
|
+
get start() { return "mousedown"; },
|
|
50
|
+
get move() { return "mousemove"; },
|
|
51
|
+
get end() { return "mouseup"; }
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
transition(node, callback) {
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
var transition_end = this.transition_end;
|
|
57
|
+
|
|
58
|
+
if(transition_end) {
|
|
59
|
+
node.addEventListener(transition_end, resolve);
|
|
60
|
+
callback();
|
|
61
|
+
} else {
|
|
62
|
+
resolve();
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
add_drag_listeners(move_handler, end_handler) {
|
|
68
|
+
var { move, end } = this.drag;
|
|
69
|
+
|
|
70
|
+
document.addEventListener(move, move_handler);
|
|
71
|
+
document.addEventListener(end, end_handler);
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
remove() {
|
|
75
|
+
document.removeEventListener(move, move_handler);
|
|
76
|
+
document.removeEventListener(end, end_handler);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
coordinates,
|
|
82
|
+
DRAG_THRESHOLD
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default UIEvents;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// __ ___ ___ ___ _ ___ _ ___ ___
|
|
2
|
+
// \ \ / /_\ | _ \_ _| /_\ | _ ) | | __/ __|
|
|
3
|
+
// \ V / _ \| /| | / _ \| _ \ |__| _|\__ \
|
|
4
|
+
// \_/_/ \_\_|_\___/_/ \_\___/____|___|___/
|
|
5
|
+
//
|
|
6
|
+
// =========================================================================================
|
|
7
|
+
// =========================================================================================
|
|
8
|
+
//
|
|
9
|
+
// Use this stylesheet to declare site-wide variables. If you are declaring a default
|
|
10
|
+
// property for a CSS value, use `_default.scss` instead. If you are declaring a
|
|
11
|
+
// color, use `_color.scss` instead. If you are declaring a font size, use
|
|
12
|
+
// `_font-sizes.scss` instead. If you are declaring a z-index, use `_z-index.scss`
|
|
13
|
+
// instead. Functions, mixins, and placeholders should be included in their
|
|
14
|
+
// respective stylesheets.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
$bouncy-transition: cubic-bezier(0.32, 1.44, 0.46, 0.99);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// ___ ___ _____ ___ ___
|
|
2
|
+
// / /\ ___ /__/\ / /::\ / /\ /__/|
|
|
3
|
+
// / /::| / /\ \ \:\ / /:/\:\ / /:/_ | |:|
|
|
4
|
+
// / /:/:| / /:/ \ \:\ / /:/ \:\ / /:/ /\ | |:|
|
|
5
|
+
// / /:/|:|__ /__/::\ _____\__\:\ /__/:/ \__\:| / /:/ /:/_ __|__|:|
|
|
6
|
+
// /__/:/ |:| /\\__\/\:\__ /__/::::::::\\ \:\ / /://__/:/ /:/ /\/__/::::\____
|
|
7
|
+
// \__\/ |:|/:/ \ \:\/\\ \:\~~\~~\/ \ \:\ /:/ \ \:\/:/ /:/ ~\~~\::::/
|
|
8
|
+
// | |:/:/ \__\::/ \ \:\ ~~~ \ \:\/:/ \ \::/ /:/ |~~|:|~~
|
|
9
|
+
// | |::/ /__/:/ \ \:\ \ \::/ \ \:\/:/ | |:|
|
|
10
|
+
// | |:/ \__\/ \ \:\ \__\/ \ \::/ | |:|
|
|
11
|
+
// |__|/ \__\/ \__\/ |__|/
|
|
12
|
+
//
|
|
13
|
+
//*
|
|
14
|
+
// @pattern Z-Index
|
|
15
|
+
// @tagline Stack it up!
|
|
16
|
+
// @group Helper
|
|
17
|
+
//
|
|
18
|
+
// `z-index` is managed in this centralized stylesheet to create a manageable
|
|
19
|
+
// and self-documenting system. The process to add z-indexes is as follows:
|
|
20
|
+
//
|
|
21
|
+
// 1. For each stacking context (a set of elements for which you would like
|
|
22
|
+
// to maintain the stacking order), create a new map with a descriptive
|
|
23
|
+
// variable name.
|
|
24
|
+
//
|
|
25
|
+
// 2. Add entries to the map for each element that you would like to control the
|
|
26
|
+
// stacking context of. The delta between elements should not matter, only
|
|
27
|
+
// the numeric order. Elements with higher numbers will stack on top of
|
|
28
|
+
// elements with lower z-indexes.
|
|
29
|
+
//
|
|
30
|
+
// 3. `@include z-index` in your stylesheet with the name of the component you are
|
|
31
|
+
// setting z-index for and the map name defined in step 1.
|
|
32
|
+
//
|
|
33
|
+
// 4. Profit.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
$Z_INDEXES: (
|
|
38
|
+
global: (
|
|
39
|
+
content: 10,
|
|
40
|
+
sidebar: 20
|
|
41
|
+
),
|
|
42
|
+
|
|
43
|
+
page: (
|
|
44
|
+
avatar: 10,
|
|
45
|
+
popover-resting: 20,
|
|
46
|
+
popover-deactivating: 30,
|
|
47
|
+
popover-active: 40
|
|
48
|
+
),
|
|
49
|
+
|
|
50
|
+
avatar: (
|
|
51
|
+
initials: 10,
|
|
52
|
+
image: 20
|
|
53
|
+
),
|
|
54
|
+
|
|
55
|
+
table: (
|
|
56
|
+
cell: 10,
|
|
57
|
+
cell-persistant: 20,
|
|
58
|
+
backdrop: 30
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
//*
|
|
65
|
+
// This mixin creates a z-index declaration based on the element and context
|
|
66
|
+
// passed in. The mixin will attempt to retrieve the `$context` as a key from
|
|
67
|
+
// the global `$Z-INDEXES` map, and will then try to retrieve the `$element`
|
|
68
|
+
// from that map. If this is successful, the z-index declaration is included.
|
|
69
|
+
//
|
|
70
|
+
// @param {String} $element - The element within the stacking context you are
|
|
71
|
+
// adding the rule for.
|
|
72
|
+
// @param {String} $context - The stacking context you want to search in for
|
|
73
|
+
// `$element`.
|
|
74
|
+
|
|
75
|
+
@mixin z-index($element, $context) {
|
|
76
|
+
$index: map-get(map-get($Z_INDEXES, $context), $element);
|
|
77
|
+
|
|
78
|
+
@if $index {
|
|
79
|
+
z-index: $index;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@function z-index-stacking-context($name, $stack-order) {
|
|
84
|
+
$new-stack-order: ( $name: $stack-order );
|
|
85
|
+
$Z_INDEXES: map-merge($Z_INDEXES, $new-stack-order);
|
|
86
|
+
|
|
87
|
+
@return true;
|
|
88
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
if(![].includes) {
|
|
2
|
+
Array.prototype.includes = function(searchElement /*, fromIndex*/ ) {
|
|
3
|
+
'use strict';
|
|
4
|
+
var O = Object(this);
|
|
5
|
+
var len = parseInt(O.length) || 0;
|
|
6
|
+
if (len === 0) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
var n = parseInt(arguments[1]) || 0;
|
|
10
|
+
var k;
|
|
11
|
+
if (n >= 0) {
|
|
12
|
+
k = n;
|
|
13
|
+
} else {
|
|
14
|
+
k = len + n;
|
|
15
|
+
if (k < 0) {k = 0;}
|
|
16
|
+
}
|
|
17
|
+
var currentElement;
|
|
18
|
+
while (k < len) {
|
|
19
|
+
currentElement = O[k];
|
|
20
|
+
if (searchElement === currentElement ||
|
|
21
|
+
(searchElement !== searchElement && currentElement !== currentElement)) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
k++;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
};
|
|
28
|
+
}
|