@sb1/ffe-datepicker

14.0.28 • Public • Published

@sb1/ffe-datepicker

This package contains styles for the ffe-datepicker.

Install

npm install --save @sb1/ffe-datepicker

Usage

Full documentation on datepicker usage is available at https://design.sparebank1.no/komponenter/skjemaelementer/#datepicker.

The styles for this package can be used in 3 different ways depending on what you want. For All styles or Only date input you will need the @sb1/ffe-form package in your project.

All styles

You need styles for both the dateinput field and the calendar.

@import 'node_modules/@sb1/ffe-datepicker/less/datepicker.less';
@import 'node_modules/@sb1/ffe-form/less/form.less';

Importing compiled CSS

If your project does not use Less, you can import the compiled styling:

@import '~@sb1/ffe-datepicker/css/datepicker.css';

Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)

<div class="ffe-datepicker">
    <!-- see dateinput section below -->
    <!-- see calendar section below -->
</div>

Only date input styles

@import 'node_modules/@sb1/ffe-datepicker/less/dateinput.less';
@import 'node_modules/@sb1/ffe-form/less/form.less';

Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)

<div class="ffe-dateinput">
    <input class="ffe-dateinput__field ffe-input-field" type="text" />
    <svg class="ffe-dateinput__icon">
        <path ... />
    </svg>
</div>

Only the calendar styles

@import 'node_modules/@sb1/ffe-datepicker/less/calendar.less';

Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)

<div class="ffe-calendar ffe-calendar--datepicker">
    <div class="ffe-calendar__header">
        <div class="ffe-calendar__header-inner-wrapper">
            <button class="ffe-calendar__month-nav ffe-calendar__previous">
                <svg class="ffe-calendar__icon-prev">
                    <path ... />
                </svg>
            </button>
            <header class="ffe-calendar__title">
                <div id="ffe-calendar-499__month-label">
                    <span class="ffe-calendar__month">Juni</span>
                    <span class="ffe-calendar__year">2016</span>
                </div>
            </header>
            <button class="ffe-calendar__month-nav ffe-calendar__next">
                <svg class="ffe-calendar__icon-next">
                    <path ... />
                </svg>
            </button>
        </div>
    </div>
    <table class="ffe-calendar__grid">
        <thead>
            <tr>
                <th class="ffe-calendar__weekday">
                    <span>Man</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Tir</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Ons</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Tor</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Fre</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Lør</span>
                </th>
                <th class="ffe-calendar__weekday">
                    <span>Søn</span>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">1</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">2</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">3</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">4</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">5</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">6</span>
                </td>
                <td class="ffe-calendar__day">
                    <span class="ffe-calendar__date">7</span>
                </td>
            </tr>
            <tr>
                ... More td
            </tr>
            <tr>
                ... More td
            </tr>
            <tr>
                ... More td
            </tr>
            <tr>
                ... More td
            </tr>
        </tbody>
    </table>
</div>

Theming with CSS custom properties

In order to support theming of components, this package contains styling that depends on a set of custom properties, defined in less/theme.less. These properties in turn depend on a base theme defined in ffe-core.

If your project uses the ffe-core, you're probably good to go. If not, make sure to import the core properties in theme.less:

@import '~@sb1/ffe-core/less/theme';

Development

To start a local development server, run the following from the designsystem root folder:

npm install
npm run build
npm start

A local instance of component-overview with live reloading will run at http://localhost:1234/.

Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
14.0.280latest

Version History

