@indico-data/design-system 1.0.28 → 1.0.30

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/lib/index.js CHANGED
@@ -60,12 +60,60 @@ const padding = {
60
60
  md: '20px',
61
61
  };
62
62
 
63
+ const spacings = {
64
+ xs: '8px',
65
+ sm: '12px',
66
+ md: '24px',
67
+ };
68
+
63
69
  const margin = {
64
70
  // todo -- get with mike L for other padding values as they become needed. Ideally we should create a formula.
65
71
  sm: '15px',
66
72
  md: '20px',
67
73
  };
68
74
 
75
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor
76
+
77
+ const decimalAdjust = (type, value, exp) => {
78
+ // If the exp is undefined or zero...
79
+ if (typeof exp === 'undefined' || +exp === 0) {
80
+ return Math[type](value);
81
+ }
82
+ value = +value;
83
+ exp = +exp;
84
+ // If the value is not a number or the exp is not an integer...
85
+ if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
86
+ return NaN;
87
+ }
88
+ // Shift
89
+ value = value.toString().split('e');
90
+ value = Math[type](+(value[0] + 'e' + (value[1] ? +value[1] - exp : -exp)));
91
+ // Shift back
92
+ value = value.toString().split('e');
93
+ return +(value[0] + 'e' + (value[1] ? +value[1] + exp : exp));
94
+ };
95
+
96
+ const round10 = (value, exp) => {
97
+ return decimalAdjust('round', value, exp);
98
+ };
99
+
100
+ const clamp = (value, min, max) => {
101
+ value = value < min ? min : value;
102
+ value = value > max ? max : value;
103
+ return value;
104
+ };
105
+
106
+ const numberWithCommas$1 = (x) => {
107
+ return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
108
+ };
109
+
110
+ const MATH = {
111
+ decimalAdjust,
112
+ round10,
113
+ clamp,
114
+ numberWithCommas: numberWithCommas$1,
115
+ };
116
+
69
117
  const allColors = {
70
118
  akaroa: '#cbc98f',
71
119
  amber: '#f4c401',
@@ -7329,7 +7377,6 @@ const Layout = styled.createGlobalStyle `
7329
7377
 
7330
7378
  body {
7331
7379
  margin: 0;
7332
- background-color: var(${allColors.backgroundColor});
7333
7380
  }
7334
7381
  `;
7335
7382
 
@@ -7530,40 +7577,6 @@ const GlobalStyles = () => (React.createElement(React.Fragment, null,
7530
7577
  React.createElement(Typography, null),
7531
7578
  React.createElement(MarginPadding, null)));
7532
7579
 
7533
- /******************************************************************************
7534
- Copyright (c) Microsoft Corporation.
7535
-
7536
- Permission to use, copy, modify, and/or distribute this software for any
7537
- purpose with or without fee is hereby granted.
7538
-
7539
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
7540
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
7541
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
7542
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
7543
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
7544
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
7545
- PERFORMANCE OF THIS SOFTWARE.
7546
- ***************************************************************************** */
7547
- /* global Reflect, Promise, SuppressedError, Symbol */
7548
-
7549
-
7550
- function __rest(s, e) {
7551
- var t = {};
7552
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7553
- t[p] = s[p];
7554
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7555
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7556
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
7557
- t[p[i]] = s[p[i]];
7558
- }
7559
- return t;
7560
- }
7561
-
7562
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
7563
- var e = new Error(message);
7564
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
7565
- };
7566
-
7567
7580
  var faFileLines = {
7568
7581
  prefix: 'far',
7569
7582
  iconName: 'file-lines',
@@ -8299,6 +8312,40 @@ const indicons = {
8299
8312
  React.createElement("path", { d: "M60.9,38.3V43c0,1.3-1.1,2.3-2.3,2.3H22.7c-1.3,0-2.3-1.1-2.3-2.3v-4.7\n\tc0-1.3,1.1-2.3,2.3-2.3h35.9C59.9,35.9,60.9,37,60.9,38.3z M99.3,94.9l-4.4,4.4c-0.9,0.9-2.4,0.9-3.3,0L67.9,75.6\n\tc-0.4-0.4-0.7-1-0.7-1.7v-2.6c-7.1,6.2-16.4,9.9-26.6,9.9C18.2,81.2,0,63.1,0,40.6S18.2,0,40.6,0s40.6,18.2,40.6,40.6\n\tc0,10.2-3.7,19.4-9.9,26.6h2.6c0.6,0,1.2,0.3,1.7,0.7l23.7,23.7C100.2,92.5,100.2,94,99.3,94.9L99.3,94.9z M71.9,40.6\n\tc0-17.3-14-31.2-31.2-31.2S9.4,23.4,9.4,40.6s14,31.2,31.2,31.2S71.9,57.9,71.9,40.6z" }))),
