@san-siva/blogkit 1.1.32 → 1.1.34

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CheckList.d.ts","sourceRoot":"","sources":["../../../src/components/CheckList.tsx"],"names":[],"mappings":"AAGA,OAAwB,EAAE,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAI1F,UAAU,mBAAmB;IAC5B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,SAAS,GAAI,wCAIhB,mBAAmB,4CAUrB,CAAC;AAEF,OAAO,EAAE,KAAK,aAAa,EAAE,CAAC;AAC9B,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"CheckList.d.ts","sourceRoot":"","sources":["../../../src/components/CheckList.tsx"],"names":[],"mappings":"AAAA,OAAwB,EACvB,KAAK,aAAa,EAClB,MAAM,qCAAqC,CAAC;AAE7C,UAAU,mBAAmB;IAC5B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,SAAS,GAAI,wCAIhB,mBAAmB,4CAQrB,CAAC;AAEF,OAAO,EAAE,KAAK,aAAa,EAAE,CAAC;AAC9B,eAAe,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@san-siva/blogkit",
3
- "version": "1.1.32",
3
+ "version": "1.1.34",
4
4
  "description": "A reusable blog component library for React/Next.js applications with code highlighting, diagrams, and rich content features",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -41,7 +41,7 @@
41
41
  "author": "Santhosh Siva",
42
42
  "license": "MIT",
43
43
  "dependencies": {
44
- "@san-siva/stylekit": "^1.0.12",
44
+ "@san-siva/stylekit": "^1.0.13",
45
45
  "schema-dts": "^1.1.5"
46
46
  },
47
47
  "peerDependencies": {
@@ -1,9 +1,6 @@
1
- 'use client';
2
-
3
- import { lazy, Suspense } from 'react';
4
- import CheckListStatic, { type CheckListItem } from '../staticComponents/CheckListStatic';
5
-
6
- const CheckListDynamic = lazy(() => import('../dynamicComponents/CheckListDynamic'));
1
+ import CheckListStatic, {
2
+ type CheckListItem,
3
+ } from '../staticComponents/CheckListStatic';
7
4
 
8
5
  interface CheckListProperties {
9
6
  items: CheckListItem[];
@@ -17,13 +14,11 @@ const CheckList = ({
17
14
  hasMarginDown = false,
18
15
  }: CheckListProperties) => {
19
16
  return (
20
- <Suspense
21
- fallback={
22
- <CheckListStatic items={items} hasMarginUp={hasMarginUp} hasMarginDown={hasMarginDown} />
23
- }
24
- >
25
- <CheckListDynamic items={items} hasMarginUp={hasMarginUp} hasMarginDown={hasMarginDown} />
26
- </Suspense>
17
+ <CheckListStatic
18
+ items={items}
19
+ hasMarginUp={hasMarginUp}
20
+ hasMarginDown={hasMarginDown}
21
+ />
27
22
  );
28
23
  };
29
24
 
@@ -8,7 +8,7 @@
8
8
  &__item {
9
9
  display: flex;
10
10
  flex-direction: row;
11
- align-items: center;
11
+ align-items: flex-start;
12
12
  justify-content: flex-start;
13
13
 
14
14
  &__input {
@@ -17,6 +17,7 @@
17
17
  border: 1px solid stylekit.$color--grey-medium;
18
18
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
19
19
  margin-right: stylekit.space(1);
20
+ margin-top: stylekit.rem(6);
20
21
  flex-shrink: 0;
21
22
 
22
23
  &--checked {
@@ -30,7 +31,6 @@
30
31
  }
31
32
 
32
33
  > p {
33
- font-size: stylekit.$font-size--small;
34
34
  margin: 0;
35
35
  }
36
36
  }
@@ -83,7 +83,6 @@ $code-block-background-color: #282a36;
83
83
  &__title {
84
84
  font-size: stylekit.$font-size--small;
85
85
  color: stylekit.$color--code;
86
- text-transform: capitalize;
87
86
  }
88
87
 
89
88
  &__copy {
@@ -119,6 +118,6 @@ $code-block-background-color: #282a36;
119
118
 
120
119
  .code-block--static code {
121
120
  color: stylekit.$color--base !important;
122
- font-family: stylekit.$font-family--code !important;
123
- font-size: stylekit.$font-size--small !important;
121
+ font-family: stylekit.$font-family--code !important;
122
+ font-size: stylekit.$font-size--small !important;
124
123
  }
@@ -1,66 +0,0 @@
1
- 'use client';
2
-
3
- import { useEffect, useRef, useState } from 'react';
4
-
5
- import type { CheckListItem } from '../staticComponents/CheckListStatic';
6
- import styles from '../styles/CheckList.module.scss';
7
-
8
- interface Properties {
9
- items: CheckListItem[];
10
- hasMarginUp?: boolean;
11
- hasMarginDown?: boolean;
12
- }
13
-
14
- const CHECKBOX_SIZE = 12;
15
- const P_TAG_FONT_SIZE = 16;
16
-
17
- const CheckListDynamic = ({
18
- items,
19
- hasMarginUp = false,
20
- hasMarginDown = false,
21
- }: Properties) => {
22
- const [checkboxMarginTop, setCheckboxMarginTop] = useState(0);
23
- const measureRef = useRef<HTMLDivElement>(null);
24
-
25
- useEffect(() => {
26
- if (!measureRef.current) return;
27
- const p = measureRef.current.querySelector('p');
28
- if (!p) return;
29
- const rawLineHeight = getComputedStyle(p).lineHeight;
30
- const lineHeight =
31
- rawLineHeight === 'normal'
32
- ? P_TAG_FONT_SIZE * 1.2
33
- : parseFloat(rawLineHeight);
34
- if (!isNaN(lineHeight)) {
35
- setCheckboxMarginTop(Math.max(0, (lineHeight - CHECKBOX_SIZE) / 2));
36
- }
37
- }, []);
38
-
39
- return (
40
- <div
41
- className={`${styles['check-list']} ${hasMarginUp ? styles['margin-top--1'] : ''} ${
42
- hasMarginDown ? styles['margin-bottom--2'] : ''
43
- }`}
44
- >
45
- {items.map((item, index) => (
46
- <div
47
- key={item.id}
48
- className={styles['check-list__item']}
49
- style={{ alignItems: 'flex-start' }}
50
- data-id={item.id}
51
- ref={index === 0 ? measureRef : undefined}
52
- >
53
- <div
54
- className={`${styles['check-list__item__input']} ${
55
- item.isChecked ? styles['check-list__item__input--checked'] : ''
56
- }`}
57
- style={{ marginTop: `${checkboxMarginTop}px` }}
58
- />
59
- {item.children}
60
- </div>
61
- ))}
62
- </div>
63
- );
64
- };
65
-
66
- export default CheckListDynamic;