VersionDownloads (Last 7 Days)Published
14.0.280
14.0.27150
14.0.2677
14.0.2520
14.0.249
14.0.237
14.0.222
14.0.216
14.0.204
14.0.192
14.0.1858
14.0.172
14.0.165
14.0.153
14.0.142
14.0.131
14.0.120
14.0.110
14.0.101
14.0.90
14.0.81
14.0.70
14.0.60
14.0.50
14.0.421
14.0.30
14.0.21
14.0.10
14.0.017
13.4.036
13.3.681
13.3.521
13.3.437
13.3.31
13.3.21
13.3.13
13.3.01
13.2.019
13.1.231
13.1.122
13.1.018
13.0.1541
13.0.1418
13.0.130
13.0.121
13.0.1143
13.0.100
13.0.90
13.0.80
13.0.70
13.0.61
13.0.50
13.0.40
13.0.30
13.0.20
13.0.10
13.0.021
12.0.5934
12.0.580
12.0.5719
12.0.561
12.0.550
12.0.541
12.0.530
12.0.520
12.0.510
12.0.500
12.0.493
12.0.480
12.0.471
12.0.460
12.0.451
12.0.441
12.0.430
12.0.4216
12.0.411
12.0.4024
12.0.390
12.0.380
12.0.370
12.0.360
12.0.350
12.0.340
12.0.3315
12.0.320
12.0.311
12.0.300
12.0.290
12.0.281
12.0.270
12.0.260
12.0.250
12.0.2322
12.0.220
12.0.210
12.0.200
12.0.190
12.0.180
12.0.171
12.0.160
12.0.151
12.0.140
12.0.130
12.0.120
12.0.110
12.0.100
12.0.91
12.0.80
12.0.70
12.0.60
12.0.51
12.0.417
12.0.30
12.0.20
12.0.11
12.0.00
11.1.14
11.1.031
11.0.916
11.0.81
11.0.729
11.0.60
11.0.515
11.0.44
11.0.30
11.0.21
11.0.10
11.0.00
10.1.222
10.1.10
10.1.00
10.0.4816
10.0.470
10.0.460
10.0.450
10.0.440
10.0.430
10.0.421
10.0.410
10.0.400
10.0.390
10.0.380
10.0.371
10.0.360
10.0.350
10.0.340
10.0.330
10.0.321
10.0.311
10.0.300
10.0.290
10.0.280
10.0.272
10.0.260
10.0.251
10.0.240
10.0.230
10.0.220
10.0.211
10.0.200
10.0.190
10.0.181
10.0.170
10.0.160
10.0.150
10.0.140
10.0.130
10.0.121
10.0.111
10.0.100
10.0.90
10.0.80
10.0.721
10.0.60
10.0.50
10.0.41
10.0.30
10.0.20
10.0.11
10.0.00
9.0.01
8.0.1116
8.0.100
8.0.90
8.0.818
8.0.70
8.0.61
8.0.50
8.0.41
8.0.30
8.0.20
8.0.10
8.0.00
7.0.20
7.0.10
7.0.01
6.0.170
6.0.160
6.0.150
6.0.141
6.0.130
6.0.120
6.0.111
6.0.100
6.0.90
6.0.80
6.0.70
6.0.60
6.0.50
6.0.40
6.0.30
6.0.20
6.0.10
6.0.01
5.2.03
5.1.50
5.1.40
5.1.30
5.1.20
5.1.11
5.1.00
5.0.540
5.0.530
5.0.520
5.0.510
5.0.500
5.0.491
5.0.480
5.0.470
5.0.460
5.0.451
5.0.440
5.0.430
5.0.421
5.0.410
5.0.400
5.0.390
5.0.380
5.0.370
5.0.360
5.0.350
5.0.341
5.0.331
5.0.320
5.0.311
5.0.300
5.0.290
5.0.280
5.0.270
5.0.260
5.0.250
5.0.240
5.0.230
5.0.221
5.0.211
5.0.201
5.0.190
5.0.181
5.0.170
5.0.160
5.0.150
5.0.140
5.0.130
5.0.120
5.0.110
5.0.100
5.0.91
5.0.80
5.0.71
5.0.60
5.0.50
5.0.40
5.0.30
5.0.21
5.0.10
5.0.00

Package Sidebar

Install

npm i @sb1/ffe-datepicker

Weekly Downloads

1,179

Version

14.0.28

License

MIT

Unpacked Size

27.4 kB

Total Files

7

Last publish

Collaborators

  • antidecaf
  • sb1-designsystem
  • kwltrs
  • erlingk