8300
8313
  };
8301
8314
 
8315
+ /******************************************************************************
8316
+ Copyright (c) Microsoft Corporation.
8317
+
8318
+ Permission to use, copy, modify, and/or distribute this software for any
8319
+ purpose with or without fee is hereby granted.
8320
+
8321
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8322
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8323
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
8324
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8325
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
8326
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8327
+ PERFORMANCE OF THIS SOFTWARE.
8328
+ ***************************************************************************** */
8329
+ /* global Reflect, Promise, SuppressedError, Symbol */
8330
+
8331
+
8332
+ function __rest(s, e) {
8333
+ var t = {};
8334
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
8335
+ t[p] = s[p];
8336
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
8337
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8338
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8339
+ t[p[i]] = s[p[i]];
8340
+ }
8341
+ return t;
8342
+ }
8343
+
8344
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
8345
+ var e = new Error(message);
8346
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
8347
+ };
8348
+
8302
8349
  // TODO: This component's migration was fast-tracked for Insights. Assess for potential refactor and documentation.
8303
8350
  const allIcons = Object.assign(Object.assign({}, faIcons), indicons);
8304
8351
  /**
@@ -9434,7 +9481,71 @@ function BarSpinner(props) {
9434
9481
  React.createElement("span", null)));
9435
9482
  }
9436
9483
 
9437
- var MESSAGES = ['Charging the flux capacitor', 'Spinning up the hamster wheel', 'Flushing the pipes', 'Counting all the beans', 'Take a deep breath and enjoy this beautiful moment', 'Counting digits in pi (almost done)', 'Folding time and space', 'Oiling the gears', 'Peeling the data fruits', 'Activating the oscillation overthruster', 'Gleaming the cube', 'Reticulating splines', 'Playing a quick game of squash', 'Making the sausage', 'Building the matrix', 'Drawing fractals', 'Testing memory (what did you have for breakfast?)', 'Priming data pumps', 'Whacking datamoles', 'Finding Nemo', 'Running spin cycle', 'Chasing down a dream', 'Twiddling the knobs', 'Assembling lines', 'Making the donuts', 'Gathering magic', 'Rolling stones', 'Busting all the moves', 'Augmenting reality', 'Leveling up', 'Obviating frequencies', 'Declaring variables', 'Boosting thrusters', 'Blazing the saddles', 'Flipping some bits', 'Unclogging the internet', 'Turning it off and back on again', 'Entering the ThunderDome', 'Rolling logs', 'Dangling particles', 'Catching moonbeams', 'Digging for treasure', 'Reconbulating the conbulator', 'Machine learning', 'Magicing', 'Tuning the forks', 'Fiddling widgets', 'Feeding the data monkeys', 'Regularizing expressions', 'Ramping up the synergy', 'Inflating point flotations', 'Entering orbit around alpha centuri', 'Squeezing data tubes', 'Making a list and checking it twice', 'Unkinking the data tubes', 'Turning on the data hose', 'Preparing for liftoff', 'Replacing the hamsters', 'Changing the batteries', 'Waking up our engineers', 'Contemplating the meaning of life', 'Downloading fresh dog memes', 'Springing the chickens'];
9484
+ const MESSAGES = [
9485
+ 'Charging the flux capacitor',
9486
+ 'Spinning up the hamster wheel',
9487
+ 'Flushing the pipes',
9488
+ 'Counting all the beans',
9489
+ 'Take a deep breath and enjoy this beautiful moment',
9490
+ 'Counting digits in pi (almost done)',
9491
+ 'Folding time and space',
9492
+ 'Oiling the gears',
9493
+ 'Peeling the data fruits',
9494
+ 'Activating the oscillation overthruster',
9495
+ 'Gleaming the cube',
9496
+ 'Reticulating splines',
9497
+ 'Playing a quick game of squash',
9498
+ 'Making the sausage',
9499
+ 'Building the matrix',
9500
+ 'Drawing fractals',
9501
+ 'Testing memory (what did you have for breakfast?)',
9502
+ 'Priming data pumps',
9503
+ 'Whacking datamoles',
9504
+ 'Finding Nemo',
9505
+ 'Running spin cycle',
9506
+ 'Chasing down a dream',
9507
+ 'Twiddling the knobs',
9508
+ 'Assembling lines',
9509
+ 'Making the donuts',
9510
+ 'Gathering magic',
9511
+ 'Rolling stones',
9512
+ 'Busting all the moves',
9513
+ 'Augmenting reality',
9514
+ 'Leveling up',
9515
+ 'Obviating frequencies',
9516
+ 'Declaring variables',
9517
+ 'Boosting thrusters',
9518
+ 'Blazing the saddles',
9519
+ 'Flipping some bits',
9520
+ 'Unclogging the internet',
9521
+ 'Turning it off and back on again',
9522
+ 'Entering the ThunderDome',
9523
+ 'Rolling logs',
9524
+ 'Dangling particles',
9525
+ 'Catching moonbeams',
9526
+ 'Digging for treasure',
9527
+ 'Reconbulating the conbulator',
9528
+ 'Machine learning',
9529
+ 'Magicing',
9530
+ 'Tuning the forks',
9531
+ 'Fiddling widgets',
9532
+ 'Feeding the data monkeys',
9533
+ 'Regularizing expressions',
9534
+ 'Ramping up the synergy',
9535
+ 'Inflating point flotations',
9536
+ 'Entering orbit around alpha centuri',
9537
+ 'Squeezing data tubes',
9538
+ 'Making a list and checking it twice',
9539
+ 'Unkinking the data tubes',
9540
+ 'Turning on the data hose',
9541
+ 'Preparing for liftoff',
9542
+ 'Replacing the hamsters',
9543
+ 'Changing the batteries',
9544
+ 'Waking up our engineers',
9545
+ 'Contemplating the meaning of life',
9546
+ 'Downloading fresh dog memes',
9547
+ 'Springing the chickens',
9548
+ ];
9438
9549
 
9439
9550
  const RandomLoadingMessage = () => {
9440
9551
  const [randomMessage, changeRandomMessage] = React.useState(MESSAGES[Math.floor(Math.random() * MESSAGES.length)]);
@@ -12596,10 +12707,13 @@ const ListTable = (props) => {
12596
12707
  list))));
12597
12708
  };
12598
12709
 
12710
+ exports.ANIMATION = animation;
12599
12711
  exports.Accordion = Accordion;
12712
+ exports.BREAKPOINT = breakpoints;
12600
12713
  exports.BarSpinner = BarSpinner;
12601
12714
  exports.BorderSelect = BorderSelect;
12602
12715
  exports.Button = Button;
12716
+ exports.COLORS = allColors;
12603
12717
  exports.CirclePulse = CirclePulse;
12604
12718
  exports.CircleSpinner = CircleSpinner;
12605
12719
  exports.EditableInput = EditableInput;
@@ -12608,11 +12722,16 @@ exports.Icon = Icon;
12608
12722
  exports.IconButton = IconButton;
12609
12723
  exports.ListTable = ListTable;
12610
12724
  exports.LoadingList = LoadingList;
12725
+ exports.MARGINS = margin;
12726
+ exports.MATH = MATH;
12727
+ exports.MEDIA_QUERIES = mediaQueries;
12611
12728
  exports.MultiCombobox = MultiCombobox;
12612
12729
  exports.NumberInput = NumberInput;
12730
+ exports.PADDINGS = padding;
12613
12731
  exports.Pagination = Pagination;
12614
12732
  exports.PercentageRing = PercentageRing;
12615
12733
  exports.RandomLoadingMessage = RandomLoadingMessage;
12734
+ exports.SPACING = spacings;
12616
12735
  exports.SearchInput = SearchInput;
12617
12736
  exports.Section = Section;
12618
12737
  exports.SectionBlock = SectionBlock;
@@ -12622,5 +12741,8 @@ exports.SectionTable = SectionTable;
12622
12741
  exports.Select = Select;
12623
12742
  exports.Shrug = Shrug;
12624
12743
  exports.SingleCombobox = SingleCombobox;
12744
+ exports.TYPOGRAPHY = typography;
12625
12745
  exports.TextInput = TextInput;
12746
+ exports.faIcons = faIcons;
12747
+ exports.indicons = indicons;
12626
12748
  //# sourceMappingURL=index.js.map