@hanzo/ui 0.5.12 → 0.5.13

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.
@@ -53,8 +53,10 @@ const ScreenfulComponent: React.FC<{
53
53
  (agent && agent !== 'desktop') ? 'pt-15 sm:pt-17 pb-0 px-3 sm:px-8' : ''
54
54
  ]
55
55
 
56
+ const spreadId = (b.anchorId) ? {id: b.anchorId} : {}
57
+
56
58
  return (
57
- <section className={cn('h-[100vh]', (snapTile ? 'snap-start snap-always' : ''), className)}>
59
+ <section {...spreadId} className={cn('h-[100vh]', (snapTile ? 'snap-start snap-always' : ''), className)}>
58
60
  <ApplyTypography className={tileHeight + 'w-full flex flex-row justify-center self-stretch'} >
59
61
  <Poster banner={b.banner}>
60
62
  {hasBannerVideo() && (
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
- import { ldMerge } from '../../util'
3
+ import { ldMerge, cn } from '../../util'
4
4
 
5
5
  import type { Breakpoint } from '../../types'
6
6
  import { SPACE_DEFAULTS , type TWSpaceUnit, type HeadingLevel} from '../def/space-block'
@@ -33,7 +33,7 @@ const SpaceBlockComponent: React.FC<BlockComponentProps> = ({
33
33
  // This code path should handle a undefined or empty sizes field.
34
34
  if (!b.level) {
35
35
  if (typeof b.sizes == 'number') {
36
- return <div className={`invisible w-[1px] h-${b.sizes}` } />
36
+ return <div className={cn(`invisible w-[1px] h-${b.sizes}`, className) } />
37
37
  }
38
38
  const _sizes: {
39
39
  [key in (Breakpoint)]?: TWSpaceUnit
@@ -50,14 +50,14 @@ const SpaceBlockComponent: React.FC<BlockComponentProps> = ({
50
50
  console.log(clx)
51
51
  }
52
52
 
53
- return <div className={'invisible w-[1px] ' + clx} />
53
+ return <div className={cn('invisible w-[1px] ' + clx, className)} />
54
54
  }
55
55
 
56
56
  const Tag = TAGS[b.level]
57
57
  const heightClx = (b.level === (0 satisfies HeadingLevel as HeadingLevel)) ? 'h-4' : ''
58
58
 
59
59
  return (
60
- <ApplyTypography>
60
+ <ApplyTypography className={className}>
61
61
  <Tag className={'invisible m-0 ' + heightClx} >&nbsp;</Tag>
62
62
  </ApplyTypography>
63
63
  )
@@ -44,6 +44,9 @@ interface ScreenfulBlock extends Block {
44
44
 
45
45
  /** optional footer element below the grid */
46
46
  footer?: ReactNode
47
+
48
+ /** optional id for linking to this slide / screenful */
49
+ anchorId?: string
47
50
  }
48
51
 
49
52
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -36,7 +36,7 @@
36
36
  "hanzo"
37
37
  ],
38
38
  "scripts": {
39
- "latest": "npm show @hanzo/ui version",
39
+ "lat": "npm show @hanzo/ui version",
40
40
  "pub": "npm publish",
41
41
  "build": "tsc",
42
42
  "tc": "tsc",
@@ -17,7 +17,7 @@ export const fontFamily = (ignoreTheme: any): {
17
17
  }
18
18
 
19
19
  export const fontSize = {
20
- xxs: ['0.7rem', { lineHeight: '0.9rem' }], // very fine print
20
+ xxs: ['0.6.5rem', { lineHeight: '0.8rem' }], // very fine print
21
21
  xs: ['0.8rem', { lineHeight: '1rem' }], // fine print
22
22
  sm: ['0.9rem', { lineHeight: '1.2rem' }], // 'standard' some news article cards (set manually when using typography-sm)
23
23
  base: ['1rem', { lineHeight: 1.4 }],
@@ -1,4 +1,11 @@
1
+ const percentages = {}
2
+ for (let i = 0; i <= 100; i++) {
3
+ percentages[`pr-${i}`] = `${i}%`
4
+ }
5
+
6
+
1
7
  export default {
8
+ ...percentages,
2
9
  px: '1px',
3
10
  0: '0px',
4
11
  0.5: '0.125rem',
@@ -55,3 +62,4 @@ export default {
55
62
  80: '20rem',
56
63
  96: '24rem',
57
64
  }
65
+
package/types/site-def.ts CHANGED
@@ -26,6 +26,9 @@ interface SiteDef {
26
26
  /** default (undefined or absent): @ui/sideDef/footer/legal are rendered */
27
27
  /** [] renders nothing above the copyright */
28
28
  aboveCopyright?: LinkDef[]
29
+
30
+ /** any site-specific stuff we'd like access to (link urls, etc) */
31
+ ext?: any
29
32
  }
30
33
 
31
34
  export { type SiteDef as default }
package/util/index.ts CHANGED
@@ -74,3 +74,8 @@ export const ldMerge = (
74
74
  result: any,
75
75
  ...sources: any[]
76
76
  ): any => (_merge(result, ...sources))
77
+
78
+ export const capitalize = (str: string): string => (
79
+ str.charAt(0).toUpperCase() + str.slice(1)
80
+ )
81
+