@symbo.ls/atoms 2.11.428 → 2.11.430

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 (3) hide show
  1. package/Block.js +86 -0
  2. package/Overflow.js +10 -3
  3. package/package.json +2 -2
package/Block.js CHANGED
@@ -304,3 +304,89 @@ export const Gutter = {
304
304
  }
305
305
  }
306
306
  }
307
+
308
+ // alt approach
309
+ // blockProps: (el, s, ctx) => {
310
+ // const { props, deps } = el
311
+ // const styles = {}
312
+
313
+ // // Utility to conditionally add a style
314
+ // const addStyle = (key, value) => {
315
+ // if (deps.isObject(value)) deps.merge(styles, value)
316
+ // else if (value) styles[key] = value
317
+ // }
318
+
319
+ // // Box sizing
320
+ // addStyle('boxSizing', !deps.isUndefined(props.boxSizing) ? props.boxSizing : 'border-box')
321
+
322
+ // // Display
323
+ // addStyle('display', !deps.isUndefined(props.display) ? props.display : undefined)
324
+
325
+ // // Show/Hide
326
+ // if (ctx.utils.exec(el.props.show, el, s) === false) {
327
+ // addStyle('display', 'none !important')
328
+ // }
329
+ // if (ctx.utils.exec(el.props.hide, el, s)) {
330
+ // addStyle('display', 'none !important')
331
+ // }
332
+
333
+ // // Size transformations
334
+ // const sizeKeys = ['height', 'width', 'inlineSize', 'blockSize', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'minBlockSize', 'maxBlockSize', 'minInlineSize', 'maxInlineSize']
335
+ // sizeKeys.forEach(key => addStyle(key, deps.transformSizeRatio(key, props)))
336
+
337
+ // // Box size
338
+ // if (deps.isString(props.boxSize)) {
339
+ // const [height, width] = props.boxSize.split(' ')
340
+ // Object.assign(styles, deps.transformSize('height', height))
341
+ // Object.assign(styles, deps.transformSize('width', width || height))
342
+ // }
343
+
344
+ // // Size ranges
345
+ // const rangeKeys = ['widthRange', 'heightRange', 'minSize', 'maxSize']
346
+ // rangeKeys.forEach(key => {
347
+ // if (deps.isString(props[key])) {
348
+ // const [min, max] = props[key].split(' ')
349
+ // addStyle(`min${key.charAt(0).toUpperCase() + key.slice(1)}`, deps.transformSize('min' + key, min))
350
+ // addStyle(`max${key.charAt(0).toUpperCase() + key.slice(1)}`, deps.transformSize('max' + key, max || min))
351
+ // }
352
+ // })
353
+
354
+ // // Direction, objectFit, aspectRatio, etc.
355
+ // const simpleProps = ['direction', 'objectFit', 'aspectRatio', 'float', 'flex', 'flexDirection', 'alignItems', 'alignContent', 'justifyContent', 'justifyItems', 'alignSelf', 'order', 'resize', 'verticalAlign', 'columns', 'columnRule', 'columnWidth', 'columnSpan', 'columnFill', 'columnCount']
356
+ // simpleProps.forEach(key => addStyle(key, !deps.isUndefined(props[key]) ? props[key] : undefined))
357
+
358
+ // // Flex and grid specific properties
359
+ // if (props.flexWrap) {
360
+ // addStyle('flexWrap', props.flexWrap)
361
+ // }
362
+ // if (deps.isString(props.flexFlow)) {
363
+ // let [direction, wrap] = props.flexFlow.split(' ')
364
+ // direction = direction.startsWith('x') || direction === 'row' ? 'row' : 'column'
365
+ // addStyle('flexFlow', direction + ' ' + (wrap || ''))
366
+ // }
367
+
368
+ // if (deps.isString(props.flexAlign)) {
369
+ // const [alignItems, justifyContent] = props.flexAlign.split(' ')
370
+ // addStyle('alignItems', alignItems)
371
+ // addStyle('justifyContent', justifyContent)
372
+ // }
373
+
374
+ // // Gap properties
375
+ // if (!deps.isUndefined(props.gap)) {
376
+ // addStyle('gap', transfromGap(props.gap))
377
+ // }
378
+ // if (props.columnGap) {
379
+ // addStyle('columnGap', deps.getSpacingBasedOnRatio(props, 'columnGap'))
380
+ // }
381
+ // if (props.rowGap) {
382
+ // addStyle('rowGap', deps.getSpacingBasedOnRatio(props, 'rowGap'))
383
+ // }
384
+
385
+ // // Grid properties
386
+ // const gridProps = ['gridColumn', 'gridColumnStart', 'gridRow', 'gridRowStart']
387
+ // gridProps.forEach(key => addStyle(key, !deps.isUndefined(props[key]) ? props[key] : undefined))
388
+
389
+ // console.log(styles)
390
+
391
+ // return styles
392
+ // }
package/Overflow.js CHANGED
@@ -2,11 +2,18 @@
2
2
 
3
3
  export const Overflow = {
4
4
  class: {
5
- overflow: ({ props }) => props.overflow && ({
5
+ overflow: ({ props, deps }) => !deps.isUndefined(props.overflow) && ({
6
6
  overflow: props.overflow,
7
7
  scrollBehavior: 'smooth'
8
8
  }),
9
- overflowX: ({ props }) => props.overflowX && ({ overflowX: props.overflowX }),
10
- overflowY: ({ props }) => props.overflowY && ({ overflowY: props.overflowY })
9
+ overflowX: ({ props, deps }) => !deps.isUndefined(props.overflowX) && ({
10
+ overflowX: props.overflowX
11
+ }),
12
+ overflowY: ({ props, deps }) => !deps.isUndefined(props.overflowY) && ({
13
+ overflowY: props.overflowY
14
+ }),
15
+ overscrollBehavior: ({ props, deps }) => !deps.isUndefined(props.overscrollBehavior) && ({
16
+ overscrollBehavior: props.overscrollBehavior
17
+ })
11
18
  }
12
19
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@symbo.ls/atoms",
3
- "version": "2.11.428",
3
+ "version": "2.11.430",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
- "gitHead": "8f69088ccb7bd0b239a5b637595d34fbee5f76b1",
6
+ "gitHead": "340f3f6f7aa8ebd812340008730e4490a607be19",
7
7
  "dependencies": {
8
8
  "@domql/state": "latest",
9
9
  "@domql/utils": "latest",