stalefish 7.2.0 → 7.3.0

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.
@@ -51,7 +51,12 @@ class Panel extends Component {
51
51
 
52
52
  let { chevronStyle = null, on = true, content, heading = '', collapsed = false, thinBorder = false, light = false, optionsMenu } = args
53
53
 
54
- return on ? html`<div class="${styles.panel}" style='box-sizing: border-box; position: relative; top: 0; left: 0; text-align: left; box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); border: solid ${thinBorder ? '3px' : '5px'} ${light ? '#DDD' : '#4371AD'}; background-color: #FBFBFB;'>
54
+ return on ? html`<div ondragover=${e => {
55
+ if (this.dragOverAction) {
56
+ e.preventDefault()
57
+ e.dataTransfer.dropEffect = 'move'
58
+ }
59
+ }} class="${styles.panel}" style='box-sizing: border-box; position: relative; top: 0; left: 0; text-align: left; box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); border: solid ${thinBorder ? '3px' : '5px'} ${light ? '#DDD' : '#4371AD'}; background-color: #FBFBFB;'>
55
60
  <div style="position: relative;" ondragleave="${e => this.dragLeaveAction && this.dragLeaveAction(e)}" ondragend="${e => this.dragEndAction && this.dragEndAction(e)}" ondragover="${e => this.dragOverAction && this.dragOverAction(e)}" ondragstart="${e => this.dragStartAction && this.dragStartAction(e)}" draggable="${this.draggable ? 'true' : ''}" >
56
61
  ${heading ? html`<div class="${styles.header}" onclick=${e => this.headerAction && this.headerAction(e)}>
57
62
  <h3 style="margin: 12px; color: ${light ? '#555' : '#22487e'}">${heading}</h3>
@@ -0,0 +1,47 @@
1
+ import { html, css } from 'halfcab'
2
+
3
+ const width = 375
4
+
5
+ // language=CSS
6
+ const styles = css`
7
+ .sideDrawer {
8
+ transition: left 0.2s ease, opacity 0.4s ease;
9
+ position: fixed;
10
+ top: 0;
11
+ left: 0;
12
+ z-index: 20000;
13
+ width: ${width}px;
14
+ height: 100vh;
15
+ background-color: black;
16
+ color: white;
17
+ }
18
+
19
+ .closeButton {
20
+ width: 20px;
21
+ height: 20px;
22
+ position: absolute;
23
+ right: 10px;
24
+ top: 10px;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .content {
29
+ position: absolute;
30
+ left: 0;
31
+ top: 30px;
32
+ }
33
+ `
34
+
35
+ export default ({ on, topPadding, closeIcon, closeAction, content }) => html`
36
+ <div class="${styles.sideDrawer}"
37
+ style="opacity: ${on ? '0.9' : '0'};left: ${on ? '0px' : `calc(-1 * (${width}px + 10px))`};${topPadding ? `padding-top: ${topPadding}` : ''}">
38
+ <div style="width: 100%; position: relative;">
39
+ <div class="${styles.closeButton}"
40
+ onclick=${e => closeAction && closeAction(e)}>${closeIcon}
41
+ </div>
42
+ <div class="${styles.content}">
43
+ ${content}
44
+ </div>
45
+ </div>
46
+ </div>
47
+ `
@@ -6,65 +6,65 @@ let cache = new LRU(300)
6
6
 
7
7
  // language=CSS
8
8
  let styles = css`
9
- .textfield {
10
- padding: 10px;
11
- border: solid 5px #c9c9c9;
12
- transition: border 0.3s;
13
- outline: none;
14
- width: 100%;
15
- font-size: 18px;
16
- border-radius: 0;
17
- box-shadow: none !important;
18
- font-weight: normal;
19
- box-sizing: border-box;
20
- font-family: inherit;
21
- line-height: 1.4em;
22
- -webkit-appearance: none;
23
- -moz-appearance: none;
24
- appearance: none;
25
- z-index: 20;
26
- position: relative;
27
- }
9
+ .textfield {
10
+ padding: 10px;
11
+ border: solid 5px #c9c9c9;
12
+ transition: border 0.3s;
13
+ outline: none;
14
+ width: 100%;
15
+ font-size: 18px;
16
+ border-radius: 0;
17
+ box-shadow: none !important;
18
+ font-weight: normal;
19
+ box-sizing: border-box;
20
+ font-family: inherit;
21
+ line-height: 1.4em;
22
+ -webkit-appearance: none;
23
+ -moz-appearance: none;
24
+ appearance: none;
25
+ z-index: 20;
26
+ position: relative;
27
+ }
28
28
 
29
- .label {
30
- transition: opacity 0.75s;
31
- border-top-right-radius: 5px;
32
- border-top-left-radius: 5px;
33
- user-select: none;
34
- position: absolute;
35
- top: -55px;
36
- z-index: 10;
37
- }
29
+ .label {
30
+ transition: opacity 0.75s;
31
+ border-top-right-radius: 5px;
32
+ border-top-left-radius: 5px;
33
+ user-select: none;
34
+ position: absolute;
35
+ top: -55px;
36
+ z-index: 10;
37
+ }
38
38
 
39
- .textfield.highlight {
40
- border-color: #ff4081;
41
- }
39
+ .textfield.highlight {
40
+ border-color: #ff4081;
41
+ }
42
42
 
43
- .textfield:focus {
44
- border: solid 5px #969696;
45
- }
43
+ .textfield:focus {
44
+ border: solid 5px #969696;
45
+ }
46
46
 
47
- .textfield::placeholder {
48
- color: #999;
49
- }
47
+ .textfield::placeholder {
48
+ color: #999;
49
+ }
50
50
 
51
- .textfield.touched:invalid:not(:focus) {
52
- border-color: red;
53
- }
51
+ .textfield.touched:invalid:not(:focus) {
52
+ border-color: red;
53
+ }
54
54
 
55
- .valueContext {
56
- position: absolute;
57
- color: #AAA;
58
- font-size: 1.1em;
59
- line-height: 1.2em;
60
- font-weight: normal;
61
- box-sizing: border-box;
62
- top: -12px;
63
- right: 7px;
64
- background-color: #EEE;
65
- padding: 10px;
66
- z-index: 30;
67
- }
55
+ .valueContext {
56
+ position: absolute;
57
+ color: #AAA;
58
+ font-size: 1.1em;
59
+ line-height: 1.2em;
60
+ font-weight: normal;
61
+ box-sizing: border-box;
62
+ top: -12px;
63
+ right: 7px;
64
+ background-color: #EEE;
65
+ padding: 10px;
66
+ z-index: 30;
67
+ }
68
68
  `
69
69
 
70
70
  function change ({ e, holdingPen, property, label }) {
@@ -114,14 +114,14 @@ class Textfield extends Component {
114
114
  }
115
115
 
116
116
  return html`
117
- <div ${wrapperStyle ? { 'class': wrapperStyle } : ''} style="display: inline-block; width: calc(100% - 10px); margin: 40px 5px 5px 5px;">
118
- <label style="width: 100%; text-align: left; position: relative; padding: 0;">
119
- ${valueContext ? html`<div class="${styles.valueContext}">${valueContext}</div>` : ''}
120
- ${label ? html`<span class="${styles.label}" style="opacity: ${holdingPen[property] === 0 || holdingPen[property] || (permanentTopPlaceholder || permanentTopLabel) ? 1 : 0}; font-size: 16px; font-weight: normal; color: #999; margin-left: 5px; padding: 9px; background-color: rgba(255,255,255,0.8); ">${label}${required ? ' *' : ''}</span>` : ''}
121
- ${input}
122
- </label>
123
- </div>
124
- `
117
+ <div ${wrapperStyle ? { 'class': wrapperStyle } : ''} style="display: inline-block; width: calc(100% - 10px); margin: ${label ? '40' : '5'}px 5px 5px 5px;">
118
+ <label style="width: 100%; text-align: left; position: relative; padding: 0;">
119
+ ${valueContext ? html`<div class="${styles.valueContext}">${valueContext}</div>` : ''}
120
+ ${label ? html`<span class="${styles.label}" style="opacity: ${holdingPen[property] === 0 || holdingPen[property] || (permanentTopPlaceholder || permanentTopLabel) ? 1 : 0}; font-size: 16px; font-weight: normal; color: #999; margin-left: 5px; padding: 9px; background-color: rgba(255,255,255,0.8); ">${label}${required ? ' *' : ''}</span>` : ''}
121
+ ${input}
122
+ </label>
123
+ </div>
124
+ `
125
125
  }
126
126
 
127
127
  update (args) {
package/index.mjs CHANGED
@@ -19,6 +19,7 @@ import down from './components/icons/down.mjs'
19
19
  import calendarIcon from './components/icons/calendarIcon.mjs'
20
20
  import timeIcon from './components/icons/timeIcon.mjs'
21
21
  import solidDown from './components/icons/solidDown.mjs'
22
+ import sideDrawer from './components/sideDrawer.mjs'
22
23
 
23
24
  export {
24
25
  button,
@@ -41,5 +42,6 @@ export {
41
42
  calendarIcon,
42
43
  timeIcon,
43
44
  solidDown,
44
- uploader
45
+ uploader,
46
+ sideDrawer
45
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stalefish",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Simple function based component library for halfcab tagged template literals",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",